public void StartSpellPicker() { isSelectingTarget = true; GameObject spellPickerObject = Instantiate(Resources.Load("SpellPickerCanvas")) as GameObject; SpellPicker spellPicker = spellPickerObject.GetComponent <SpellPicker> (); List <Spell> spellList = AllSpells.EligibleSpells(sheet); spellPicker.InitialiseSpellList(spellList, SpellSelected, SpellPickerCancelled, combatant.team); spellPicker.transform.position = SpellPickerPosition(spellList.Count, combatant.transform.position); }
// Update is called once per frame void Update() { if (pickingSpell) { return; } if (Input.GetButtonDown("Fire1_P1")) { GameObject spellPickerObject = Instantiate(spellPickerPrefab) as GameObject; SpellPicker spellPicker = spellPickerObject.GetComponent <SpellPicker> (); spellPicker.InitialiseSpellList(AllSpells.spells, spellSelectedCallback, null, Helpers.Teams.Home); spellPicker.transform.position = new Vector3(5.5f, 2f, 0f); pickingSpell = true; } }