Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        _am        = GameObject.FindObjectOfType <ActionMenu>();
        _m         = GameObject.FindObjectOfType <Manager>();
        _anim      = GetComponent <Animator>();
        _healthbar = GetComponentInChildren <EnemyHealthbar>();
        _skill_img = FindObjectOfType <EnemySkillImages>();
        _as        = GetComponent <AudioSource>();

        if (_anim != null)
        {
            _anim.SetBool("Hyped", false);
            _anim.SetBool("Bored", false);
        }

        foreach (LearntSkills skill in available_skills)
        {
            sum_of_weights += skill.weight;
        }
        if (_healthbar != null)
        {
            _healthbar.UpdateBars(hype / max_hype, boredom / max_boredom, action_timer / Manager._ACT_TRIGGER_);
        }

        GetNextSkill();
    }
Exemplo n.º 2
0
 private void LateUpdate()
 {
     if (_healthbar != null)
     {
         _healthbar.UpdateBars((float)hype / max_hype, (float)boredom / max_boredom, action_timer / Manager._ACT_TRIGGER_);
     }
 }