Beispiel #1
0
    void onZeroHealth()
    {
        Strike strike = mStrikeManager.getNext() as Strike;

        strike.activate(transform.position, mStrikeManager);
        deactivate();
    }
Beispiel #2
0
    public void launchBullet(Bullet.onTargetAcquired func)
    {
        Bullet bullet = mSpawnManager.getNext() as Bullet;

        bullet.activate(transform.position, mSpawnManager);
        bullet.setVelocity(transform.forward * GameConstants.kBulletStartSpeed);
        bullet.setTargetAcquiredFunc(func);
        bullet.RpcSetVelocity(transform.forward * GameConstants.kBulletStartSpeed);
    }
Beispiel #3
0
 // Update is called once per frame
 void Update()
 {
     if (!mIsServerStarted)
     {
         return;
     }
     mTimeSinceLastLaunch += Time.deltaTime;
     if (mTimeSinceLastLaunch >= GameConstants.kEnemyAppearInterval)
     {
         mTimeSinceLastLaunch = 0f;
         Vector3 startPos = new Vector3();
         startPos.z = GameConstants.kTopBorder;
         startPos.x = Random.Range(GameConstants.kLeftBorder, GameConstants.kRightBorder);
         Enemy enemy = mEnemyStore.getNext() as Enemy;
         enemy.activate(startPos, mEnemyStore);
     }
 }