void givePlayerASpellbook() { GameObject book = new GameObject(); book.name = "Book"; book.AddComponent <PracticeRoomSpellbookItem>(); PracticeRoomSpellbookItem item = book.GetComponent <PracticeRoomSpellbookItem>(); item.item_name = "Spells"; Inventory inventory = GameObject.Find("Inventory").GetComponent <Inventory>(); inventory.addItem(book); PracticeRoomSpellbook spellbook = GameObject.Find("PracticeRoomSpellbook").GetComponent <PracticeRoomSpellbook>(); spellbook.Add(new FilePage("MySpell", "MySpell/texture", "MySpell/code")); spellbook.Add(new FilePage("Flame", "Flame/texture", "Flame/code")); spellbook.Add(new FilePage("Sentry", "Sentry/texture", "Sentry/code")); spellbook.Add(new FilePage("AdeptLevitate", "AdeptLevitate/texture", "AdeptLevitate/code")); spellbook.Add(new FilePage("Teleport", "Teleport/texture", "Teleport/code")); spellbook.Add(new FilePage("Flight", "Flight/texture", "Flight/code")); spellbook.Add(new FilePage("Summon", "Summon/texture", "Summon/code")); spellbook.Add(new FilePage("MassiveFire", "MassiveFire/texture", "MassiveFire/code")); spellbook.Add(new FilePage("Architecture", "Architecture/texture", "Architecture/code")); spellbook.Add(new FilePage("Architecture2", "Architecture2/texture", "Architecture2/code")); spellbook.Add(new FilePage("CrossRiver", "CrossRiver/texture", "CrossRiver/code")); spellbook.Add(new FilePage("JumpWall", "JumpWall/texture", "JumpWall/code")); }
public override void DroppedOnInventory(Vector3 mousePosition) { SetHidden(false); PracticeRoomSpellbook spellbook = (GameObject.Find("PracticeRoomSpellbook").GetComponent <PracticeRoomSpellbook>()); spellbook.show(GameObject.Find("Inventory")); }