Beispiel #1
0
 void Update()
 {
     if (BackpackVariables.BackpackContainsKey(BackpackVariables.Item.Key) && check)
     {
         Invoke("ChangeScene", 2);
         check = false;
     }
 }
Beispiel #2
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;
     }
 }
Beispiel #3
0
 public static void ResetGlobals()
 {
     startGameTime = DateTime.MinValue;
     level         = 1;
     resetOpenDoors();
     ctrlRoomDoorOpen = false;
     setControlroomDoor(false);
     BackpackVariables.SetItemInSlot("L1P3KeySlot", BackpackVariables.Item.Key);
 }
Beispiel #4
0
 void ChangeScene()
 {
     if (BackpackVariables.BackpackContainsKey(BackpackVariables.Item.Key))
     {
         //SceneManager.LoadScene("InsidePlane", LoadSceneMode.Additive);
         flowchart.ExecuteBlock("Back_to_ship");
     }
     else
     {
         check = true;
     }
 }
Beispiel #5
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;
     }
 }
Beispiel #6
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);
     }
 }
Beispiel #7
0
    void Start() //Load correct item in this slot
    {
        BackpackVariables.Item slotContains = BackpackVariables.GetItemInSlot(this.slotName);
        //Debug.Log(slotName + ": " + slotContains);
        if (slotContains != BackpackVariables.Item.Empty)
        {
            switch (slotContains)
            {
            case BackpackVariables.Item.CoffeeCup:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().CoffeeCup);
                break;

            case BackpackVariables.Item.Face:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().Face);
                break;

            case BackpackVariables.Item.Mushroom:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().Mushroom);
                break;

            case BackpackVariables.Item.Stone:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().Stone);
                break;

            case BackpackVariables.Item.Star:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().Star);
                break;

            case BackpackVariables.Item.Key:
                loadItem(GameObject.Find("Main Camera/Backpack_NC").GetComponent <LoadBackpack>().Key);
                break;

            default:
                //Debug.Log("Could not find item");
                break;
            }
        }
    }