Пример #1
0
 private void DamagePlayer()
 {
     if (_playerHealth != null && _playerEmotions != null)
     {
         _playerHealth.DamageUnit(damage);
         _playerEmotions.SetMood(false, -0.2f);
     }
 }
Пример #2
0
 public void OnTriggerEnter2D(Collider2D p_collider)
 {
     if (p_collider.tag == "Player")
     {
         if (_playerEmotions == null)
         {
             _playerEmotions = p_collider.GetComponent <Emotions>();
         }
         if (_playerEmotions.GetMood() <= requiredRage)
         {
             SFXManager.Instance.PlaySFX(breakClip);
             _playerEmotions.SetMood(false, emotionChanger);
             var __color = mainColor.GetColor();
             ApplyColors(__color);
             wall.SetActive(false);
             fragments.SetActive(true);
         }
     }
 }
Пример #3
0
    //Organiza os dados
    private void UpdateAllData()
    {
        _data[2] = _data[1];
        _data[1] = _data[0];
        UpdateDataNow();

        float __newValue = 0f;

        __newValue = DataAnalyzer.CalculateEmotionLevels(_data, __newValue);
        //Debug.Log(_data[0].health);
        //__newValue = FuzzyAnalyser.CalculateEmotionLevels(_data, __newValue);
        //Debug.Log(__newValue);
        if (_timesDataUpdated >= 3 && !_playerEmotions.IsRaising())
        {
            _playerEmotions.SetMood(false, __newValue);
        }

        if (_timesDataUpdated < 3)
        {
            _timesDataUpdated++;
        }
    }