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(); } } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } if (Target == null) { Debug.LogWarning(string.Format("ToggleComponentSpecial on {0} has null target!", gameObject.name)); return; } if (AlwaysForceDisable) { Target.enabled = false; } else if (AlwaysForceEnable) { Target.enabled = true; } else { Target.enabled = !Target.enabled; } if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } if (AlwaysForceDisable) { Target.SetActive(false); } else if (AlwaysForceEnable) { Target.SetActive(true); } else { Target.SetActive(Target.activeSelf); } if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } object[] args = ScriptArguments; if (AutoconvertArguments) { for (int i = 0; i < args.Length; i++) { args[i] = TypeUtils.StringToNumericAuto((string)args[i]); } } ScriptingModule.Call(Script, new ScriptExecutionContext { Caller = this, Activator = data.Activator.gameObject }, args); if (!Repeatable) { Locked = true; } }
void OnTriggerEnter(Collider other) { if (Triggered) { return; } //reject not-player if we're not allowing not-player if (OnPlayerOnly && other.gameObject == WorldUtils.GetPlayerObject()) { return; } //execute special var activator = other.GetComponent <BaseController>(); var data = new ActionInvokerData() { Activator = activator }; Special.Invoke(data); //lock if not repeatable if (!Repeatable) { Triggered = true; SaveState(); } }
public override void Execute(ActionInvokerData data) { if (!AllowInvokeWhenDisabled && !isActiveAndEnabled) { return; } ChangeScene(); }
private IEnumerator WaitAndExecute(ActionInvokerData data) { yield return(new WaitForSeconds(Delay)); Special.Invoke(data); if (Repeatable) { Locked = false; } }
void Start() { RestoreState(); if (!Triggered) { ActionInvokerData d = new ActionInvokerData(); Special.Invoke(d); Triggered = true; SaveState(); } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } StartCoroutine(WaitAndExecute(data)); if (!Concurrent || !Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } StartCoroutine(WaitAndExecute(data)); if (!Concurrent || !Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } SpawnObjectEx(); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } sound.Play(); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } QdmsMessageBus.Instance.PushBroadcast(new HUDPushMessage(UseSubstitution ? Sub.Macro(Message) : Message)); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } SpawnObjectEx(); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } ToggleDoor(); SaveState(); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } MonoBehaviour targetScript = FindScript(); targetScript.Invoke(MethodName, 0); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } MonoBehaviour targetScript = FindScript(); targetScript.Invoke(MethodName, 0); if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } foreach (ActionSpecialEvent sp in Specials) { sp.Invoke(data); } if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } foreach (ActionSpecialEvent sp in Specials) { sp.Invoke(data); } if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked || (!AllowInvokeWhenDisabled && !isActiveAndEnabled)) { return; } if (Event != null) { Event.Invoke(); } if (ActionEvent != null) { ActionEvent.Invoke(data); } if (!Repeatable) { Locked = true; } }
public override void Execute(ActionInvokerData data) { if (Locked) { return; } if (Target == null) { Debug.LogWarning(string.Format("DestroyObjectSpecial on {0} has no target!", gameObject.name)); } else { Destroy(Target); } if (!Repeatable) { Locked = true; } }
public abstract void Execute(ActionInvokerData data);
public override void Execute(ActionInvokerData data) { ChangeScene(); }