示例#1
0
    //============================ UNITY FUNCTIONS ============================================

    protected virtual void Awake()
    {
        //Seteos iniciales.
        anims    = GetComponentInChildren <Animator>();
        agent    = GetComponent <NavMeshAgent>();
        MainColl = GetComponent <Collider>();
        rb       = GetComponent <Rigidbody>();
        FRitmo   = GetComponent <FeedbackRitmo>();

        EnemyHealthBar.SetApha(0f);

        Target = GameObject.FindGameObjectWithTag("Player").transform;
        if (Target != null)
        {
            //print("Encontré al jugador");
            sight.target = Target;
        }

        agent.speed = MovementSpeed;

        EnemyHealthBar.MaxValue = MaxHP;
        Health = MaxHP;
    }