예제 #1
0
        /// <summary>
        /// Updates IMGUI of the multiplayer.
        /// </summary>
        void OnGUI()
        {
            if (netManager.IsOnline)
            {
                netManager.DrawNameTags();
            }

            GUI.color = Color.white;
            GUI.Label(new Rect(2, Screen.height - 18, 500, 20), "MSCMP " + Client.GetMODDisplayVersion());

            GUI.color = new Color(1.0f, 1.0f, 1.0f, 0.25f);
            GUI.DrawTexture(new Rect(2, Screen.height - 80, 76, 66), modLogo);

            // Draw online state.

            if (netManager.IsOnline)
            {
                GUI.color = Color.green;
                GUI.Label(new Rect(2, 2, 500, 20), "ONLINE " + (netManager.IsHost ? "HOST" : "PLAYER"));
            }
            else
            {
                GUI.color = Color.red;
                GUI.Label(new Rect(2, 2, 500, 20), "OFFLINE");
            }

            MessagesList.Draw();

            // Friends widget.

            if (ShouldSeeInvitePanel())
            {
                UpdateInvitePanel();
            }

#if !PUBLIC_RELEASE
            DevTools.OnGUI();

            if (DevTools.netStats)
            {
                netManager.DrawDebugGUI();
            }

            gameWorld.UpdateIMGUI();
#endif

            console.Draw();
        }
예제 #2
0
        /// <summary>
        /// Updates IMGUI of the multiplayer.
        /// </summary>
        void OnGUI()
        {
            if (netManager.IsOnline)
            {
                netManager.DrawNameTags();
            }
            // Draw online state.

            if (netManager.IsOnline)
            {
                GUI.color = Color.green;
                GUI.skin.label.alignment = TextAnchor.UpperRight;
                GUI.Label(new Rect(Screen.width - 210, 2, 200, 20),
                          "ONLINE " + (netManager.IsHost ? "HOST" : "PLAYER"));
            }
            else
            {
                GUI.color = Color.red;
                GUI.skin.label.alignment = TextAnchor.UpperRight;
                GUI.Label(new Rect(Screen.width - 210, 2, 200, 20), "OFFLINE");
            }

            MessagesList.Draw();

            // Friends widget.

            if (ShouldSeeInvitePanel())
            {
                UpdateInvitePanel();
            }

#if !PUBLIC_RELEASE
            DevTools.OnGUI();

            if (DevTools.netStats)
            {
                netManager.DrawDebugGUI();
            }

            gameWorld.UpdateIMGUI();
#endif

            console.Draw();
        }
예제 #3
0
        void Start()
        {
            Steamworks.SteamAPI.Init();

            DontDestroyOnLoad(this.gameObject);

            netManager = new NetManager();

            modLogo = Client.LoadAsset <Texture2D>("Assets/Textures/MSCMPLogo.png");

            IMGUIUtils.Setup();

#if !PUBLIC_RELEASE
            // Skip splash screen in development builds.
            Application.LoadLevel("MainMenu");

            DevTools.OnInit();
#endif
        }
예제 #4
0
        /// <summary>
        /// Update multiplayer state.
        /// </summary>
        void LateUpdate()
        {
            Utils.CallSafe("Update", () => {
                Steamworks.SteamAPI.RunCallbacks();

                if (IsInvitePanelVisible())
                {
                    UpdateFriendList();
                }

                gameWorld.Update();
                netManager.Update();

                // Development stuff.
#if !PUBLIC_RELEASE
                DevTools.Update();
#endif
            });
        }
예제 #5
0
        void Start()
        {
            Steamworks.SteamAPI.Init();

            DontDestroyOnLoad(this.gameObject);

            netManager = new NetManager();

            modLogo = Client.LoadAsset <Texture2D>("Assets/Textures/MSCMPLogo.png");

            IMGUIUtils.Setup();

            string initialLevel = string.Empty;
            bool   noSplash     = Client.IsCdlParamSet("-nosplash");

#if !PUBLIC_RELEASE
            // Always skip splash screen in development builds.
            noSplash = true;

            DevTools.OnInit();
#endif

            if (noSplash)
            {
                initialLevel = "MainMenu";
            }

            // Add option to automatically host game via command line.
            if (Client.IsCdlParamSet("-autohost"))
            {
                initialLevel = "GAME";
            }

            if (initialLevel != string.Empty)
            {
                Application.LoadLevel(initialLevel);
            }
        }