コード例 #1
0
    IEnumerator landHitingProcess()
    {
        float rotateTime = 0;

        while (rotateTime <= 0.05f)//  防止误触
        {
            rotateTime += Time.deltaTime;
            rotateArm.fastRotate();
            yield return(new WaitForEndOfFrame());
        }
        do
        {
            rotateTime += Time.deltaTime;
            rotateArm.fastRotate();
            yield return(new WaitForEndOfFrame());

            if (armController.isHiting() == true && rotateTime <= 0.1f) //防止短时间蓄力
            {
                attackFail();
                yield break;
            }
        }while (armController.isHiting() == false && rotateTime <= 10f);

        initialBoom(rotateTime);
    }