Пример #1
0
        public void StopShooting()
        {
            if (action == null)
            {
                return;
            }

            TimedActionManager
            .GetInstance()
            .UnregisterAction(action, this);

            action = null;
        }
Пример #2
0
        public void StartShooting(float interval)
        {
            if (action != null)
            {
                Debug.Log("[TurretEntity] Turret is already shooting");
                return;
            }

            action =
                TimedActionManager
                .GetInstance()
                .RegisterAction(
                    () =>
            {
                DoShoot();
            },
                    this,
                    interval
                    );
        }