예제 #1
0
    private void OnEnable()
    {
        pooler        = ObjectPooler.instance;
        shootCorutine = ShootMainGunsPhase1(1f);

        projectile = Resources.Load <GameObject>("BasicProjectile");

        currentPhase = DSPhases.PHASE1;
        currentState = DSStates.SPAWN;

        mainGunsPhase1Parent = transform.GetChild(0).gameObject;
        mainGunsPhase2Parent = transform.GetChild(1).gameObject;
        coloredGunsParent    = transform.GetChild(2).gameObject;
        coresParent          = transform.GetChild(3).gameObject;

        foreach (Transform child in mainGunsPhase1Parent.transform)
        {
            mainGunsPhase1.Add(child.gameObject);
        }
        foreach (Transform child in mainGunsPhase2Parent.transform)
        {
            mainGunsPhase2.Add(child.gameObject);
        }
        foreach (Transform child in coloredGunsParent.transform)
        {
            coloredGuns.Add(child.gameObject);
        }
        foreach (Transform child in coresParent.transform)
        {
            cores.Add(child.gameObject);
        }
        foreach (Transform child in GameObject.Find("DualShockerPoints").transform)
        {
            movePositions.Add(child);
        }

        redGun  = coloredGuns[0];
        blueGun = coloredGuns[1];
    }
예제 #2
0
 public void ChangeState(DSStates newState) //Changes state from current state to newState
 {
     currentState = newState;
 }