Example #1
0
    // Skip the current scene. Only works in Learn/reheasal mode.
    public static string skipScene(string input)
    {
        if (GameManager.Mode == GameMode.Rehearsal)
        {
            int actionsThisScene = InteractableLog.Count % InteractableConfig.ActionsPerSite;
            for (int i = 0 + actionsThisScene; i < InteractableConfig.ActionsPerSite; i++)
            {
                Debug.Log("Auto-performing action " + (i + 1));
                InteractableManager.SetActiveInteractable(InteractablePath.NextInteractable, InteractablePath.NextAction);
                InteractableLog.Add(InteractablePath.NextInteractable, InteractablePath.NextAction);
                InteractablePath.GoToNextInteractable();
            }
            return("Skiping scene");
        }
        else if (GameManager.Mode == GameMode.Recall)
        {
            int actionsThisScene = InteractableLog.Count % InteractableConfig.ActionsPerSite;
            for (int i = 0 + actionsThisScene; i < InteractableConfig.ActionsPerSite; i++)
            {
                Debug.Log("Auto-performing action " + (i + 1));
                InteractableLog.Add(InteractableManager.InteractableList[0], 0);
            }

            return("Skiping scene");
        }

        return("Skip scene only supports Learn and Recal modes.");
    }
Example #2
0
 // In learn mode, perform the next queued action
 public static string doNextAction(string input)
 {
     if (InteractablePath.NextInteractable != null && GameManager.Mode == GameMode.Rehearsal)
     {
         InteractableManager.SetActiveInteractable(InteractablePath.NextInteractable, InteractablePath.NextAction);
         InteractableLog.Add(InteractablePath.NextInteractable, InteractablePath.NextAction);
         InteractablePath.GoToNextInteractable();
     }
     return("Performing next queued action");
 }
Example #3
0
 public void CheckForButtonDown()
 {
     if (buttonPressed && !progressCompleted)
     {
         time += Time.deltaTime;
         if (time >= 0.2f)
         {
             float         progressPosition  = 360 * (-1 + (time - 0.2f / 1.0f));
             RectTransform progressTransform = progress.GetComponent <RectTransform>();
             progressTransform.offsetMax = new Vector2(progressPosition, progressTransform.offsetMax.y);
             if (time >= 1.2f)
             {
                 if (GameManager.Mode == GameMode.Rehearsal)
                 {
                     if (interactable.ID == InteractablePath.NextInteractable.ID && actionIndex == InteractablePath.NextAction)
                     {
                         InteractableManager.SetActiveInteractable(interactable, actionIndex);
                         interactable.SelectAction(actionIndex);
                         InteractablePath.GoToNextInteractable();
                     }
                 }
                 else
                 {
                     interactable.SelectAction(actionIndex);
                 }
                 progressCompleted           = true;
                 progressTransform.offsetMax = new Vector2(-360, progressTransform.offsetMax.y);
                 time = 0.0f;
             }
         }
     }
     else
     {
         RectTransform progressTransform = progress.GetComponent <RectTransform>();
         progressTransform.offsetMax = new Vector2(-360, progressTransform.offsetMax.y);
         time = 0.0f;
         EventSystem.current.SetSelectedGameObject(null);
     }
 }
 public void ActivateInteractable()
 {
     InteractableManager.SetActiveInteractable(interactable, interactable.ActionIndex);
     InteractableActionsUI.Toggle(true);
     ToggleIcon(false);
 }