Пример #1
0
    //애니매이션 재생
    IEnumerator Animation(float delayTime, UnitInfo temp)
    {
        float time = 0;

        Quaternion startRot1 = transform.rotation;
        Quaternion endRot1   = Quaternion.LookRotation(temp.transform.position - transform.position);
        Quaternion startRot2 = temp.transform.rotation;
        Quaternion endRot2   = Quaternion.LookRotation(transform.position - temp.transform.position);

        while (time < 1)
        {
            transform.rotation      = Quaternion.Lerp(startRot1, endRot1, time);
            temp.transform.rotation = Quaternion.Lerp(startRot2, endRot2, time);
            time += Time.deltaTime * rotSpeed;
            yield return(null);
        }
        anim.Attack();//가격 애니메이션 실행
        yield return(new WaitForSeconds(delayTime));

        if (temp.HP > 0)
        {
            if (Kinds == "Healer")
            {
                temp.anim.HEAL();
            }
            else
            {
                temp.anim.Block();
            }
        }
        else
        {
            temp.DIE();
        }
    }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         attack.Fire();
         anim.Attack();
     }
 }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     Movement();
     if (Input.GetMouseButtonDown(0) && IsGrounded() == true && isDead == false)
     {
         _playerAnim.Attack();
     }
 }