public virtual void Start() { loginUI = GetComponent <LoginUI>(); lobby = GetComponent <LobbyUI>(); gameStart = GetComponent <GameStart>(); PhotonEngine.Instance.AddEvent(this); }
void Awake() { //clientName = MyGameManager.user.Name; chatUI = FindObjectOfType <ChatUI>(); lobbyUI = FindObjectOfType <LobbyUI>(); lobbyController = FindObjectOfType <LobbyController>(); }
// Use this for initialization void Start () { uiManager = GameObject.FindGameObjectWithTag("UI").GetComponent<LobbyUI>(); UserScript user = GameObject.FindGameObjectWithTag("Network").GetComponent<UserScript>(); SetBox(user.OwnHeroInfos[index].heroType, user.OwnHeroInfos[index].level); gameObject.GetComponent<UIButton>().isEnabled = IsActiveButton; }
void FindRefs() { if (connectUI == null) { GameObject con = GameObject.Find("ConnectUI"); if (con != null) { connectUI = con.GetComponent <ConnectUI>(); #if !UNITY_WEBGL connectUI.Init(defaultHost, defaultTcpPort); #else connectUI.Init(defaultHost, defaultWsPort); #endif } } if (gameLogic == null) { GameObject game = GameObject.Find("GameLogic"); if (game != null) { gameLogic = game.GetComponent <GameLogic>(); } } if (lobbyUI == null) { GameObject lobby = GameObject.Find("LobbyUI"); if (lobby != null) { lobbyUI = lobby.GetComponent <LobbyUI>(); } } }
void Awake() { lobbyUI = FindObjectOfType <LobbyUI>(); playButton = detailPanel.GetComponentInChildren <Button>(); var detailPanelTrans = detailPanel.GetComponent <RectTransform>(); detailPanelX = detailPanelTrans.anchoredPosition.x; selectButton.onClick.AddListener(() => { ToggleDescription(); foreach (var button in lobbyUI.AllButtons) { if (button.isOpened && button != this) { button.ToggleDescription(); break; } } }); playButton.onClick.AddListener(() => { Song.currentSong = Song.LoadSong(songName); SceneManager.LoadScene("Dummy"); }); if (!isOpened) { detailPanelTrans.anchoredPosition = new Vector2(0.0f, detailPanelTrans.anchoredPosition.y); detailPanel.gameObject.SetActive(false); } }
private void Awake() { //如果instan为空 才赋值 if (instan == null) { instan = this; } }
public void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.name == "Lobby") { ui = GameObject.Find("Lobby UI").GetComponent <LobbyUI>(); ui.OnSceneChangedFromLobby(this); } }
public override void OnStartClient() { ui = LobbyUI.instance; SetStaticInstance(); if (ui != null) { ui.UpdateDisplay(); } }
void Awake() { networkManager = FindObjectOfType <MyNetworkManager>(); lobbyUI = FindObjectOfType <LobbyUI>(); hostButton.onClick.AddListener(StartHostingCreation); createLanButton.onClick.AddListener(StartLANCreation); joinLanButton.onClick.AddListener(StartClient); startButton.onClick.AddListener(StartGame); quitButton.onClick.AddListener(LastState); ActiveGameLobby(); }
/// <summary> /// /// Refreshes the display of the rule /// /// </summary> public void RefreshRuleDisplay(Rule _rule, LobbyUI _lobbyUI = null, GameplayUI _gameplayUI = null, CampaignManagerUI _campaignManagerUI = null) { rule = _rule; lobbyUI = _lobbyUI; gameplayUI = _gameplayUI; campaignManagerUI = _campaignManagerUI; nameText.text = rule.Name; descriptionText.text = rule.Description; descriptionArea.SetActive(false); }
void Awake() { if (instance == null) { instance = this; } else { Debug.Log("There should not be two LobbUIs, deleting this one."); Destroy(this.gameObject); } }
public void Start() { try { loginUI = GetComponent <LoginUI>(); lobby = GameObject.FindWithTag("Lobby").GetComponent <LobbyUI>(); gameStart = GameObject.FindWithTag("GameStart").GetComponent <GameStart>(); } catch { } PhotonEngine.Instance.AddRequest(this); }
private void Awake() { instance = this; refreshRoomInfo.onClick.AddListener(RecUDP); closeRoomInfo.onClick.AddListener(ButtonCloseRoomInfo); createHost.onClick.AddListener(ButtoncreateHost); joinButton.onClick.AddListener(ButtonJoin); nameInput.onEndEdit.AddListener(InputName); colseCreatRoomGo.onClick.AddListener(ButtoncolseCreatRoomGo); closeRoom.onClick.AddListener(ButtoncolseRoomGo); tipButton.onClick.AddListener(TipsButton); }
// Use this for initialization void Start() { Instance = this; try { c = FindObjectOfType <Client>(); c.LUI = this; setCurrentUserHost(); c.GetPlayerList(); } catch (System.Exception) { back(); } try { Destroy(MainMenu.Instance.gameObject); } catch (System.Exception) { } }
/// <summary> /// /// Find the required pages for the main menu /// /// </summary> public void SyncMenuPages() { activeMainPanel = ActiveMainPanels.Default; currentSceneController = GameObject.FindGameObjectWithTag("MainMenuUIController"); var mainMenuUIReferences = currentSceneController.GetComponent <MainMenuUIReferences>(); cardDetailDisplay = mainMenuUIReferences.cardDetailDisplay.GetComponent <CardDetailUI>(); upgradeDetailDisplay = mainMenuUIReferences.upgradeDetailDisplay.GetComponent <UpgradeDetailUI>(); campaignPage = mainMenuUIReferences.campaignUI.GetComponent <CampaignUI>(); lobbyPage = mainMenuUIReferences.lobbyUI.GetComponent <LobbyUI>(); cardLibrary = mainMenuUIReferences.libraryUI.GetComponent <CardLibraryParent>(); newDeckUI = mainMenuUIReferences.newDeckUI.GetComponent <NewDeckUI>(); cardDetailDisplay.gameObject.SetActive(false); upgradeDetailDisplay.gameObject.SetActive(false); campaignPage.gameObject.SetActive(false); lobbyPage.gameObject.SetActive(false); cardLibrary.gameObject.SetActive(false); newDeckUI.gameObject.SetActive(false); }
public void AddUIDepth(LobbyUI _LobbyUI) { m_ListLobbyUIDepth.Remove(_LobbyUI); m_ListLobbyUIDepth.Add(_LobbyUI); }
private void Start() { instance = this; }
public void OnUILoadFinish(LobbyUI lobbyUI) { this.ui = lobbyUI; }
// Use this for initialization void Start() { DontDestroyOnLoad(gameObject); UI = GetComponent <LobbyUI>(); UI.UpdateInfo("offline", "none"); }
public override void OnStartAuthority() { ui = LobbyUI.instance; CmdSetDisplayName(PlayerNameField.DisplayName); ui.UpdateDisplay(); }
public override void OnClientEnterRoom() { ui = LobbyUI.instance; ui.UpdateDisplay(); }
public void SubUIDepth(LobbyUI _LobbyUI) { m_ListLobbyUIDepth.Remove(_LobbyUI); }
public void Awake() { lobby = GameObject.Find("Canvas").GetComponent <LobbyUI>(); }