Ejemplo n.º 1
0
 void OnEnable()
 {
     if (m_triggerType.Equals(TriggerType.onPickup))
     {
         GetComponent <Item>().pickupEvent += TriggerEvent;
     }
 }
Ejemplo n.º 2
0
 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");
         }
     }
 }
Ejemplo n.º 3
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (m_triggerType.Equals(TriggerType.onArea))
     {
         TriggerEvent();
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        /// <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)
                 ));
        }