Exemple #1
0
    private void AttackMinion(Minion minion)
    {
        // ANIMATION MOCK
        gameObject.GetComponent<Rigidbody>().velocity += Vector3.up * 20f;

        if (IsCriticalStrike())
        {
            //Play CRITICAL ATTACK ANIMATION
            minion.RecieveDamage(GetDamageOutput() * 2, this);
        }
        else
        {
            //Play NORMAL ATTACK ANIMATION
            minion.RecieveDamage(GetDamageOutput(), this);
        }

        if(!peloton.victims.Contains(minion.peloton)) peloton.victims.Add(minion.peloton);
        if (!minion.peloton.menaces.Contains(peloton)) minion.peloton.menaces.Add(peloton);

        atkCooldown = 1f;

        anim.Play("Attack", 1, 0);
        skinnedMesh.SetBlendShapeWeight(1, 100);
        skinnedMesh.SetBlendShapeWeight(2, 0);
        //transform.LookAt(minion.transform.position);

        transform.LookAt(2 * transform.position - minion.transform.position);
    }