void Start() { SM = GameObject.FindGameObjectWithTag("Spell_Manager").GetComponent <Spell_Manager>(); AM = GameObject.FindGameObjectWithTag("Ability_Manager").GetComponent <Ability_Manager>(); Player = GameObject.FindGameObjectWithTag("Player"); UIM = GameObject.FindGameObjectWithTag("UI_Manager").GetComponent <UI_Manager>(); ItemIndex = SM.ReturnSpellIndex(Spell, Slot); InvokeRepeating("DestoryItem", 0, 5f); }
//----------------------------------------------------------------------------------------------------------------------------------------------- /// <summary> /// This function controls the loading of gear on game start up, it looks for the gears index in the spell manager and then gets the game object /// it returns the game object to the Equip function /// // the epquid function will then bind the item to the slot and update the UI as needed with Icon's and Names; /// </summary> void LoadSpellState() { SM = GameObject.FindGameObjectWithTag("Spell_Manager").GetComponent <Spell_Manager>(); UIM = GameObject.FindGameObjectWithTag("UI_Manager").GetComponent <UI_Manager>(); float indexhead = PlayerPrefs.GetFloat("Head", 0); float indexMain = PlayerPrefs.GetFloat("Main", 0); float indexFeet = PlayerPrefs.GetFloat("Feet", 0); float indexOff = PlayerPrefs.GetFloat("Off", 0); EquipMain(SM.LookupMain(indexMain)); EquipHead(SM.LookupHead(indexhead)); EquipFeet(SM.LookupFeet(indexFeet)); EquipOff(SM.LookupOff(indexOff)); }