示例#1
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();
     }
 }
示例#2
0
        public StatusController(CharacterValueSO valueSO, Action deadAction)
        {
            _deadAction += deadAction;

            speedModificator = valueSO.GetSpeedModificator();

            maxHealth = valueSO.characterHealth;
            maxEnergy = valueSO.characterEnergy;
            maxSpeed  = valueSO.characterSpeed;

            _currentHealth = maxHealth;
            _currentEnergy = maxEnergy;

            _reloadValue = valueSO.characterReload;

            //test
            isCheat = valueSO.isCheat;
        }