void OnEnable() { if (m_triggerType.Equals(TriggerType.onPickup)) { GetComponent <Item>().pickupEvent += TriggerEvent; } }
private void OnTriggerEnter2D(Collider2D collider) { if (triggerType.Equals(TriggerType.once) && !triggered) { if (collider.gameObject.Equals(concern)) { GameObject.FindGameObjectWithTag("Prompt").GetComponent <Prompt>().Show("Press <sprite=8> to Open"); } } }
private void OnTriggerEnter2D(Collider2D col) { if (m_triggerType.Equals(TriggerType.onArea)) { TriggerEvent(); } }
public void Activate(TriggerType triggerType) { if (triggerType.Equals(TriggerType.DOOR_EVENT)) { Door door = GetComponent <Door>(); door.PlayOpenSound(); Animator animator = GetComponent <Animator>(); animator.SetBool("isOpened", true); } }
/// <summary> /// Returns true if Trigger instances are equal /// </summary> /// <param name="other">Instance of Trigger to be compared</param> /// <returns>Boolean</returns> public bool Equals(Trigger other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Body == other.Body || Body != null && Body.Equals(other.Body) ) && ( TriggerOperation == other.TriggerOperation || TriggerOperation != null && TriggerOperation.Equals(other.TriggerOperation) ) && ( TriggerType == other.TriggerType || TriggerType != null && TriggerType.Equals(other.TriggerType) ) && ( Rid == other.Rid || Rid != null && Rid.Equals(other.Rid) ) && ( Ts == other.Ts || Ts != null && Ts.Equals(other.Ts) ) && ( Self == other.Self || Self != null && Self.Equals(other.Self) ) && ( Etag == other.Etag || Etag != null && Etag.Equals(other.Etag) )); }