Beispiel #1
0
    //케릭터이동 만들기. 키입력을하여만듦
    void InputProcess()
    {
        float fMoveDist = m_fMoveSpeed * Time.deltaTime;
        float fRotAngle = m_fRotSpeed * Time.deltaTime;

        if (Input.GetMouseButtonDown(0))
        {
            m_cArm.m_cTarget = m_cTarget;
            m_cArm.AttackStart();
            if (m_cTarget)
            {
                m_cPlayer.Attack(m_cTarget);
            }
        }
        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(Vector3.forward * fMoveDist);
        }
        if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(Vector3.back * fMoveDist);
        }
        if (Input.GetKey(KeyCode.A))
        {
            transform.Rotate(Vector3.up * -m_fRotSpeed);
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Rotate(Vector3.up * m_fRotSpeed);
        }
    }
Beispiel #2
0
    //private void OnGUI()
    //{
    //    if(GUI.Button(new Rect(0,0,100,20),"test"))
    //    {
    //        StartCoroutine("AutoAttack");
    //    }
    //}

    IEnumerator AutoAttack()
    {
        //Debug.Log("AutoAttack! 1");
        while (m_cArm == true)
        {
            m_cArm.AttackStart();
            //Debug.Log("AutoAttack! loop");
            yield return(new WaitForSeconds(m_fAttakSpeed));//공격속도마다 공격을 부른다.
        }
        //Debug.Log("AutoAttack! 2");
    }