Esempio n. 1
0
    private IEnumerator ScramblingCube()
    {
        yield return(new WaitForSeconds(0.3f));

        int rotations = Mathf.FloorToInt(Random.Range(ScrambleRotationsMin, ScrambleRotationsMax) * (cubeManager.CubeSize * 0.4f));

        while (rotations > 0)
        {
            cameraMovementManager.RotateAroundCenter(new Vector2(-0.3f, Mathf.Sin(Time.time * 3f) * 0.03f));
            if (cubeManager.RandomRotation())
            {
                rotations--;
            }

            if (rotations < 2)
            {
                hudManager.ShowSplashGo();
            }

            yield return(null);
        }

        cameraMovementManager.OverrideToPosition(cubeManager.CubeSize * 1.1f, -20f, 20f);
        yield return(new WaitForSeconds(0.1f));

        BeginGame();
    }
Esempio n. 2
0
    private void CheckCameraRotation()
    {
        if (CheckMainInputOn)
        {
            if (CheckMainInputBegan && InputNotOverMenu)
            {
                currentState = EngagedState.RotatingCam;
            }
        }
        else
        {
            currentState = EngagedState.Idle;
        }

        if (currentState != EngagedState.RotatingCam)
        {
            return;
        }

        cameraMovementManager.RotateAroundCenter(GetMainInputMoveDelta);
    }