void Initialize() { AkSoundEngine.SetState("sync_level", "layer_1"); PhasingBar.Value = 0; phaseState = EStatePhase.NO_PHASE; HandleStateChange(); }
void CheckForStateChange() { EStatePhase newStateId; if (distBetweenShips > PrePhaseTriggerDist) { newStateId = EStatePhase.NO_PHASE; } else if (PhasingBar.Value >= TotalPhasingThreshold) { newStateId = EStatePhase.PHASE; } else { newStateId = EStatePhase.PRE_PHASE; } if (!phaseState.Equals(newStateId)) { if (phaseState == EStatePhase.NO_PHASE) { NotifySpaceships(true); } else if (newStateId == EStatePhase.NO_PHASE) { NotifySpaceships(false); } phaseState = newStateId; HandleStateChange(); } }
public void SetWeapon(EStatePhase state) { if (weaponGO) { Destroy(weaponGO); } weaponGO = Instantiate(Weapons[(int)state], Cursor.transform); weapon = weaponGO.GetComponent <WeaponSpaceship>(); weapon.Spaceship = this; weapon.Cursor = Cursor; weapon.SetPhased(phasedWeapon); }
void SetSpaceshipsWeapon(EStatePhase state) { Spaceships[0].SetWeapon(state); Spaceships[1].SetWeapon(state); }