コード例 #1
0
 void checkForChangedObjects()
 {
     //needed when changing scene to have the new dialogue manager etc
     if (inventory == null)
     {
         inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <OldInventory>();
     }
 }
コード例 #2
0
    protected override void doStart()
    {
        if (inventory == null)
        {
            inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <OldInventory>();
        }

        //check if object already picked up
        if (inventory.hasBeenPickedUp(gameObject.name))
        {
            Destroy(gameObject);
        }
    }