//create Hero on stage private void GetHero(int type) { switch(type){ case 1: { _player = (GameObject) GameObject.Instantiate(archer); _temp = _player.GetComponent<ArcherSkills>(); _temp.setSkills(PlayerPrefs.GetInt("Hero1Skill1"), PlayerPrefs.GetInt("Hero1Skill2"), PlayerPrefs.GetInt("Hero1Skill3"), PlayerPrefs.GetInt("Hero1Skill4")); break; } case 2: { _player = (GameObject) GameObject.Instantiate(wizard); break; } } }