Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.61 KB | None | 0 0
  1. foreach (object obj in mainMenuMode.chooseModeUI.transform)
  2.                 {
  3.                     if (((Transform)obj).gameObject.name.Equals("StandardMode"))
  4.                     {
  5.                         Console.WriteLine(((Transform)obj).gameObject.tag);
  6.                         GameObject gameObject4 = UnityEngine.Object.Instantiate<GameObject>(((Transform)obj).gameObject, ((Transform)obj).parent);
  7.                         gameObject4.name = "MultiplayerMode";
  8.                         gameObject4.transform.SetParent(((Transform)obj).parent);
  9.                         gameObject4.transform.localPosition = new Vector3(150f, 138f, 0f);
  10.                         gameObject4.transform.localPosition += new Vector3(-64f, 0f, 0f);
  11.                         Localize[] components = gameObject4.GetComponentsInChildren<Localize>();
  12.                         for (int i = 0; i < components.Length; i++)
  13.                         {
  14.                             UnityEngine.Object.Destroy(components[i]);
  15.                         }
  16.                         TextMeshProUGUI[] componentsInChildren = gameObject4.GetComponentsInChildren<TextMeshProUGUI>();
  17.                         componentsInChildren[0].text = "Multiplayer Mode";
  18.                         componentsInChildren[1].text = "Choose from three difficulty modes and join forces with other players to build or battle.";
  19.                         componentsInChildren[2].text = "Accept";
  20.                         Component[] components2 = gameObject4.GetComponentsInChildren<Component>();
  21.                         for (int j = 0; j < components2.Length; j++)
  22.                         {
  23.                             Console.WriteLine(components2[j].GetType().FullName);
  24.                         }
  25.                         gameObject4.GetComponentInChildren<Button>().onClick.AddListener(delegate ()
  26.                         {
  27.                             //mainMenuMode.TransitionTo(MainMenuMode.State.Menu);
  28.                             SfxSystem.PlayUiCancel();
  29.                             Console.WriteLine("Multiplayer Clicked");
  30.                         });
  31.                         ((Transform)obj).localPosition += new Vector3(-140f, 0f, 0f);
  32.                     }
  33.                     if (((Transform)obj).gameObject.name.Contains("Mode"))
  34.                     {
  35.                         ((Transform)obj).localScale = new Vector3(0.8f, 0.8f, 0.8f);
  36.                     }
  37.                     if (((Transform)obj).gameObject.name.Equals("CreativeMode"))
  38.                     {
  39.                         ((Transform)obj).localPosition += new Vector3(70f, 0f, 0f);
  40.                     }
  41.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement