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

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

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

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

        CustomDebug.LogMessage("Set Default Value", DebugColor.blue);
        CustomDebug.LogMessage(defaultValue);
        return(defaultValue);
    }
Exemplo n.º 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();
        }
Exemplo n.º 7
0
 public void AddModuleInList(IUpdatableModule module)
 {
     CustomDebug.LogMessage($"Add module - {module}", DebugColor.orange);
     if (_allUpdatableModule.Contains(module))
     {
         return;
     }
     _allUpdatableModule.Add(module);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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();
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 12
0
 public override void ExitState()
 {
     CustomDebug.LogMessage("Dead exit!", DebugColor.green);
 }
Exemplo n.º 13
0
 public override void EnterState()
 {
     CustomDebug.LogMessage("Attack enter!", DebugColor.green);
     SendAttackCommand();
 }
Exemplo n.º 14
0
 public override void EnterState()
 {
     timerToFlip = ResetTimer();
     CustomDebug.LogMessage("Idle enter!", DebugColor.green);
 }