Example #1
0
    IEnumerator RollYR()
    {
        //回転中のフラグを立てる
        script.isRotate = true;
        //回転処理
        float sumAngle = 0f; //angleの合計を保存

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

            // 90度以上回転しないように値を制限
            if (sumAngle > 90f)
            {
                cubeAngle -= sumAngle - 90f;
            }
            transform.RotateAround
            (
                Center.transform.position,
                Vector3.up,
                cubeAngle
            );


            yield return(null);
        }
        BottunScriptR.SetisClicked(false);
        //回転中のフラグを倒す
        script.isRotate = false;
        Mathf.Ceil(transform.rotation.x);
        Mathf.Ceil(transform.rotation.y);
        Mathf.Ceil(transform.rotation.z);
        yield break;
    }
Example #2
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;
    }