public void UpdateActionbar() { if (!s1script) { s1script = spell1.GetComponent <ActionButtonScript>(); s2script = spell2.GetComponent <ActionButtonScript>(); s3script = spell3.GetComponent <ActionButtonScript>(); s4script = spell4.GetComponent <ActionButtonScript>(); s5script = spell5.GetComponent <ActionButtonScript>(); sLscript = spellL.GetComponent <ActionButtonScript>(); sRscript = spellR.GetComponent <ActionButtonScript>(); } s1script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot1)); s2script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot2)); s3script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot3)); s4script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot4)); s5script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot5)); sLscript.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.LMB)); sRscript.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.RMB)); }