/// <summary> Set interactable state with given action index </summary> /// <param name="actionIndex"> Action Index </param> static public void SetPreviewAction(int actionIndex) { if (Instance == null) { return; } if (Instance.previewChild == null) { return; } Interactable interactable = Instance.previewChild.GetComponent <Interactable>(); if (interactable == null) { return; } if (interactable.stateData == null) { return; } InteractableState state = interactable.stateData.states[actionIndex]; state.enterState(interactable, false); SetLayerRecursively(Instance.previewChild, 0); }
public void NextAction() { currentStateID = Mod(currentStateID + 1, 4); InteractableState state = stateData.states[currentStateID]; state.enterState(this); interactableUI.SetActionUI(currentStateID); //interactableUI.SetText(state.actionName); }
public void DoAction(int actionIndex) { currentStateID = actionIndex; InteractableState state = stateData.states[actionIndex]; state.enterState(this); interactableUI.SetActionUI(actionIndex); //interactableUI.SetText(state.actionName); }