Example #1
0
 void Update()
 {
     if (dialogBoxController.hasFinishedDisplayingText)
     {
         if (currentDialogBoxState.GetQuantityOfOptions() > 1)
         {
             if (dialogOptionSelectorController.IsOptionConfirmed())
             {
                 currentDialogBoxState = dialogOptionSelectorController.GetSelectedState();
                 dialogBoxController.DisplayState(currentDialogBoxState);
                 dialogOptionSelectorController.ClearDialogOptionSelectorBox();
             }
             else if (!dialogOptionSelectorController.IsOpen())
             {
                 dialogOptionSelectorController.DisplayOptionsFromState(currentDialogBoxState);
             }
         }
         else
         {
             if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
             {
                 currentDialogBoxState = currentDialogBoxState.GetNextState(0);
                 dialogBoxController.DisplayState(currentDialogBoxState);
             }
         }
     }
 }
Example #2
0
 private void MoveSelectionCursorDown()
 {
     if (selectedOptionIndex < currentDialogBoxState.GetQuantityOfOptions() - 1)
     {
         var optionCursorRectTransform = OptionCursor.GetComponent <RectTransform>();
         var newPosition = OptionCursor.GetComponent <RectTransform>().position;
         newPosition.y += -30;
         optionCursorRectTransform.SetPositionAndRotation(newPosition, optionCursorRectTransform.rotation);
         selectedOptionIndex++;
     }
 }