//public string[] playerList = new string[10]; // Use this for initialization void Start() { if (ChatHandler == null && GameObject.Find("Chat-Canvas") != null) { ChatHandler = GameObject.Find("Chat-Canvas").GetComponent <GameChatHandler> (); } if (FriendLobbyComponent == null && GameObject.Find("FriendLobby-Canvas") != null) { FriendLobbyComponent = GameObject.Find("FriendLobby-Canvas").GetComponent <FriendLobby> (); } if (HelpScreenComponent == null && GameObject.Find("HelpScreen-Canvas") != null) { HelpScreenComponent = GameObject.Find("HelpScreen-Canvas").GetComponent <UIHelpScreen> (); } FindMainMenuObject(); FindPlayerDataObject(); if (!PhotonNetwork.connected) { Debug.Log("Networking start: connect"); Connect(); } SceneManager.sceneLoaded += OnLevelFinishedLoading; if (MainMenuComponent != null) { SceneloadCanvas = MainMenuComponent.BackGroundCanvas; MainMenuComponent.gotoMainMenu(); MainMenuComponent.LoadDeckData(); } }
public void ConnectChat() { /*if ((player == null) && * (GameObject.Find ("Player") != null)) { * player = GameObject.Find ("Player").GetComponent<LocalPlayer> (); * }*/ if (LocalPlayer.Instace != null) { if (LocalPlayer.Instace.DataLoaded == false) { LocalPlayer.Instace.LoadPlayerData(null); } } if (ChatHandler == null && GameObject.Find("Chat-Canvas") != null) { ChatHandler = GameObject.Find("Chat-Canvas").GetComponent <GameChatHandler> (); } if (ChatHandler != null) { if (LocalPlayer.Instace.localPlayerData.dispName != null) { if ((chatIdCache == null || chatIdCache.Length == 0) && LocalPlayer.Instace.localPlayerData.dispName.Length != 0) { chatIdCache = LocalPlayer.Instace.localPlayerData.dispName; } } if (chatIdCache != null) { if (chatIdCache.Length != 0) { ChatHandler.GameChatConnect(chatIdCache); Debug.Log("connect to chat with data: " + LocalPlayer.Instace.localPlayerData.dispName + " cache: " + chatIdCache); } } } }