/// <summary> /// Guess what? This triggers the trigger :) /// </summary> public void TriggerTheTrigger(string triggerValue) { if (triggerOnGameEvent) { if (gameEvent.Equals(triggerValue) || dispatchAll) { onTriggerEvent.Invoke(triggerValue); if (gameEvents != null && gameEvents.Count > 0) { UIManager.SendGameEvents(gameEvents); } } } else if (triggerOnButtonClick) { if (buttonName.Equals(triggerValue) || dispatchAll) { onTriggerEvent.Invoke(triggerValue); if (gameEvents != null && gameEvents.Count > 0) { UIManager.SendGameEvents(gameEvents); } } } }
/// <summary> /// Triggers the UITrigger to execute its actions. /// </summary> public void TriggerTheTrigger(string triggerValue) { if (triggerOnGameEvent) { if (gameEvent.Equals(triggerValue) || dispatchAll) { onTriggerEvent.Invoke(triggerValue); if (gameEvents != null && gameEvents.Count > 0) { StartCoroutine(SendGameEventsInTheNextFrame()); } } } else if (triggerOnButtonClick || triggerOnButtonDoubleClick || triggerOnButtonLongClick) { if (buttonName.Equals(triggerValue) || dispatchAll) { onTriggerEvent.Invoke(triggerValue); if (gameEvents != null && gameEvents.Count > 0) { StartCoroutine(SendGameEventsInTheNextFrame()); } } } }
//------------------------------------------------------------------------------------------------ public void OnAction() { if (myNextState == State.ENTER && type == Type.ACTION) { myNextState = State.EXIT; onEvent.Invoke(this); } }
//------------------------------------------------------------------------------------------------ public void OnActionEnd() { if (myNextState == State.EXIT && type == Type.ACTION) { myNextState = (canRepeat ? State.ENTER : State.DONE); onEventEnd.Invoke(this); } }
private void OnTriggerStay(Collider other) { if (other.tag == "Player") { triggerEvent.Invoke(other.gameObject); } }
private void OnTriggerEnter2D(Collider2D other) { if (_onTriggerEnterEvent.IsAssigned()) { _onTriggerEnterEvent.Invoke(other); } }
void Invoke(GameObject other) { foreach (var trigger in triggers) { TriggerEvent?.Invoke(this, new TriggerEventArgs(trigger.Target, trigger.SpecifiedTargetItem, other.gameObject, trigger.Key, trigger.Type, trigger.Value)); } }
void Invoke() { if (Lottery.TryGetWeightRandom(choices, c => c.Weight, out var result)) { TriggerEvent?.Invoke(new TriggerEventArgs(result.Triggers)); } }
public void Invoke(bool isDown) { foreach (var trigger in isDown ? downTriggers : upTriggers) { TriggerEvent?.Invoke(this, new TriggerEventArgs(trigger.Target, trigger.SpecifiedTargetItem, null, trigger.Key, trigger.Type, trigger.Value)); } }
/// <summary> /// Updates alarm. Returns true, if alarm was triggered. /// </summary> public bool Update() { if (!Paused && Running) { Counter += TimeKeeper.Time(); if ( OnTriggerAction != OnTriggerAction.None && Counter >= TriggerTime ) { if (OnTriggerAction == OnTriggerAction.Stop) { Running = false; Counter = 0; } if (OnTriggerAction == OnTriggerAction.Loop) { Counter -= TriggerTime; // Necessary for correct timing. } TriggerEvent?.Invoke(this); return(true); } } return(false); }
/// <summary> /// Triggers the enter event /// </summary> /// <param name="gameObjectEntering">The object entering</param> public void TriggerEnterEvent(GameObject gameObjectEntering) { BaseEventData eventData = new BaseEventData(EventSystem.current); eventData.selectedObject = gameObjectEntering; enterEvent.Invoke(eventData); }
private void OnTriggerStay(Collider other) { if (other.tag == "Player") { stay.Invoke(); } }
public override bool Use() { if (Time.time - lastShootTime < shootTime) { return(false); } if (Time.time - lastReloadTime < reloadTime) { return(false); } if (!CheckBullets()) { if (EmptyMagasinEvent != null) { EmptyMagasinEvent.Invoke(this); } if (autoReload) { Reload(); } return(false); } if (TriggerEvent != null) { TriggerEvent.Invoke(this); } lastShootTime = Time.time; return(true); }
void Invoke() { foreach (var trigger in triggers) { TriggerEvent?.Invoke(this, new TriggerEventArgs(trigger.Target, trigger.SpecifiedTargetItem, null, trigger.Key, trigger.Type, trigger.Value)); } }
void OnTriggerExit(Collider _other) { bool isCollided = false; if (filterTags.Length <= 0) { isCollided = true; } foreach (string tag in filterTags) { if (_other.CompareTag(tag)) { isCollided = true; } } if (!isCollided) { return; } if (OnExit != null) { OnExit.Invoke(_other); } }
private void OnTriggerExit(Collider other) { if (other.tag == "Player") { Hide.Invoke(); } }
private void OnTriggerExit(Collider collider) { if (!m_ignoreColliders.Contains(collider)) { onTriggerExit.Invoke(collider); } }
private void OnTriggerStay(Collider col) { if (col.CompareTag(tagToDetect)) { onTriggerStayEvent.Invoke(m_col, GoalValue); } }
public void OnDrag(PointerEventData eventData) { if (m_Delegate != null) { m_Delegate.Invoke(eventData); } }
private void OnTriggerExit(Collider col) { if (col.CompareTag(tagToDetect)) { onTriggerExitEvent.Invoke(col); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Show.Invoke(); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { goalReached.Invoke(this); } }
void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { Hide.Invoke(); } }
private void OnTriggerExit(Collider other) { if (CanTrigger(other.gameObject)) { OnExit?.Invoke(other); } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { Show.Invoke(); } }
private void OnTriggerEnter(Collider other) { if ((1 << other.gameObject.layer) == mask) { onTriggerEnter?.Invoke(other); } }
private void OnTriggerExit(Collider other) { if (_onTriggerExitEvent.IsAssigned()) { _onTriggerExitEvent.Invoke(other); } }
public virtual void OnTrigger() { TriggerEvent?.Invoke(Durability); if (Durability <= 0 && IdleAnimation != null) { transform.root.GetComponentInChildren <Animator>().SetBool(IdleAnimation, false); } }
void OnTriggerExit(Collider other) { //Debug.Log("Trigger exit " + transform.parent.gameObject.name + ": " + other.gameObject.name); if ((layerMask.value & 1 << other.gameObject.layer) != 0) { onTriggerExit.Invoke(other); } }
private void OnTriggerStay(Collider other) { //Debug.Log("Trigger stay " + transform.parent.gameObject.name + ": " + other.gameObject.name); if ((layerMask.value & 1 << other.gameObject.layer) != 0) { onTriggerStay.Invoke(other); } }