コード例 #1
0
        private void DrawSubspaces()
        {
            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition, ScrollStyle);
            for (var i = 0; i < SubspaceDisplay.Count; i++)
            {
                GUILayout.BeginVertical(BoxStyle);
                GUILayout.BeginHorizontal(_subspaceStyle);
                if (SubspaceDisplay[i].SubspaceId == -1)
                {
                    GUILayout.Label(StatusTexts.WarpingLabelTxt);
                }
                else
                {
                    GUILayout.Label(StatusTexts.GetTimeLabel(SubspaceDisplay[i]));
                    GUILayout.FlexibleSpace();
                    if (NotWarpingAndIsFutureSubspace(SubspaceDisplay[i].SubspaceId) && GUILayout.Button(SyncIcon, ButtonStyle))
                    {
                        WarpSystem.Singleton.SyncToSubspace(SubspaceDisplay[i].SubspaceId);
                    }
                }
                GUILayout.EndHorizontal();

                for (var j = 0; j < SubspaceDisplay[i].Players.Count; j++)
                {
                    DrawPlayerEntry(StatusSystem.Singleton.GetPlayerStatus(SubspaceDisplay[i].Players[j]));
                }
                GUILayout.EndVertical();
            }

            GUILayout.EndScrollView();
        }
コード例 #2
0
        private static void DrawSubspaces()
        {
            _scrollPosition =
                GUILayout.BeginScrollView(_scrollPosition, _subspaceListStyle, GUILayout.ExpandHeight(true));

            for (var i = 0; i < SubspaceDisplay.Count; i++)
            {
                GUILayout.BeginVertical(_subspaceStyle, GUILayout.ExpandWidth(true));
                GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                if (SubspaceDisplay[i].SubspaceId == -1)
                {
                    GUILayout.Label(StatusTexts.WarpingLabelTxt, BoldRedLabelStyle);
                }
                else
                {
                    GUILayout.Label(StatusTexts.GetTimeLabel(SubspaceDisplay[i]));
                    GUILayout.FlexibleSpace();
                    if (NotWarpingAndIsFutureSubspace(SubspaceDisplay[i].SubspaceId) && GUILayout.Button(SyncIcon))
                    {
                        WarpSystem.Singleton.SyncToSubspace(SubspaceDisplay[i].SubspaceId);
                    }
                }

                GUILayout.EndHorizontal();

                for (var j = 0; j < SubspaceDisplay[i].Players.Count; j++)
                {
                    DrawPlayerEntry(StatusSystem.Singleton.GetPlayerStatus(SubspaceDisplay[i].Players[j]));
                }

                GUILayout.EndVertical();
            }

            GUILayout.EndScrollView();

            //Our scroll list will capture the scrollwheel.
            if (Event.current.type == EventType.ScrollWheel)
            {
                Event.current.Use();
            }
        }