// Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         player.Cast(player.StudiedSpells[0], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         player.Cast(player.StudiedSpells[1], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         player.Cast(player.StudiedSpells[2], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.Alpha4))
     {
         player.Cast(player.StudiedSpells[3], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.Alpha5))
     {
         player.Cast(player.StudiedSpells[4], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.Alpha6))
     {
         player.Cast(player.StudiedSpells[5], player.Target);
     }
     if (Input.GetKeyDown(KeyCode.E))
     {
         GameObject.Find("Image").SetActive(false);
     }
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     RPG.CharacterWieldingMagic Player = GameObject.Find("Player").GetComponent <RPG.CharacterWieldingMagic>();
     if (Player.StudiedSpells.Contains(spell))
     {
         Player.Cast(spell, Player.Target);
     }
     else
     {
         Player.Learn(spell);
         List <RPG.Spell> list = GameObject.Find("Player").GetComponent <RPG.CharacterWieldingMagic>().StudiedSpells;
         for (int i = 0; i < inventory.transform.childCount; i++)
         {
             if (inventory.transform.GetChild(i).childCount == 0)
             {
                 transform.SetParent(inventory.transform.GetChild(i));
                 break;
             }
         }
     }
 }