Esempio n. 1
0
    void Start()
    {
        mRigidbody2D   = GetComponent <Rigidbody2D>();
        mBulletManager = GameObject.Find("BossBulletSpawn").GetComponent <BossBulletManager>();
        mGunMotor      = GameObject.Find("BossBulletSpawn").GetComponent <GunMotor>();
        mHealth        = GetComponent <Health>();

        mMovementPattern   = mBossPhases[mCurrentPhase].data[mCurrentSubPhase].movementPattern;
        mGunMotor.mGunData = mBossPhases[mCurrentPhase].data[mCurrentSubPhase].gunData;
        mGunMotor.initializeGunTimers();
    }
 public void switchPhases()
 {
     if (mHealth.mHealthDepleted == true)
     {
         if (mCurrentPhase + 1 < mBossPhases.Length)
         {
             mHealth.mCurrentHealth  = mHealth.mStartHealth;
             mHealth.mHealthDepleted = false;
             mCurrentPhase++;
             mCurrentPhase     %= mBossPhases.Length;
             mCurrentSubPhase   = 0;
             mMovementPattern   = mBossPhases[mCurrentPhase].data[mCurrentSubPhase].movementPattern;
             mGunMotor.mGunData = mBossPhases[mCurrentPhase].data[mCurrentSubPhase].gunData;
             mGunMotor.initializeGunTimers();
         }
         else
         {
             mAnimator.SetBool("Dead", true);
         }
     }
 }