// 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."); }
// In learn mode, perform the next queued action public static string doNextAction(string input) { if (InteractablePath.NextInteractable != null && GameManager.Mode == GameMode.Rehearsal) { InteractablePath.GoToNextInteractable(); } return("Performing next queued action"); }
void clickActionButton(int actionIndex) { if (GameManager.Mode == GameMode.Rehearsal) { if (actionIndex == InteractablePath.NextInteractable.ActionIndex && interactable.ID == InteractablePath.NextInteractable.ID) { InteractableLog.Add(interactable, actionIndex); InteractablePath.GoToNextInteractable(); } } else if (GameManager.Mode == GameMode.Recall || GameManager.Mode == GameMode.Sandbox) { InteractableLog.Add(interactable, actionIndex); } InteractableActionsUI.Toggle(false); }
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); } }