Пример #1
0
 void OnTriggerExit2D(Collider2D collision)  //When item is dragged out of this slot.
 {
     if (this.itemInSlot == collision.gameObject)
     {
         BackpackVariables.SetItemInSlot(this.slotName, BackpackVariables.Item.Empty);
         this.itemInSlot = null;
     }
 }
Пример #2
0
 public static void ResetGlobals()
 {
     startGameTime = DateTime.MinValue;
     level         = 1;
     resetOpenDoors();
     ctrlRoomDoorOpen = false;
     setControlroomDoor(false);
     BackpackVariables.SetItemInSlot("L1P3KeySlot", BackpackVariables.Item.Key);
 }
Пример #3
0
 void UnlockDoor()
 {
     if (keySlot.GetComponent <DropZone>().itemInSlot != null)
     {
         flowchart.ExecuteBlock("UnlcokCtrlRoom");
         gameObject.SetActive(false);
         BackpackVariables.SetItemInSlot("keyHole", BackpackVariables.Item.Empty);
         Globals.ctrlRoomDoorOpen = true;
     }
     else
     {
         check = true;
     }
 }
Пример #4
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (this.itemInSlot == null &&
         IsDraggableObject(collision.gameObject) &&
         this.type != Type.take &&
         (this.acceptingItem == BackpackVariables.Item.Any || this.acceptingItem == collision.gameObject.GetComponent <Dragable>().itemType))
     {
         this.itemInSlot = collision.gameObject;
         this.itemInSlot.SendMessage("SetSnapPos", gameObject.transform.position);
         collision.gameObject.transform.SetParent(this.gameObject.transform);
         this.itemInSlot.GetComponent <Dragable>().inSlot = this;
         BackpackVariables.SetItemInSlot(this.slotName, itemInSlot.GetComponent <Dragable>().itemType);
     }
 }