示例#1
0
        void Update()
        {
            if (Triggered)
            {
                return;
            }

            bool inputPressed = false;

            if (UseKeyInput)
            {
                inputPressed = UnityEngine.Input.GetKeyDown(InputCode);
            }
            else
            {
                inputPressed = MappedInput.GetButtonDown(InputCode);
            }

            if (inputPressed)
            {
                ActionInvokerData d = new ActionInvokerData {
                    Activator = WorldUtils.GetPlayerController()
                };                                                                                             //TODO utility functions
                Special.Invoke(d);

                if (!Repeatable)
                {
                    Triggered = true;
                    SaveState();
                }
            }
        }