/// <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);
        }
Esempio n. 2
0
        /// <summary> Sets Label Text to Current Action and Activates Checkmark if necessary </summary>
        public void SetActionUI(int actionIndex)
        {
            InteractableState state = parent.stateData.states[actionIndex];

            //SetText(parent.Name + ":\n "+ state.actionName);
            SetText(state.actionName);
            SetCheckmark(actionIndex);
        }
Esempio n. 3
0
        public void NextAction()
        {
            currentStateID = Mod(currentStateID + 1, 4);
            InteractableState state = stateData.states[currentStateID];

            state.enterState(this);

            interactableUI.SetActionUI(currentStateID);
            //interactableUI.SetText(state.actionName);
        }
Esempio n. 4
0
        public void DoAction(int actionIndex)
        {
            currentStateID = actionIndex;
            InteractableState state = stateData.states[actionIndex];

            state.enterState(this);

            interactableUI.SetActionUI(actionIndex);
            //interactableUI.SetText(state.actionName);
        }