void Start() { cameraTether = GameObject.Find("CameraMount").GetComponent<Tethered>(); if (!this.gameObject.GetComponent<Character>().Team2) { this.gameObject.AddOnClick(() => { if (!gameObject.GetComponent<Character>().IsAlive) return; cameraTether.Paused = true; radialMenu = new GameObject(); radialMenu.name = "Radial Menu"; radialMenu.AddOnOutsideClick(() => { foreach (GameObject child in radialMenu.GetChildren()) { child.EnsureComponent<Rigidbody>(); radialOptions.Remove(child); } TimedTaskManager.Instance.Add(3000, () => { Close(); }); }); for (float i = 0; i < Abilities.Length; i++) { GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); sphere.transform.parent = radialMenu.transform; radialOptions.Add(sphere); float angle = 360 * (i / (float)Abilities.Length) * Mathf.Deg2Rad; float sphereX = radius * Mathf.Cos(angle); float sphereZ = radius * Mathf.Sin(angle); sphere.transform.localPosition = new Vector3(sphereX, 0, sphereZ); AbilitySphere abilitySphere = sphere.AddComponent<AbilitySphere>(); abilitySphere.Ability = Abilities[(int)i]; abilitySphere.OriginatingGameObject = this.gameObject; } }); } }