Exemplo n.º 1
0
    public IEnumerator RollYL()
    {
        Debug.Log("カメラ回転-----------------------------------------------------");
        //回転中のフラグを立てる
        script.isRotate = true;
        //回転処理
        float sumAngle = 0f; //angleの合計を保存

        while (sumAngle > -90f)
        {
            cameraAngle = -1.0f; //ここを変えると回転速度が変わる
            sumAngle   += cameraAngle;

            // 90度以上回転しないように値を制限
            if (sumAngle < -90.0f)
            {
                cameraAngle -= sumAngle + 90.0f;
            }

            transform.RotateAround
            (
                targetObj.transform.position,
                Vector3.up,
                cameraAngle
            );
            yield return(null);
        }
        BottunScriptL.SetisClicked(false);



        //回転中のフラグを倒す
        script.isRotate = false;
        script.SetFront(script.nowFront, false);
        Mathf.Ceil(transform.rotation.x);
        Mathf.Ceil(transform.rotation.y);
        Mathf.Ceil(transform.rotation.z);
        yield break;
    }