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

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

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

            command.Execute();
        }
Example #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();
        }
Example #5
0
    public CharacterValueSO ChoseDefaultValue()
    {
        var defaultValue = Resources.Load <CharacterValueSO>(pathDefaultCharacterValue);

        CustomDebug.LogMessage("Set Default Value", DebugColor.blue);
        CustomDebug.LogMessage(defaultValue);
        return(defaultValue);
    }
Example #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);
 }
Example #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);
        }
Example #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);
     }
 }
Example #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();
     }
 }
Example #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);
        }
Example #12
0
 public override void ExitState()
 {
     CustomDebug.LogMessage("Dead exit!", DebugColor.green);
 }
Example #13
0
 public override void EnterState()
 {
     CustomDebug.LogMessage("Attack enter!", DebugColor.green);
     SendAttackCommand();
 }
Example #14
0
 public override void EnterState()
 {
     timerToFlip = ResetTimer();
     CustomDebug.LogMessage("Idle enter!", DebugColor.green);
 }