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
 public void Awake()
 {
     _healthbar          = GetComponentInChildren <EnemyHealthbar>();
     _nav                = GetComponent <NavMeshAgent>();
     _anim               = GetComponent <Animator>();
     _rb                 = GetComponent <Rigidbody>();
     _audio              = GetComponent <AudioSource>();
     _nav.updateRotation = false;
 }
Exemplo n.º 3
0
    private void Awake()
    {
        CurrentHealth = m_MaxHealth;
        m_Renderer    = GetComponentInChildren <MeshRenderer>();

        PauseCheck.Pause += TogglePause;

        m_EnemyHealthbar = GetComponent <EnemyHealthbar>();
    }
Exemplo n.º 4
0
 private void SpawnHealthbar()
 {
     GameObject obj = MainGui.Instance.SpawnFollowObj(this.HealthbarObj, transform, Vector3.up * this.HealthbarOffset);
     this.healthBar = obj.GetComponent<EnemyHealthbar>();
 }