Skip to content

Conversation

@Toreole
Copy link

@Toreole Toreole commented Jul 3, 2022

This is the final version that will be shown as a graduation project.
Should be merged and have a tag created.

malibloo and others added 30 commits December 6, 2021 23:41
Add Player Ship placeholder model,
Add Player prefab,
Add Sandbox scene
Add camera following player
- Committing automatically modified packages. This shouldn't break anything.
- Added a folder for all directly weapon/shooting-related C# files: "Weapons" to "_Scripts/Runtime/Weapons".
- Removed unused `using`-directives in Game.cs.
- Added the "WeaponTesting" scene for testing the weapons and shooting mechanics.
- Added a base-class for all specific weapons, the abstract `Weapon` class, inheriting `MonoBehaviour`.
- Added a WeaponController.cs file, which will handle input and general weapon controls.
- Imported the (new) Input System to the project.
- Added an abstract `Shoot` method inside the `Weapon` class.
- Added (empty) `OnEnable` and `OnDisable` methods in WeaponController.cs, which will be needed in the near future.
- Set-up basic input actions in the (new) Input System.
- Add InputSystem to assembly definition.
The main focus of this commit is setting up a first example of receiving input and executing something upon that.

Unity:
- Added a cube, representing a "player" and a cuboid, the weapon.
- Created a "Specific Weapons" folder inside the "Weapons" folder to contain all the files for the specific weapon files, whose classes inherit `Weapon`.
- Switched the location of the files that are relevant for the input.

WeaponsController.cs:
- Added a summary to the `WeaponsController` class.
- Added 3 fields
    - One for the reference to the `MainInput` instance for the input...
    - ... the other one for storing the currently selected `Weapon`...
    - ... and the third one as a reference to the physical GameObject, representing the Weapon.
- Added `Awake()` method, where a temporary solution for the input has been set-up (right now, the WeaponController creates a new `MainInput` instance, later it should be a global reference), as well as adding the current weapon component to the weapon object is performed there.
- Added event for firing the weapon.

Weapon.cs:
- Changed method signature of `Shoot` to contain an `InputAction.CallbackContext` parameter.

Gun.cs:
- Created a first example class, that's deriving from `Weapon`. It represents a firearm/gun.
- Implemented a `Debug.Log` into the overridden `Shoot` method.

Input Actions:
- Added a "Weapons" Input Action.
- Added a "Fire" binding, bound to the Left mouse button for now.
- Added a folder inside the "Assets/_Game/_Scripts/Runtime/Weapons/" directory, which will contain the files for all the interfaces that will be relevant for the weapons-mechanic.
This commit focuses on STARTING the system to allow different weapons having a specific fire-type (semi-automatic, automatic, burst, continuous). It also contains some extending of the folder structure and project organisation.

- `Gun` class is `abstract` now.
- Weapon.cs contains an enum `FireType` that specifies the fire-type with 4 different modes (SemiAutomatic, Automatic, Burst, Continuous).
- `Weapon` class contains two protected properties (WeaponFireType as `FireType` and FireTime as `float`).

- Added a "Weapons" folder in "Assets/_Game/" directly, which will (temporarily) contain all the important aesthetic files (materials, models, prefabs, maybe sound effects etc.).
    - Inside this folder, there are "Materials", "Models" (currently empty) and "Prefabs".
- Created a prefab for an example semi-auto rifle.
    - Added a simple yellow material to this weapon.
@Toreole Toreole requested a review from fouman75 July 3, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants