Example #1
0
 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>();
 }
Example #3
0
	// 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;
	}
Example #4
0
    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>();
            }
        }
    }
Example #5
0
    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);
        }
    }
Example #6
0
 private void Awake()
 {
     //如果instan为空 才赋值
     if (instan == null)
     {
         instan = this;
     }
 }
Example #7
0
 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();
     }
 }
Example #9
0
 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();
 }
Example #10
0
    /// <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);
    }
Example #11
0
 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);
 }
Example #13
0
    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);
    }
Example #14
0
 // 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) { }
 }
Example #15
0
    /// <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);
    }
Example #16
0
 public void AddUIDepth(LobbyUI _LobbyUI)
 {
     m_ListLobbyUIDepth.Remove(_LobbyUI);
     m_ListLobbyUIDepth.Add(_LobbyUI);
 }
Example #17
0
 private void Start()
 {
     instance = this;
 }
Example #18
0
 public void OnUILoadFinish(LobbyUI lobbyUI)
 {
     this.ui = lobbyUI;
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad(gameObject);
     UI = GetComponent <LobbyUI>();
     UI.UpdateInfo("offline", "none");
 }
Example #20
0
 public override void OnStartAuthority()
 {
     ui = LobbyUI.instance;
     CmdSetDisplayName(PlayerNameField.DisplayName);
     ui.UpdateDisplay();
 }
Example #21
0
 public override void OnClientEnterRoom()
 {
     ui = LobbyUI.instance;
     ui.UpdateDisplay();
 }
Example #22
0
 public void SubUIDepth(LobbyUI _LobbyUI)
 {
     m_ListLobbyUIDepth.Remove(_LobbyUI);
 }
Example #23
0
 public void Awake()
 {
     lobby = GameObject.Find("Canvas").GetComponent <LobbyUI>();
 }