public void convertToMage() { SetNPCScript script = GameObject.Find("NPCS").gameObject.GetComponent<SetNPCScript>(); var npc = new Mage (); npc.name = "Mage"; npc.hp += target.hp; npc.maxHp += target.maxHp; npc.mp += target.mp; npc.maxMp += target.maxMp; npc.position = target.position; npc.sprite = script.spriteList [1]; npc.setSprite (); //SetNPCScript //target.ChangeNPCSprite (npcScript.SpriteList[1]); //Game.removeNPC (target); //target.killNPC (); messiah.party.addNPC (npc); messiah.party.p.removeWarriorResource (); Game.addNPC (npc); target.killNPC (); Board.tiles [npc.position].npc = npc; }