public void PopulateObjectsInRoom(DynArray <RoomObject> objectsToPopulateWith) { if (objectsInRoom == null) { objectsInRoom = new DynArray <RoomObject>(); } for (int i = 0; i < objectsToPopulateWith.GetSize(); i++) { objectsInRoom.AddToArray(objectsToPopulateWith[i]); } WriteButtons(); }
// Use this for initialization void Start() { InitializeGameVars(); //STICKYNOTE: This is for testing out the room functionality, delete this and make a better version after DynArray <RoomObject> objectsToExport = new DynArray <RoomObject>(); GameObject goobyObject = (GameObject)Instantiate(Resources.Load("Prefabs/Gooby")); Enemy goobyEnemy = goobyObject.GetComponent <Enemy>(); objectsToExport.AddToArray(goobyEnemy); GlobalVar.currentRoom.PopulateObjectsInRoom(objectsToExport); }
public void GetItem(Item ItemToGet) { itemsInInventory.AddToArray(ItemToGet); }