Beispiel #1
0
        private void SetUnitsBehaviorMode(UnitBehaviorMode mode)
        {
            foreach (UnitModel enemy in enemies)
                enemy.UnitBehaviorMode = mode;

            pacman.UnitBehaviorMode = mode;
        }
Beispiel #2
0
        public void FixedUpdate()
        {
            if (isPause)
                return;

            if (isBonusTime)
            {
                bonusAccessTime -= Time.deltaTime;

                if (bonusAccessTime <= 0)
                {
                    isBonusTime = false;
                    OnBonusRemoved();
                }
            }

            if (UnitsBehaviorMode == UnitBehaviorMode.frightening)
            {
                frighteningTime -= Time.deltaTime;

                if (frighteningTime <= 0)
                    UnitsBehaviorMode = UnitBehaviorMode.normal;
                else
                    return;
            }

            if (currentEnemyBehaviorPeriod == null)
                return;

            currentEnemyBehaviorPeriod.time -= Time.deltaTime;

            if (currentEnemyBehaviorPeriod.time <= 0)
                ApplyNextEnemyBehaviorMode();
        }
Beispiel #3
0
        public void SetFrighteningBehaviorMode()
        {
            catchedFrightenedEnemyCount = 0;

            frighteningTime = gameData.defs.levels[gameController.Level].enemyBehavior.frighteningTime;
            UnitsBehaviorMode = UnitBehaviorMode.frightening;

            foreach (EnemyModel enemy in enemies)
                enemy.SetFrighteningBehavior(frighteningTime);
        }