コード例 #1
0
ファイル: GameController.cs プロジェクト: HygenicDuck/jigsaw
    FaceState GetNextRequiredFace(CubeState.RotationActions move)
    {
        FaceStates faceStates  = m_cubeOrientation.GetFaceStates();
        FaceState  returnValue = null;

        switch (move)
        {
        case CubeState.RotationActions.UP:
            returnValue = faceStates.GetFaceState(CubeState.Faces.BOTTOM);
            break;

        case CubeState.RotationActions.DOWN:
            returnValue = faceStates.GetFaceState(CubeState.Faces.TOP);
            break;

        case CubeState.RotationActions.LEFT:
            returnValue = faceStates.GetFaceState(CubeState.Faces.RIGHT);
            break;

        case CubeState.RotationActions.RIGHT:
            returnValue = faceStates.GetFaceState(CubeState.Faces.LEFT);
            break;
        }

        Debug.Log("GetNextRequiredFace = " + returnValue);

        return(returnValue);
    }
コード例 #2
0
ファイル: CubeState.cs プロジェクト: HygenicDuck/jigsaw
 public bool CheckState(FaceStates states)
 {
     for (int i = 0; i < 6; i++)
     {
         if (m_faceStates[i].m_state != states.m_faceStates[i].m_state)
         {
             return(false);
         }
         if (m_faceStates[i].m_orientation != states.m_faceStates[i].m_orientation)
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #3
0
ファイル: GameController.cs プロジェクト: HygenicDuck/jigsaw
    void CheckIfCorrect()
    {
        TutorialManager.Instance.ClearAllTutorialMessages();

        FaceStates faceStates = m_cubeOrientation.GetFaceStates();

        if (!m_cubeState.CheckState(faceStates))
        {
            Debug.LogError("ERROR!!!! difference in facestates");
        }

        int levelNum = 0;

        if (m_gameStateClass != null)
        {
            levelNum = m_gameStateClass.GetLevelNumber();
        }

        bool correctOrientation = (faceStates.GetFaceState(CubeState.Faces.FRONT).m_orientation == m_requiredFace.m_orientation);
        bool levelRequiresCorrectCubeOrientation = true;

        if (levelNum < m_levelRequiresCorrectCubeOrientation.Length)
        {
            levelRequiresCorrectCubeOrientation = m_levelRequiresCorrectCubeOrientation [levelNum];
        }

        if ((faceStates.GetFaceState(CubeState.Faces.FRONT).m_state == m_requiredFace.m_state) &&
            (correctOrientation || !levelRequiresCorrectCubeOrientation))
        {
            // correct
            //IncrementScore();
            m_hudController.AdvanceProgression(m_faceFoundCount);

            m_requiredFace = GetNextRequiredFace(GetNextMoveInSequence());
            //PickRandomRequiredFace();
            StartCoroutine(CorrectFaceSequence());
        }
        else
        {
            // wrong
            StartCoroutine(GotItWrongCoRoutine());
        }
    }
コード例 #4
0
 public FaceChangedEventArgs(FaceStates faceState)
 {
     FaceState = faceState;
 }