Ejemplo n.º 1
0
        public void RunRocket()
        {
            var targetIsValid = _targetKnower.CurrentTarget != null && _targetKnower.CurrentTarget.Transform.IsValid();

            if (targetIsValid)
            {
                if (_tank == null || _tank.HasFuel())
                {
                    //Debug.Log(name + " is flying at " + _targetKnower.CurrentTarget.Transform);
                    _pilot.Fly(_targetKnower.CurrentTarget);
                }

                if (_pilot.StartDelay <= 0)
                {
                    _detonator.AutoDetonate(_targetKnower.CurrentTarget);
                }
            }
            //else
            //{
            //    Debug.Log(name + " has no target");
            //}
            if (_tank != null && !_tank.HasFuel())
            {
                _targetKnower.Deactivate();
            }
        }