// Use this for initialization public override void Start() { base.Start(); builder = GameObject.FindGameObjectWithTag(Tags.Master).GetComponent <GameBuilder>(); manageRandomButton(); if (builder.Action == GameBuilder.BuildMode.Client) { fetchMessage = Instantiate(Resources.Load("Prefabs/Menu/MenuLabel")) as GameObject; fetchMessage.transform.position = new Vector3(0, -2, 0); FetchGameModeButtons(); DisableAllGameModeButtons(); hostFetcher = builder.GetFetcher(); hostFetcher.EventGameFound += OnEventGameFound; hostFetcher.EventNoMaster += hostFetcher_EventNoMaster; FetchHosts(); } }
private void ManageClientArenaButtons() { HostFetcher hostFetcher = GameObject.FindGameObjectWithTag(Tags.Master).GetComponent <HostFetcher>(); bool oneIsActive = false; foreach (GameObject arenaButton in GameObject.FindGameObjectsWithTag(Tags.ArenaSelector)) { if (!hostFetcher.HasArena(arenaButton.name)) { arenaButton.collider.enabled = false; arenaButton.renderer.material.color = new Color(255, 255, 255, disabledAlpha); } else { oneIsActive = true; } } if (!oneIsActive) { GameObject.Find("Arenas/Any").SetActive(false); } }