Beispiel #1
0
        void Update()
        {
            if (!playerInput.InputIsFresh)
            {
                return;
            }

            timeSinceLastFire += Time.deltaTime;

            var tryToDropBomb = UsePlayerInput ? playerInput.input.Fire2 : false;

            if (BombDropped && tryToDropBomb)
            {
                AFEventManager.INSTANCE.PostEvent(AFEvents.BombTrigger(settings.playerNumber, true));
            }
            else if (tryToDropBomb && timeSinceLastFire >= minTimeBetweenFire)
            {
                timeSinceLastFire = 0;

                BombDropped = true;
                var newBomb = Instantiate(bombPrefab, transform.position, transform.rotation);
                newBomb.PlayerOwnerNumber = settings.playerNumber;
                newBomb.color             = settings.color;
            }
        }
Beispiel #2
0
        private void TriggerExplosionDueToLifeTime()
        {
            if (AlreadyTriggered)
            {
                return;
            }

            AFEventManager.INSTANCE.PostEvent(AFEvents.BombTrigger(settings.PlayerOwnerNumber, false));
            TriggerExplosion();
        }