示例#1
0
        public override void ExitState()
        {
            CustomDebug.LogMessage("Idle exit!", DebugColor.red);
            ICommand command = new ChangeAnimationCommand(owner, GetType());

            command.Execute();
        }
示例#2
0
        public override void EnterState()
        {
            CustomDebug.LogMessage("Dead enter!", DebugColor.green);
            ICommand deadCMD = new DeadAnimationCommand(owner, GetType());

            deadCMD.Execute();
        }
示例#3
0
        public override void ExitState()
        {
            _movementLogic.InteractObstacle();
            CustomDebug.LogMessage("Move exit!", DebugColor.red);
            ICommand command = new ChangeAnimationCommand(owner, GetType());

            command.Execute();
        }
示例#4
0
        public override void EnterState()
        {
            CustomDebug.LogMessage("Move enter!", DebugColor.green);
            CustomDebug.LogMessage(owner.StatusController.GetSpeedModificator());
            ICommand command = new ChangeAnimationCommand(owner, GetType(), owner.StatusController.GetSpeedModificator());

            command.Execute();
        }
示例#5
0
    public CharacterValueSO ChoseDefaultValue()
    {
        var defaultValue = Resources.Load <CharacterValueSO>(pathDefaultCharacterValue);

        CustomDebug.LogMessage("Set Default Value", DebugColor.blue);
        CustomDebug.LogMessage(defaultValue);
        return(defaultValue);
    }
示例#6
0
        public override void ExitState()
        {
            owner.StatusController.SetReloadTime(Time.time);
            CustomDebug.LogMessage("Attack exite!", DebugColor.red);
            ICommand command = new ChangeAnimationCommand(owner, GetType());

            command.Execute();
        }
 public void AddModuleInList(IUpdatableModule module)
 {
     CustomDebug.LogMessage($"Add module - {module}", DebugColor.orange);
     if (_allUpdatableModule.Contains(module))
     {
         return;
     }
     _allUpdatableModule.Add(module);
 }
示例#8
0
        public void HandleCommand(DamageValue <AbstractCharacter> value)
        {
            if (isCheat)
            {
                return;
            }
            if (isRetreat)
            {
                isRetreat = false;
            }
            var deltaDamage = _currentHealth - value.damageValue;

            _currentHealth = (deltaDamage > 0) ? deltaDamage : Dead();
            CustomDebug.LogMessage(CurrentHealth);
        }
示例#9
0
 private void CheckExceptionAnimatorComponent()
 {
     try
     {
         if (GetComponent <Animator>() == null)
         {
             CustomDebug.LogMessage($"Exeption! No comonent - ANIMATOR in object - <b>{gameObject.name}</b>!", DebugColor.red);
             throw new Exception();
         }
     }
     catch (Exception e)
     {
         CustomDebug.LogMessage(e, DebugColor.red);
         gameObject.AddComponent <Animator>();
         CustomDebug.LogMessage($"Add new component - ANIMATOR is object - {gameObject.name}", DebugColor.blue);
     }
 }
示例#10
0
 private void CheckExeptionInCharacterValue()
 {
     try
     {
         if (characterValue is null)
         {
             CustomDebug.LogMessage($"Exeption! No VALUE SO in object - <b>{gameObject.name}</b>!", DebugColor.red);
             throw new Exception();
         }
     }
     catch (Exception e)
     {
         CustomDebug.LogMessage(e, DebugColor.red);
         var valueExeption = new CharacterValueExeption();
         characterValue = valueExeption.ChoseDefaultValue();
     }
 }
示例#11
0
        private bool CheckExeptionInLibrary(Type type)
        {
            bool result = true;

            try
            {
                if (!_objectLibrary.ContainsKey(type))
                {
                    throw new Exception();
                }
            }
            catch (Exception e)
            {
                CustomDebug.LogMessage(e, DebugColor.red);
                CustomDebug.LogMessage($"No object - {type} in CreatorLibrary!", DebugColor.red);
                result = false;
            }

            return(result);
        }
示例#12
0
 public override void ExitState()
 {
     CustomDebug.LogMessage("Dead exit!", DebugColor.green);
 }
示例#13
0
 public override void EnterState()
 {
     CustomDebug.LogMessage("Attack enter!", DebugColor.green);
     SendAttackCommand();
 }
示例#14
0
 public override void EnterState()
 {
     timerToFlip = ResetTimer();
     CustomDebug.LogMessage("Idle enter!", DebugColor.green);
 }