예제 #1
0
 void Initialize()
 {
     AkSoundEngine.SetState("sync_level", "layer_1");
     PhasingBar.Value = 0;
     phaseState       = EStatePhase.NO_PHASE;
     HandleStateChange();
 }
예제 #2
0
    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();
        }
    }
예제 #3
0
    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);
    }
예제 #4
0
 void SetSpaceshipsWeapon(EStatePhase state)
 {
     Spaceships[0].SetWeapon(state);
     Spaceships[1].SetWeapon(state);
 }