예제 #1
0
    void Start()
    {
        _moduleId = _moduleIdCounter++;

        for (int i = 0; i < 4; i++)
        {
            int j = i;
            DirectionalButtons [i].OnInteract += delegate() {
                HandleDirectionalButton(j); return(false);
            };
        }
        for (int i = 0; i < 2; i++)
        {
            int j = i;
            RotationalButtons [i].OnInteract += delegate() {
                HandleRotationalButton(j); return(false);
            };
        }
        for (int i = 0; i < 2; i++)
        {
            int j = i;
            ScrollerButtons [i].OnInteract += delegate() {
                HandleScrollerButton(j); return(false);
            };
        }
        ButtonVerifySolution.OnInteract += HandleVerifySolution;

        int solution_index = Rnd.Range(0, solutionNames.Count);

        solutionState = solutionStates[solution_index];
        solutionName  = solutionNames[solution_index];

        scroller     = new Scroller(solutionNames, ScrollerText);
        displayboard = new Board_6x6(solutionState);

        UpdateGrid(displayboard.getBoardState());
        FocusBox.transform.localPosition = displayboard.getFocusBoxCoords();

        Debug.LogFormat("[Grid Matching #{0}] Seed Grid: {1} Seed Label: {2}", _moduleId, solutionStates[solution_index], solutionName);
        Board_6x6.printBoard(solutionStates[solution_index]);
        Debug.LogFormat("[Grid Matching #{0}] Solution Grid: {1}  Solution Label: {2}", _moduleId, displayboard.getSolutionState(), solutionName);
        Board_6x6.printBoard(displayboard.getSolutionState());
        Debug.LogFormat("[Grid Matching #{0}] Current Grid: {1} Current Label: {2}", _moduleId, displayboard.getBoardState(), scroller.getState());
        Board_6x6.printBoard(displayboard.getBoardState());
    }
예제 #2
0
 private bool HandleVerifySolution()
 {
     Audio.PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.ButtonPress, ButtonVerifySolution.transform);
     ButtonVerifySolution.AddInteractionPunch(buttonbump);
     Debug.LogFormat("[Grid Matching #{0}] Solution Grid: {1}  Solution Label: {2}", _moduleId, displayboard.getSolutionState(), solutionName);
     Board_6x6.printBoard(displayboard.getSolutionState());
     Debug.LogFormat("[Grid Matching #{0}] Current Grid: {1} Current Label: {2}", _moduleId, displayboard.getBoardState(), scroller.getState());
     Board_6x6.printBoard(displayboard.getBoardState());
     if (displayboard.checkProposedSolution() && ScrollerText.text.Equals(solutionName))
     {
         Debug.LogFormat("[Grid Matching #{0}] Entered correct Solution and Label.", _moduleId);
         BombModule.HandlePass();
     }
     else
     {
         Debug.LogFormat("[Grid Matching #{0}] Entered incorrect Solution or Label.", _moduleId);
         BombModule.HandleStrike();
     }
     return(false);
 }