public override void Execute(ActionInvokerData data) { if (Locked) { return; } if (AlwaysForceDisable) { Target.SetActive(false); } else if (AlwaysForceEnable) { Target.SetActive(true); } else { Target.SetActive(Target.activeSelf); } if (!Repeatable) { Locked = true; } }
private IEnumerator WaitAndExecute(ActionInvokerData data) { yield return(new WaitForSeconds(Delay)); Special.Invoke(data); if (Repeatable) { Locked = false; } }
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) { return; } sound.Play(); 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) { return; } GameState.Instance.Player.AddItem(Item, ItemCount); QdmsMessageBus.Instance.PushBroadcast(new InventoryAddedMessage(Item, ItemCount)); 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; } }
void Update() { if (Locked) { return; } if (Input.GetButtonDown(InputCode)) { ActionInvokerData d = new ActionInvokerData { Activator = GameObject.Find("Player") }; //TODO utility functions Special.Invoke(d); 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; } }
private void HandleCollision(GameObject other) { //Debug.Log(other); if (Locked) { return; } //reject not-player if we're not allowing not-player if (OnPlayerOnly && other.GetComponent <PlayerControl>() == null) { return; } //reject non-actors if we're not allowing not-actor if (OnActorsOnly && (other.GetComponent <PlayerControl>() == null || other.GetComponent <EnemyScript>() == null)) { return; } //execute special var activator = other.gameObject; var data = new ActionInvokerData() { Activator = activator }; Special.Invoke(data); //lock if not repeatable if (!Repeatable) { Locked = true; } }
void Start() { ActionInvokerData d = new ActionInvokerData(); Special.Invoke(d); }
public override void Execute(ActionInvokerData data) { ChangeScene(); }
public abstract void Execute(ActionInvokerData data);