public void initialize(List<string> list_of_characters) { foreach (string character in list_of_characters) { Destroy ( GameObject.Find("Small " + character + " Character(Clone)")); switch (character) { case "Empty": break; case "Red": Combat_Character Red = new Combat_Character (); Red.Name = "Red"; Red.Speed = 200; Red.Ready = false; Characters.Add (Red); break; case "Orange": Combat_Character Orange = new Combat_Character (); Orange.Name = "Orange"; Orange.Speed = 200; Orange.Ready = false; Characters.Add (Orange); break; case "Yellow": Combat_Character Yellow = new Combat_Character (); Yellow.Name = "Yellow"; Yellow.Speed = 200; Yellow.Ready = false; Characters.Add (Yellow); break; case "Green": Combat_Character Green = new Combat_Character (); Green.Name = "Green"; Green.Speed = 200; Green.Ready = false; Characters.Add (Green); break; case "Blue": Combat_Character Blue = new Combat_Character (); Blue.Name = "Blue"; Blue.Speed = 200; Blue.Ready = false; Characters.Add (Blue); break; case "Pink": Combat_Character Pink = new Combat_Character (); Pink.Name = "Pink"; Pink.Speed = 200; Pink.Ready = false; Characters.Add (Pink); break; } } Debug.Log ("poopy"); //disable the other script GameObject.Find ("Home").GetComponent<CharacterSelect> ().enabled = false; Destroy(GameObject.Find ("Character Select(Clone)")); int character_number = 1; Vector3 location = new Vector3(0f, 0f, 0f); foreach (Combat_Character C in Characters) { if(character_number ==1) { location = new Vector3(-5,3,0); } else if(character_number == 2) { location = new Vector3 (-5, 0, 0); } else{ location = new Vector3 (-5, -3, 0); } switch(C.Name) { case "Red": Instantiate(red, location, Quaternion.identity); Instantiate (small_red, location, Quaternion.identity); break; case "Orange": Instantiate(orange, location, Quaternion.identity); Instantiate(small_orange, location, Quaternion.identity); break; case "Yellow": Instantiate(yellow, location, Quaternion.identity); Instantiate(small_yellow, location, Quaternion.identity); break; case "Green": Instantiate(green, location, Quaternion.identity); Instantiate(small_green, location, Quaternion.identity); break; case "Blue": Instantiate(blue, location, Quaternion.identity); Instantiate(small_blue, location, Quaternion.identity); break; case "Pink": Instantiate(pink, location, Quaternion.identity); Instantiate(small_pink, location, Quaternion.identity); break; } character_number++; } state = 1; }
public void initialize(List <string> list_of_characters) { foreach (string character in list_of_characters) { Destroy(GameObject.Find("Small " + character + " Character(Clone)")); switch (character) { case "Empty": break; case "Red": Combat_Character Red = new Combat_Character(); Red.Name = "Red"; Red.Speed = 200; Red.Ready = false; Characters.Add(Red); break; case "Orange": Combat_Character Orange = new Combat_Character(); Orange.Name = "Orange"; Orange.Speed = 200; Orange.Ready = false; Characters.Add(Orange); break; case "Yellow": Combat_Character Yellow = new Combat_Character(); Yellow.Name = "Yellow"; Yellow.Speed = 200; Yellow.Ready = false; Characters.Add(Yellow); break; case "Green": Combat_Character Green = new Combat_Character(); Green.Name = "Green"; Green.Speed = 200; Green.Ready = false; Characters.Add(Green); break; case "Blue": Combat_Character Blue = new Combat_Character(); Blue.Name = "Blue"; Blue.Speed = 200; Blue.Ready = false; Characters.Add(Blue); break; case "Pink": Combat_Character Pink = new Combat_Character(); Pink.Name = "Pink"; Pink.Speed = 200; Pink.Ready = false; Characters.Add(Pink); break; } } Debug.Log("poopy"); //disable the other script GameObject.Find("Home").GetComponent <CharacterSelect> ().enabled = false; Destroy(GameObject.Find("Character Select(Clone)")); int character_number = 1; Vector3 location = new Vector3(0f, 0f, 0f); foreach (Combat_Character C in Characters) { if (character_number == 1) { location = new Vector3(-5, 3, 0); } else if (character_number == 2) { location = new Vector3(-5, 0, 0); } else { location = new Vector3(-5, -3, 0); } switch (C.Name) { case "Red": Instantiate(red, location, Quaternion.identity); Instantiate(small_red, location, Quaternion.identity); break; case "Orange": Instantiate(orange, location, Quaternion.identity); Instantiate(small_orange, location, Quaternion.identity); break; case "Yellow": Instantiate(yellow, location, Quaternion.identity); Instantiate(small_yellow, location, Quaternion.identity); break; case "Green": Instantiate(green, location, Quaternion.identity); Instantiate(small_green, location, Quaternion.identity); break; case "Blue": Instantiate(blue, location, Quaternion.identity); Instantiate(small_blue, location, Quaternion.identity); break; case "Pink": Instantiate(pink, location, Quaternion.identity); Instantiate(small_pink, location, Quaternion.identity); break; } character_number++; } state = 1; }