Example #1
0
    //Filters spawn requests
    public OverwatchHero CreateHero(string type)
    {
        heroToSpawn = null;

        if (type.Equals("Reinhardt"))
        {
            heroToSpawn = rein;
        }
        else if (type.Equals("Zarya"))
        {
            heroToSpawn = zar;
        }
        else if (type.Equals("Echo"))
        {
            heroToSpawn = echo;
        }
        else if (type.Equals("Widowmaker"))
        {
            heroToSpawn = wid;
        }
        else if (type.Equals("Ana"))
        {
            heroToSpawn = ana;
        }
        else if (type.Equals("Moira"))
        {
            heroToSpawn = moi;
        }

        return(heroToSpawn);
    }
Example #2
0
    //For player choice, requests spawn and sets up spawning prefab
    public void SpawnHero(string type)
    {
        hero = factory.CreateHero(type);
        Vector3 spawnPos = new Vector3(0, 0, 0);

        h = Instantiate(hero, spawnPos, Quaternion.identity);
        gm.choice.text = hero.ToString();
    }
Example #3
0
 //For game target, requests spawn
 public void ChooseHero(string type)
 {
     target = factory.CreateHero(type);
 }