![]() |
BomberUnits
...a Unity learning project
|
Is serialized and as such initialized by Unity as part of the PlayerController. More...
Collaboration diagram for BombHandler:Public Member Functions | |
| void | Init (CharSettings charSettings, MovementState moveState, InputState inputState, Player player) |
| void | Run () |
| void | SendSynced (PhotonStream stream) |
| void | ReceiveSynced (PhotonStream stream) |
| Transform | RegisterBomb (Bomb b) |
| Called by placed bombs to allow keeping track of them, even on remotes. More... | |
| void | OnBombBtnDown () |
| Stages a bomb for this player if the following conditions are fulfilled: More... | |
| void | OnBombBtnUp (float pressDuration) |
Public Attributes | |
| GameObject | bombPrefab |
| GameObject | targetBombUiPrefab |
| GameObject | targetTileUiPrefab |
| GameObject | trajectoryUIPrefab |
| Transform | bombSpawn |
| int | bombRange |
| int | maxBombs |
Private Member Functions | |
| void | UpdateSnappedLookDir () |
| void | UpdateInteractionTargets () |
| Tries to find the objects (bomb and tile) relevant for this cycle: | |
| Bomb | CheckForInteractableBomb (Tile thisTile) |
| Returns the Bomb reference for a currently interactable placed bomb. | |
| Bomb | GetBombOnOwnTile (Tile thisTile) |
| Bomb | GetBombOnNeighTile (Tile thisTile) |
| Returns the closest own bomb from the placedBombs list. More... | |
| Tile | GetThrowTargetTile (Bomb bomb, Tile thisTile) |
| void | ShowUiCues () |
| Precondition is that the interactable bomb and the target tile are valid! Also the snappedLookDir has to be valid! | |
| void | ShowBombFocusUI () |
| void | ShowKickableTrajectoryUI (WorldDir dir) |
| The target tile is not highlighted for kicking, but it enables kicking in the first place! The relative positions of the UI points is hardcoded here. More... | |
| void | ShowThrowableTrajectoryUI () |
| void | HideUiCues () |
| void | TryToHoldBomb () |
| void | PlaceHeldBomb () |
| void | Kick (Bomb b) |
| void | Throw (Bomb b) |
| void | Cleanup () |
Private Attributes | |
| float | bombCooldown |
| float | bombCountdown |
| float | kickVelocity |
| float | throwDist |
| MovementState | moveState |
| InputState | inputState |
| Player | player |
| GameObject | targetTileUi |
| GameObject | targetBombUi |
| GameObject [] | trajectoryUIPoints |
| List< Bomb > | placedBombs = new List<Bomb>() |
| Bomb | heldBomb = null |
| Bomb | curInteractableBomb = null |
| Tile | curTargetTile = null |
| float | remainingBombCooldown = 0 |
| float | kickBombSelectionAngleTolerance |
| const int | numTrajPtsAvailable = 10 |
| WorldDir | snappedLookDir = WorldDir.INVALID |
Is serialized and as such initialized by Unity as part of the PlayerController.
Needed information has to be passed to it before the first cycle.
Definition at line 15 of file BombHandler.cs.
Returns the closest own bomb from the placedBombs list.
A bomb is also only eligible if we are roughly looking at it.
Definition at line 206 of file BombHandler.cs.
|
inline |
Stages a bomb for this player if the following conditions are fulfilled:
Definition at line 134 of file BombHandler.cs.
|
inline |
Called by placed bombs to allow keeping track of them, even on remotes.
Also returns some needed info: the transform at which the bomb is held initially.
Definition at line 119 of file BombHandler.cs.
|
inlineprivate |
The target tile is not highlighted for kicking, but it enables kicking in the first place! The relative positions of the UI points is hardcoded here.
Definition at line 262 of file BombHandler.cs.
|
private |
Definition at line 53 of file BombHandler.cs.