Esempio n. 1
0
 protected void DestroyTrap(object_base src)
 {
     if (src != null)
     {
         if (src.GetComponent <ObjectInteraction>() != null)
         {
             //Clear the link to the trigger/trap from the source if it is destroyed.
             if (src.GetComponent <ObjectInteraction>().link == this.gameObject.GetComponent <ObjectInteraction>().objectloaderinfo.index)
             {
                 src.GetComponent <ObjectInteraction>().link = 0;
             }
         }
     }
     objInt().objectloaderinfo.InUseFlag = 0;
     Debug.Log("Destroying Trap: " + this.name);
     Destroy(this.gameObject);
 }
Esempio n. 2
0
 protected void DestroyTrap(object_base src)
 {
     if (src != null)
     {
         if (src.GetComponent <ObjectInteraction> () != null)
         {
             //Clear the link to the trigger/trap from the source if it is destroyed.
             if (src.GetComponent <ObjectInteraction> ().link == this.gameObject.GetComponent <ObjectInteraction> ().objectloaderinfo.index)
             {
                 src.GetComponent <ObjectInteraction> ().link = 0;
             }
         }
     }
     objInt().objectloaderinfo.InUseFlag = 0;
     //ObjectInteraction.UpdateLinkedList (objInt (), objInt ().tileX, objInt ().tileY, TileMap.ObjectStorageTile, TileMap.ObjectStorageTile);
     Destroy(this.gameObject);
 }
    public virtual void PostActivate(object_base src)
    {
        //Destruction of traps is probably controlled by the trigger.
        int TriggerRepeat = (objInt().flags >> 1) & 0x1;

        if (TriggerRepeat == 0)
        {
            this.GetComponent <ObjectInteraction>().objectloaderinfo.InUseFlag = 0;
            if (src != null)
            {
                if (src.GetComponent <ObjectInteraction>() != null)
                {                //Clear the link to the trigger/trap from the source if it is destroyed.
                    if (src.GetComponent <ObjectInteraction>().link == this.gameObject.GetComponent <ObjectInteraction>().objectloaderinfo.index)
                    {
                        src.GetComponent <ObjectInteraction>().link = 0;
                    }
                }
            }
            Destroy(this.gameObject);
        }
    }