Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        public void NextAction()
        {
            currentStateID = Mod(currentStateID + 1, 4);
            InteractableState state = stateData.states[currentStateID];

            state.enterState(this);

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

            state.enterState(this);

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