UnityEngine.GUILayout.BeginHorizontal(params UnityEngine.GUILayoutOption[])

Here are the examples of the csharp api UnityEngine.GUILayout.BeginHorizontal(params UnityEngine.GUILayoutOption[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

521 Examples 7

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void BeginHorizontal()
        {
            UGUI.BeginHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void BeginHorizontal(GUILayoutOption[] opts)
        {
            UGUI.BeginHorizontal(opts);
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void BeginVertical()
        {
            UGUI.BeginHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void BeginVertical(GUILayoutOption[] opts)
        {
            UGUI.BeginHorizontal(opts);
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static float HorizontalSlider(float val, string label)
        {
            UGUI.BeginHorizontal();
            Label(label);
            UGUI.Space(5f);
            val = UGUI.HorizontalSlider(val, 0f, 1f, Style.Slider, Style.SliderBody, DefaultOption);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static float HorizontalSlider(float val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] sliderOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val = UGUI.HorizontalSlider(val, 0f, 1f, Style.Slider, Style.SliderBody, sliderOpts);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static float HorizontalSlider(float val, string label, float min, float max)
        {
            UGUI.BeginHorizontal();
            Label(label);
            UGUI.Space(5f);
            val = UGUI.HorizontalSlider(val, min, max, Style.Slider, Style.SliderBody, DefaultOption);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static float HorizontalSlider(float val, string label, float min, float max, GUILayoutOption[] lblOpts, GUILayoutOption[] sliderOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val = UGUI.HorizontalSlider(val, min, max, Style.Slider, Style.SliderBody, sliderOpts);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void HorizontalSlider(Setting<float> val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val.Value = UGUI.HorizontalSlider(val.Value, 0f, 1f, Style.Slider, Style.SliderBody, DefaultOption);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void HorizontalSlider(Setting<float> val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] sliderOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val.Value = UGUI.HorizontalSlider(val.Value, 0f, 1f, Style.Slider, Style.SliderBody, sliderOpts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void HorizontalSlider(Setting<float> val, string label, float min, float max)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val.Value = UGUI.HorizontalSlider(val.Value, min, max, Style.Slider, Style.SliderBody, DefaultOption);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void HorizontalSlider(Setting<float> val, string label, float min, float max, GUILayoutOption[] lblOpts, GUILayoutOption[] sliderOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val.Value = UGUI.HorizontalSlider(val.Value, min, max, Style.Slider, Style.SliderBody, sliderOpts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static string TextField(string val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val = UGUI.TextField(val, Style.TextButton, DefaultOption);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static string TextField(string val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] txtopts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val = UGUI.TextField(val, Style.TextButton, txtopts);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<string> val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val.Value = UGUI.TextField(val.Value, Style.TextButton, DefaultOption);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<string> val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] txtopts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val.Value = UGUI.TextField(val.Value, Style.TextButton, txtopts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<float> val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            TextField(val);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<float> val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] txtopts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            TextField(val, txtopts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<int> val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            TextField(val);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void TextField(Setting<int> val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] txtopts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            TextField(val, txtopts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static bool Toggle(bool val, string label)
        {
            UGUI.BeginHorizontal();
            Label(label);
            UGUI.FlexibleSpace();
            val = UGUI.Toggle(val, string.Empty, Style.Toggle);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static bool Toggle(bool val, string label, GUILayoutOption[] labelOpts, GUILayoutOption[] tglOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, labelOpts);
            UGUI.FlexibleSpace();
            val = UGUI.Toggle(val, string.Empty, Style.Toggle, tglOpts);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void Toggle(Setting<bool> val, string label)
        {
            UGUI.BeginHorizontal();
            Label(label);
            UGUI.FlexibleSpace();
            val.Value = UGUI.Toggle(val.Value, string.Empty, Style.Toggle);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void Toggle(Setting<bool> val, string label, GUILayoutOption[] labelOpts, GUILayoutOption[] tglOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, labelOpts);
            UGUI.FlexibleSpace();
            val.Value = UGUI.Toggle(val.Value, string.Empty, Style.Toggle, tglOpts);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static bool ToggleButton(bool val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val = UGUI.Button(val ? GUI.LabelEnabled : GUI.LabelDisabled, Style.TextButton, DefaultOption);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static bool ToggleButton(bool val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] btnOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val = UGUI.Button(val ? GUI.LabelEnabled : GUI.LabelDisabled, Style.TextButton, btnOpts);
            UGUI.EndHorizontal();
            return val;
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void ToggleButton(Setting<bool> val, string label)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, DefaultOption);
            UGUI.Space(5f);
            val.Value = UGUI.Button(val.Value ? GUI.LabelEnabled : GUI.LabelDisabled, Style.TextButton, DefaultOption);
            UGUI.EndHorizontal();
        }

19 View Source File : GUILayout.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public static void ToggleButton(Setting<bool> val, string label, GUILayoutOption[] lblOpts, GUILayoutOption[] btnOpts)
        {
            UGUI.BeginHorizontal();
            UGUI.Label(label, Style.Label, lblOpts);
            UGUI.Space(5f);
            val.Value = UGUI.Button(val.Value ? GUI.LabelEnabled : GUI.LabelDisabled, Style.TextButton, btnOpts);
            UGUI.EndHorizontal();
        }

19 View Source File : SampleInfo.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnGUI()
    {
        GUILayout.Label("iTween can spin, shake, punch, move, handle audio, fade color and transparency \nand much more with each task needing only one line of code.", new GUILayoutOption[0]);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUILayout.Label("iTween works with C#, JavaScript and Boo. For full doreplacedentation and examples visit:", new GUILayoutOption[0]);
        if (GUILayout.Button("http://itween.pixelplacement.com", new GUILayoutOption[0]))
        {
            Application.OpenURL("http://itween.pixelplacement.com");
        }
        GUILayout.EndHorizontal();
    }

19 View Source File : PhotonStatsGui.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public void TrafficStatsWindow(int windowID)
    {
        bool flag = false;
        TrafficStatsGameLevel trafficStatsGameLevel = PhotonNetwork.networkingPeer.TrafficStatsGameLevel;
        long num = PhotonNetwork.networkingPeer.TrafficStatsElapsedMs / 1000L;
        if (num == 0L)
        {
            num = 1L;
        }
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        this.buttonsOn = GUILayout.Toggle(this.buttonsOn, "buttons", new GUILayoutOption[0]);
        this.healthStatsVisible = GUILayout.Toggle(this.healthStatsVisible, "health", new GUILayoutOption[0]);
        this.trafficStatsOn = GUILayout.Toggle(this.trafficStatsOn, "traffic", new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        string text = string.Format("Out|In|Sum:\t{0,4} | {1,4} | {2,4}", trafficStatsGameLevel.TotalOutgoingMessageCount, trafficStatsGameLevel.TotalIncomingMessageCount, trafficStatsGameLevel.TotalMessageCount);
        string text2 = string.Format("{0}sec average:", num);
        string text3 = string.Format("Out|In|Sum:\t{0,4} | {1,4} | {2,4}", (long)trafficStatsGameLevel.TotalOutgoingMessageCount / num, (long)trafficStatsGameLevel.TotalIncomingMessageCount / num, (long)trafficStatsGameLevel.TotalMessageCount / num);
        GUILayout.Label(text, new GUILayoutOption[0]);
        GUILayout.Label(text2, new GUILayoutOption[0]);
        GUILayout.Label(text3, new GUILayoutOption[0]);
        if (this.buttonsOn)
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            this.statsOn = GUILayout.Toggle(this.statsOn, "stats on", new GUILayoutOption[0]);
            if (GUILayout.Button("Reset", new GUILayoutOption[0]))
            {
                PhotonNetwork.networkingPeer.TrafficStatsReset();
                PhotonNetwork.networkingPeer.TrafficStatsEnabled = true;
            }
            flag = GUILayout.Button("To Log", new GUILayoutOption[0]);
            GUILayout.EndHorizontal();
        }
        string text4 = string.Empty;
        string text5 = string.Empty;
        if (this.trafficStatsOn)
        {
            text4 = "Incoming: " + PhotonNetwork.networkingPeer.TrafficStatsIncoming.ToString();
            text5 = "Outgoing: " + PhotonNetwork.networkingPeer.TrafficStatsOutgoing.ToString();
            GUILayout.Label(text4, new GUILayoutOption[0]);
            GUILayout.Label(text5, new GUILayoutOption[0]);
        }
        string text6 = string.Empty;
        if (this.healthStatsVisible)
        {
            text6 = string.Format("ping: {6}[+/-{7}]ms\nlongest delta between\nsend: {0,4}ms disp: {1,4}ms\nlongest time for:\nev({3}):{2,3}ms op({5}):{4,3}ms", new object[]
            {
                trafficStatsGameLevel.LongestDeltaBetweenSending,
                trafficStatsGameLevel.LongestDeltaBetweenDispatching,
                trafficStatsGameLevel.LongestEventCallback,
                trafficStatsGameLevel.LongestEventCallbackCode,
                trafficStatsGameLevel.LongestOpResponseCallback,
                trafficStatsGameLevel.LongestOpResponseCallbackOpCode,
                PhotonNetwork.networkingPeer.RoundTripTime,
                PhotonNetwork.networkingPeer.RoundTripTimeVariance
            });
            GUILayout.Label(text6, new GUILayoutOption[0]);
        }
        if (flag)
        {
            string message = string.Format("{0}\n{1}\n{2}\n{3}\n{4}\n{5}", new object[]
            {
                text,
                text2,
                text3,
                text4,
                text5,
                text6
            });
            Debug.Log(message);
        }
        if (GUI.changed)
        {
            this.statsRect.height = 100f;
        }
        GUI.DragWindow();
    }

19 View Source File : ConsoleWindow.cs
License : MIT License
Project Creator : akof1314

public override void OnGUI(Rect rect)
        {
            string itemValue = m_Object as string;
            if (itemValue == null)
            {
                Debug.LogError("Invalid object");
                return;
            }

            if (m_TextSearch == null)
            {
                m_TextSearch = itemValue;
            }

            const float kColumnWidth = 70f;
            const float kSpacing = 10f;

            GUILayout.Space(3);
            GUILayout.Label(m_MenuType == MenuType.Add ? Styles.headerAdd : Styles.headerEdit, EditorStyles.boldLabel);

            Rect seperatorRect = GUILayoutUtility.GetRect(1, 1);
            FlexibleMenu.DrawRect(seperatorRect,
                (EditorGUIUtility.isProSkin)
                    ? new Color(0.32f, 0.32f, 0.32f, 1.333f)
                    : new Color(0.6f, 0.6f, 0.6f, 1.333f));                      // dark : light
            GUILayout.Space(4);

            // Optional text
            GUILayout.BeginHorizontal();
            GUILayout.Label(Styles.optionalText, GUILayout.Width(kColumnWidth));
            GUILayout.Space(kSpacing);
            m_TextSearch = EditorGUILayout.TextField(m_TextSearch);
            GUILayout.EndHorizontal();

            GUILayout.Space(5f);

            // Cancel, Ok
            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            if (GUILayout.Button(Styles.cancel))
            {
                editorWindow.Close();
            }

            if (GUILayout.Button(Styles.ok))
            {
                var textSearch = m_TextSearch.Trim();
                if (!string.IsNullOrEmpty(textSearch))
                {
                    m_Object = m_TextSearch;
                    Accepted();
                    editorWindow.Close();
                }
            }
            GUILayout.Space(10);
            GUILayout.EndHorizontal();
        }

19 View Source File : ConsoleScript.cs
License : GNU General Public License v3.0
Project Creator : AndrasMumm

void DrawLog(Log log, GUIStyle logStyle, GUIStyle badgeStyle)
        {
            GUI.contentColor = logTypeColors[log.type];

            if (isCollapsed)
            {
                // Draw collapsed log with badge indicating count.
                GUILayout.BeginHorizontal();
                GUILayout.Label(log.GetTruncatedMessage(), logStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label(log.count.ToString(), GUI.skin.box);
                GUILayout.EndHorizontal();
            }
            else
            {
                // Draw expanded log.
                for (var i = 0; i < log.count; i += 1)
                {
                    GUILayout.Label(log.GetTruncatedMessage(), logStyle);
                }
            }

            GUI.contentColor = Color.white;
        }

19 View Source File : ConsoleScript.cs
License : GNU General Public License v3.0
Project Creator : AndrasMumm

void DrawToolbar()
        {
            GUILayout.BeginHorizontal();

            GUILayout.BeginVertical();
            if (GUILayout.Button(clearLabel))
            {
                logs.Clear();
            }

            if (GUILayout.Button("Reload Scene"))
            {
                Scene scene = SceneManager.GetActiveScene();
                SceneManager.LoadScene(scene.name);
            }
            GUILayout.EndVertical();

            foreach (LogType logType in Enum.GetValues(typeof(LogType)))
            {
                var currentState = logTypeFilters[logType];
                var label = logType.ToString();
                logTypeFilters[logType] = GUILayout.Toggle(currentState, label, GUILayout.ExpandWidth(false));
                GUILayout.Space(20);
            }

            isCollapsed = GUILayout.Toggle(isCollapsed, collapseLabel, GUILayout.ExpandWidth(false));

            GUILayout.EndHorizontal();
        }

19 View Source File : GridComponentEditor.cs
License : GNU Lesser General Public License v3.0
Project Creator : ApexGameTools

public override void OnInspectorGUI()
        {
            GUI.enabled = !EditorApplication.isPlaying;

            this.serializedObject.Update();

            int baked = 0;
            var editedObjects = this.serializedObject.targetObjects;
            for (int i = 0; i < editedObjects.Length; i++)
            {
                var g = editedObjects[i] as GridComponent;
                if (g.bakedData != null)
                {
                    baked++;
                }
            }

            EditorGUILayout.Separator();

            if (baked > 0 && baked < editedObjects.Length)
            {
                EditorGUILayout.LabelField("A mix of baked and unbaked grids cannot be edited at the same time.");
                return;
            }

            //If data is baked, only offer an option to edit or rebake
            if (baked == editedObjects.Length)
            {
                EditorGUILayout.LabelField("The grid has been baked. To change it press the Edit button below.");

                GUILayout.BeginHorizontal();

                if (GUILayout.Button("Edit"))
                {
                    foreach (var o in editedObjects)
                    {
                        var g = o as GridComponent;
                        EditorUtilitiesInternal.Removereplacedet(g.bakedData);
                        g.bakedData = null;
                        g.ResetGrid();
                        EditorUtility.SetDirty(g);
                    }
                }

                if (GUILayout.Button("Re-bake Grid"))
                {
                    foreach (var o in editedObjects)
                    {
                        var g = o as GridComponent;
                        BakeGrid(g);
                    }
                }

                GUILayout.EndHorizontal();
                return;
            }

            EditorGUILayout.PropertyField(_friendlyName);

            EditorUtilities.Section("Layout");

            EditorGUILayout.PropertyField(_linkOriginToTransform);

            if (!_linkOriginToTransform.hasMultipleDifferentValues)
            {
                if (_linkOriginToTransform.boolValue)
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.PropertyField(_originOffset, true);
                    EditorGUI.indentLevel--;
                }
                else
                {
                    EditorGUILayout.PropertyField(_origin, true);
                }
            }

            EditorGUILayout.PropertyField(_sizeX);
            EditorGUILayout.PropertyField(_sizeZ);
            EditorGUILayout.PropertyField(_cellSize);
            EditorGUILayout.PropertyField(_lowerBoundary);
            EditorGUILayout.PropertyField(_upperBoundary);
            EditorGUILayout.PropertyField(_obstacleSensitivityRange);
            EditorGUILayout.PropertyField(_obstacleAndGroundDetection);

            EditorUtilities.Section("Subsections");

            EditorGUILayout.PropertyField(_subSectionsX);
            EditorGUILayout.PropertyField(_subSectionsZ);
            EditorGUILayout.PropertyField(_subSectionsCellOverlap);

            ShowHeightMapOptions();

            EditorUtilities.Section("Initialization");
            EditorGUILayout.PropertyField(_automaticInitialization);
            EditorGUILayout.PropertyField(_automaticConnections);
            if (_automaticConnections.boolValue)
            {
                EditorGUILayout.PropertyField(_connectorPortalWidth);
            }

            EditorGUILayout.Separator();
            EditorGUILayout.PropertyField(_storeBakedDataAsreplacedet);

            this.serializedObject.ApplyModifiedProperties();

            if (GUILayout.Button(new GUIContent("Bake Grid", "Calculates grid data such as blocked areas and height map and stores this snapshot. The snapshot is then used to initialize the grid at runtime.\nPlease note that baking is completely optional.")))
            {
                foreach (var o in editedObjects)
                {
                    var g = o as GridComponent;
                    BakeGrid(g);
                }
            }

            GUI.enabled = true;
        }

protected override void CreateUI()
        {
            base.CreateUI();

            if (Application.isPlaying)
            {
                EditorGUILayout.Separator();
                GUILayout.BeginHorizontal();
                _customSpeed = EditorGUILayout.FloatField(_customSpeed, GUILayout.Width(100));
                if (GUILayout.Button("Test Custom Speed"))
                {
                    var targets = this.targets;
                    var count = targets.Length;
                    for (int i = 0; i < count; i++)
                    {
                        var hs = targets[i] as HumanoidSpeedComponent;
                        hs.SetPreferredSpeed(_customSpeed);
                        _customSpeed = Mathf.Min(_customSpeed, hs.maximumSpeed);
                    }
                }

                GUILayout.EndHorizontal();
            }
        }

private void OnGUI()
        {
            GUILayout.BeginArea(new Rect(5f, 0f, Screen.width - 5f, 40f));
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("One Time Action", GUILayout.Height(30f)))
            {
                Toggle<OneTimeActionExample>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Repeatable Action", GUILayout.Height(30f)))
            {
                Toggle<RepetableActionExample>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Long Running Action", GUILayout.Height(30f)))
            {
                Toggle<LongRunningActionExample>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Pooled Actions", GUILayout.Height(30f)))
            {
                Toggle<PooledActionsExample>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Marshaller", GUILayout.Height(30f)))
            {
                Toggle<MarshallerExample>(); 
            }

            GUILayout.Space(6f);

            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }

private void OnGUI()
        {
            GUILayout.BeginArea(new Rect(5f, 0f, Screen.width - 5f, 40f));
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Update", GUILayout.Height(30f)))
            {
                Toggle<PillarToggle>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Coroutine", GUILayout.Height(30f)))
            {
                Toggle<PillarToggleCoroutine>();
            }

            GUILayout.Space(6f);

            if (GUILayout.Button("Load Balancer", GUILayout.Height(30f)))
            {
                Toggle<PillarToggleBalanced>();
            }

            GUILayout.Space(6f);

            GUILayout.EndHorizontal();
            GUILayout.EndArea();
        }

19 View Source File : MiscHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_damage_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_damage_player :"), GUILayout.ExpandWidth(false));
                    s_playerDamageIdx = RGUI.SelectionPopup(s_playerDamageIdx, s_playerNames.ToArray());
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_damage_value :"), GUILayout.ExpandWidth(false));
                    s_damageToDeal = GUILayout.TextField(s_damageToDeal, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_player")))
                {
                    
                    if (int.TryParse(s_damageToDeal, out int damage))
                    {
                        s_players[s_playerDamageIdx].VTDamage(damage);
                    }
                }
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_enreplacedies")))
                {
                    DamageAllCharacters();
                }
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_damage_button_players")))
                {
                    DamageAllOtherPlayers();
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_event_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_event_message :"), GUILayout.ExpandWidth(false));
                    s_worldMessageText = GUILayout.TextField(s_worldMessageText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_event_button")))
                {
                    MessageAllInRange(MessageHud.MessageType.Center, s_worldMessageText);
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_chat_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_username :"), GUILayout.ExpandWidth(false));
                    s_chatUsernameText = GUILayout.TextField(s_chatUsernameText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_message :"), GUILayout.ExpandWidth(false));
                    s_chatMessageText = GUILayout.TextField(s_chatMessageText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    s_isShoutMessage = GUILayout.Toggle(s_isShoutMessage, "");
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_misc_chat_shout"));
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_chat_button")))
                {
                    ChatMessage(s_isShoutMessage ? Talker.Type.Shout : Talker.Type.Normal, s_chatUsernameText, s_chatMessageText);
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_misc_esp_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_player_esp_button : " + (EntryPoint.s_showPlayerESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showPlayerESP = !EntryPoint.s_showPlayerESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_monster_esp_button : " + (EntryPoint.s_showMonsterESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showMonsterESP = !EntryPoint.s_showMonsterESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_dropped_esp_button : " + (EntryPoint.s_showDroppedESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showDroppedESP = !EntryPoint.s_showDroppedESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_deposit_esp_button : " + (EntryPoint.s_showDepositESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showDepositESP = !EntryPoint.s_showDepositESP;
                }

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_misc_pickable_esp_button : " + (EntryPoint.s_showPickableESP ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                {
                    EntryPoint.s_showPickableESP = !EntryPoint.s_showPickableESP;
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : PlayerHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_general_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                {
                    GUILayout.Space(EntryPoint.s_boxSpacing);

                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_god_mode : " + (Player.m_localPlayer.VTInGodMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetGodMode(!Player.m_localPlayer.VTInGodMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_inf_stamina_me : " + (s_isInfiniteStaminaMe ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isInfiniteStaminaMe = !s_isInfiniteStaminaMe;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_inf_stamina_others : " + (s_isInfiniteStaminaOthers ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isInfiniteStaminaOthers = !s_isInfiniteStaminaOthers;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_no_stamina : " + (s_isNoStaminaOthers ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        s_isNoStaminaOthers = !s_isNoStaminaOthers;
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_fly_mode : " + (Player.m_localPlayer.VTInFlyMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetFlyMode(!Player.m_localPlayer.VTInFlyMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_ghost_mode : " + (Player.m_localPlayer.VTInGhostMode() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetGhostMode(!Player.m_localPlayer.VTInGhostMode());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_nop_lacement_cost : " + (Player.m_localPlayer.VTIsNoPlacementCost() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTSetNoPlacementCost(!Player.m_localPlayer.VTIsNoPlacementCost());
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_explore_minimap")))
                    {
                        Minimap.instance.VTExploreAll();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_reset_minimap")))
                    {
                        Minimap.instance.VTReset();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_tame_creatures")))
                    {
                        Player.m_localPlayer.VTTameNearbyCreatures();
                    }
                    if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_infinite_weight : " + (Player.m_localPlayer.VTIsInventoryInfiniteWeight() ? VTLocalization.s_cheatOn : VTLocalization.s_cheatOff))))
                    {
                        Player.m_localPlayer.VTInventoryInfiniteWeight(!Player.m_localPlayer.VTIsInventoryInfiniteWeight());
                    }
                }
                GUILayout.EndVertical();

                GUILayout.BeginVertical();
                {
                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_teleport_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_teleport_player :"), GUILayout.ExpandWidth(false));

                            s_teleportTargetIdx = RGUI.SelectionPopup(s_teleportTargetIdx, s_netPlayerNames.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_teleport_button")))
                        {
                            if (s_netPlayers != null && s_teleportTargetIdx < s_netPlayers.Count && s_teleportTargetIdx >= 0)
                            {
                                Player.m_localPlayer.VTTeleportTo(s_netPlayers[s_teleportTargetIdx]);
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_heal_manager_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_heal_player :"), GUILayout.ExpandWidth(false));

                            s_healTargetIdx = RGUI.SelectionPopup(s_healTargetIdx, s_playerNames.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_heal_selected_player")))
                        {
                            if (s_healTargetIdx < s_players.Count && s_healTargetIdx >= 0)
                            {
                                s_players[s_healTargetIdx].VTHeal();
                            }
                        }
                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_heal_all_players")))
                        {
                            foreach (Player player in s_players)
                            {
                                player.VTHeal();
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_power_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_power_name :"), GUILayout.ExpandWidth(false));
                            s_guardianPowerIdx = RGUI.SelectionPopup(s_guardianPowerIdx, s_guardianPowers.Keys.Select(p => VTLocalization.instance.Localize(p)).ToArray());
                        }
                        GUILayout.EndHorizontal();


                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_power_active_me")))
                        {
                            if (Player.m_localPlayer != null)
                            {
                                Player.m_localPlayer.VTActiveGuardianPower(s_guardianPowers[s_guardianPowerIdx]);
                            }
                        }
                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_power_active_all")))
                        {
                            if (s_guardianPowers.ContainsKey(s_guardianPowerIdx))
                            {
                                AllPlayersActiveGuardianPower(s_guardianPowers[s_guardianPowerIdx]);
                            }
                        }
                    }
                    GUILayout.EndVertical();

                    GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_player_skill_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
                    {
                        GUILayout.Space(EntryPoint.s_boxSpacing);
                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_skill_name :"), GUILayout.ExpandWidth(false));
                            s_skillNameIdx = RGUI.SelectionPopup(s_skillNameIdx, s_skills.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.Label(VTLocalization.instance.Localize("$vt_player_skill_level :"), GUILayout.ExpandWidth(false));
                            s_skillLevelIdx = RGUI.SelectionPopup(s_skillLevelIdx, s_levels.ToArray());
                        }
                        GUILayout.EndHorizontal();

                        if (GUILayout.Button(VTLocalization.instance.Localize("$vt_player_skill_button")))
                        {
                            if (s_skillNameIdx < s_skills.Count && s_skillNameIdx >= 0)
                            {
                                if (int.TryParse(s_levels[s_skillLevelIdx], out int levelInt))
                                {
                                    Player.m_localPlayer.VTUpdateSkillLevel(s_skills[s_skillNameIdx], levelInt);
                                }
                            }
                        }
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : EntitiesItemsHacks.cs
License : MIT License
Project Creator : Astropilot

public static void DisplayGUI()
        {
            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_enreplacedy_name :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyPrefabIdx = RGUI.SearchableSelectionPopup(s_enreplacedyPrefabIdx, s_enreplacedyPrefabsFiltered.ToArray(), ref s_enreplacedySearchTerms);

                    SearchItem(s_enreplacedySearchTerms);
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_quanreplacedy :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyQuanreplacedyText = GUILayout.TextField(s_enreplacedyQuanreplacedyText, GUILayout.ExpandWidth(true));
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_level :"), GUILayout.ExpandWidth(false));
                    s_enreplacedyLevelIdx = RGUI.SelectionPopup(s_enreplacedyLevelIdx, s_enreplacedyLevels.ToArray());
                }
                GUILayout.EndHorizontal();

                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_enreplacedies_spawn_button")))
                {
                    if (int.TryParse(s_enreplacedyQuanreplacedyText, out int enreplacedyQuanreplacedy) && int.TryParse(s_enreplacedyLevels[s_enreplacedyLevelIdx], out int enreplacedyLevel))
                    {
                        if (enreplacedyQuanreplacedy <= 100 && s_enreplacedyPrefabIdx < s_enreplacedyPrefabsFiltered.Count && s_enreplacedyPrefabIdx >= 0)
                        {
                            SpawnEnreplacedies(s_enreplacedyPrefabsFiltered[s_enreplacedyPrefabIdx], enreplacedyLevel, enreplacedyQuanreplacedy);
                        }
                    }
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_drops_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                if (GUILayout.Button(VTLocalization.instance.Localize("$vt_enreplacedies_drops_button")))
                {
                    RemoveAllDrops();
                }
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical(VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_replacedle"), GUI.skin.box, GUILayout.ExpandWidth(false));
            {
                GUILayout.Space(EntryPoint.s_boxSpacing);
                if (GUILayout.Button(EntryPoint.s_showItemGiver ? VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_button_hide") : VTLocalization.instance.Localize("$vt_enreplacedies_item_giver_button_show")))
                {
                    EntryPoint.s_showItemGiver = !EntryPoint.s_showItemGiver;
                }
            }
            GUILayout.EndVertical();
        }

19 View Source File : ItemGiver.cs
License : MIT License
Project Creator : Astropilot

public static void ItemGiverWindow(int windowID)
        {
            if (ObjectDB.instance == null || ObjectDB.instance.m_items.Count == 0)
                return;

            GUILayout.Space(EntryPoint.s_boxSpacing);
            s_searchTerms = GUILayout.TextField(s_searchTerms);

            SearchItem(s_searchTerms);

            s_itemGiverScrollPosition = GUILayout.BeginScrollView(s_itemGiverScrollPosition, GUI.skin.box, GUILayout.Height(350));
            {
                s_selectedItem = GUILayout.SelectionGrid(s_selectedItem, s_itemsGUIFiltered.ToArray(), 4, InterfaceMaker.CustomSkin.GetStyle("flatButton"));
            }
            GUILayout.EndScrollView();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label(VTLocalization.instance.Localize("$vt_item_giver_quanreplacedy :"), GUILayout.ExpandWidth(false));
                s_quanreplacedyItem = GUILayout.TextField(s_quanreplacedyItem, GUILayout.ExpandWidth(true));
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            {
                GUILayout.Label(VTLocalization.instance.Localize("$vt_item_giver_quality :"), GUILayout.ExpandWidth(false));
                s_qualityItem = GUILayout.TextField(s_qualityItem, GUILayout.ExpandWidth(true));
            }
            GUILayout.EndHorizontal();

            if (GUILayout.Button(VTLocalization.instance.Localize("$vt_item_giver_button")))
            {
                if (int.TryParse(s_quanreplacedyItem, out int quanreplacedy) && int.TryParse(s_qualityItem, out int quality))
                {
                    Player.m_localPlayer.VTAddItemToInventory(s_itemsFiltered[s_selectedItem].itemPrefab.name, quanreplacedy, quality, s_itemsFiltered[s_selectedItem].variant);
                }
            }

            if (GUI.tooltip != "")
            {
                GUIContent tooltip = new GUIContent(GUI.tooltip);
                Vector2 tooltip_size = new GUIStyle(GUI.skin.textField).CalcSize(tooltip);
                Vector2 tooltip_pos = new Vector2();

                if (Event.current.mousePosition.x + tooltip_size.x > s_itemGiverRect.width)
                    tooltip_pos.x = Event.current.mousePosition.x - ((Event.current.mousePosition.x + tooltip_size.x) - (s_itemGiverRect.width));
                else
                    tooltip_pos.x = Event.current.mousePosition.x;
                if (Event.current.mousePosition.y + 30 + tooltip_size.y > s_itemGiverRect.height)
                    tooltip_pos.y = Event.current.mousePosition.y + 30 - ((Event.current.mousePosition.y + 30 + tooltip_size.y) - (s_itemGiverRect.height));
                else
                    tooltip_pos.y = Event.current.mousePosition.y + 30;

                GUI.Box(new Rect(tooltip_pos.x, tooltip_pos.y, tooltip_size.x, tooltip_size.y), tooltip, GUI.skin.textField);
            }

            GUI.DragWindow();
        }

19 View Source File : GUIInterface.cs
License : MIT License
Project Creator : BelkinAndrey

void OnGUI()
    {
        GUI.skin = skin;

        GUI.Box(new Rect(0, 0, Screen.width, 30), "");

        if (GUI.Button(new Rect(0, 0, 140, 30), LogoButton)) 
        {
            Application.OpenURL("https://github.com/BelkinAndrey/OPENTadpole");
        }

        GUI.Label(new Rect(150, 5, 170, 30), ">> ConnectomTadpole <<");

        if (GUI.Button(new Rect(325, 0, 115, 30), " SimWorldTadpole")) 
        {
             Application.LoadLevel(1);
        }

        if (GUI.Button(new Rect(Screen.width - 30, 0, 30, 30), CloseButton))
        {
            Application.Quit();
        }

        if (GUI.Button(new Rect(Screen.width - 60, 0, 30, 30), FullButton))
        {
            if (!Screen.fullScreen)
            {
                W = Screen.width;
                H = Screen.height;
                Screen.fullScreen = true;
                Screen.SetResolution(resolutions[resolutions.Length - 1].width, resolutions[resolutions.Length - 1].height, true);
            }
            else
            {
                Screen.fullScreen = false;
                Screen.SetResolution(W, H, false);
            }
        }

        GetComponent<SaveOpen>().PathFile = GUI.TextField(new Rect(Screen.width - 260, 5, 180, 20), GetComponent<SaveOpen>().PathFile);

        if (GUI.Button(new Rect(Screen.width - 80, 0, 20, 30), DownButton)) 
        {
            pilot = !pilot;
        }

        if (GUI.Button(new Rect(Screen.width - 350, 0, 30, 30), ClearButton)) 
        {
            PlayerPrefs.SetString("Path", "");
            PlayerPrefs.SetFloat("StartZoom", 3200);
            PlayerPrefs.SetFloat("CamX", 0);
            PlayerPrefs.SetFloat("CamY", -1840);
            PlayerPrefs.SetFloat("CamZ", -100);
            Application.LoadLevel(0);
        }

        if (GUI.Button(new Rect(Screen.width - 320, 0, 30, 30), OpenButton))
        {
            GetComponent<SaveOpen>().Open();
        }

        if (GUI.Button(new Rect(Screen.width - 290, 0, 30, 30), SaveButton))
        {
            GetComponent<SaveOpen>().Save();
        }

        if (pilot)
        {
            Rect RectPilot = new Rect(Screen.width - 260, 35, 200, 200);
            OnRect = RectPilot.Contains(Event.current.mousePosition);

            GUILayout.BeginArea(RectPilot, GUI.skin.box);
            ScrollBlok = GUILayout.BeginScrollView(ScrollBlok, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));

            string[] dir = Directory.GetFiles(Application.dataPath + "/Data/", "*.tad");
            foreach (string value in dir) 
            {
                GUILayout.BeginHorizontal();
                string v = value.Remove(value.Length - 4).Remove(0, Application.dataPath.Length + 6);
                if (GUILayout.Button(v))
                {
                    GameObject C = GameObject.Find("Camera");
                    PlayerPrefs.SetFloat("StartZoom", C.GetComponent<Camera>().orthographicSize);
                    PlayerPrefs.SetFloat("CamX", C.transform.position.x);
                    PlayerPrefs.SetFloat("CamY", C.transform.position.y);
                    PlayerPrefs.SetFloat("CamZ", C.transform.position.z);

                    PlayerPrefs.SetString("Path", v);
                    Application.LoadLevel(0);
                }
                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();
            GUILayout.EndArea();
        }
    }

19 View Source File : GUIInterfaceWorld.cs
License : MIT License
Project Creator : BelkinAndrey

void OnGUI()
    {
        GUI.skin = skin;

        GUI.Box(new Rect(0, 0, Screen.width, 30), "");

        if (GUI.Button(new Rect(0, 0, 140, 30), LogoButton))
        {
            Application.OpenURL("https://github.com/BelkinAndrey/OPENTadpole");
        }

        GUI.Label(new Rect(150, 5, 170, 30), ">> SimWorldTadpole <<");

        if (GUI.Button(new Rect(325, 0, 125, 30), " ConnectomTadpole"))
        {
            Application.LoadLevel(0);
        }

        if (GUI.Button(new Rect(Screen.width - 30, 0, 30, 30), CloseButton))
        {
            Application.Quit();
        }

        if (GUI.Button(new Rect(Screen.width - 60, 0, 30, 30), FullButton))
        {
            if (!Screen.fullScreen)
            {
                W = Screen.width;
                H = Screen.height;
                Screen.fullScreen = true;
                Screen.SetResolution(resolutions[resolutions.Length - 1].width, resolutions[resolutions.Length - 1].height, true);
            }
            else
            {
                Screen.fullScreen = false;
                Screen.SetResolution(W, H, false);
            }
        }

        GetComponent<LoadBrain>().PathFile = GUI.TextField(new Rect(Screen.width - 260, 5, 180, 20), GetComponent<LoadBrain>().PathFile);

        if (GUI.Button(new Rect(Screen.width - 80, 0, 20, 30), DownButton))
        {
            pilot = !pilot;
        }



        if (GUI.Button(new Rect(Screen.width - 320, 0, 30, 30), ReStartButton))
        {
            Application.LoadLevel(1);
        }

        if (GUI.Button(new Rect(Screen.width - 290, 0, 30, 30), OpenButton))
        {
            GetComponent<LoadBrain>().Open(); 
        }

        if (pilot)
        {
            Rect RectPilot = new Rect(Screen.width - 260, 35, 200, 200);
            OnRect = RectPilot.Contains(Event.current.mousePosition);

            GUILayout.BeginArea(RectPilot, GUI.skin.box);
            ScrollBlok = GUILayout.BeginScrollView(ScrollBlok, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));

            string[] dir = Directory.GetFiles(Application.dataPath + "/Data/", "*.tad");
            foreach (string value in dir)
            {
                GUILayout.BeginHorizontal();
                string v = value.Remove(value.Length - 4).Remove(0, Application.dataPath.Length + 6);
                if (GUILayout.Button(v))
                {
                    PlayerPrefs.SetString("Path", v);
                    Application.LoadLevel(1);
                }
                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();
            GUILayout.EndArea();
        }
    }

19 View Source File : GUIWindowEditSynapse.cs
License : MIT License
Project Creator : BelkinAndrey

void DoMyWindow(int windowID) 
    {
        if (GUI.Button(new Rect(408, 2, 18, 18), "x")) 
        {
            EnableWindows = false;
            if (GizmaSynapse != null) GizmaSynapse.SetActive(false);
            MouseWindowsExit.Invoke();
        }

        if (GetComponent<SelectionNeuron>().SelectorNeuronOne != null)
        {
            intButtonPrePost = GUI.SelectionGrid(new Rect(5, 20, 200, 20), intButtonPrePost, ButtonSPrePost, ButtonSPrePost.Length);

            GUILayout.BeginArea(new Rect(5, 42, 200, 203), GUI.skin.box);
            ScrollBlok = GUILayout.BeginScrollView(ScrollBlok, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));

            if (intButtonPrePost == 0)
            {
                List<Synapse> hit = GetComponent<SelectionNeuron>().SelectorNeuronOne.GetComponent<InspectorNeuron>().isNeuron.PreSynapses;
                for (int i = 0; i < hit.Count; i++) 
                {
                    string ButtonName = "" + (i + 1) + ". #" + hit[i].parentNeuron.IDNeuron.ToString("000000") + " >>  #" + hit[i].targetNeuron.IDNeuron.ToString("000000");
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button(ButtonName)) 
                    {
                        ButtonOn(hit[i]);
                    }
                    GUILayout.EndHorizontal();
                }
            }

            if (intButtonPrePost == 1)
            {
                List<Synapse> hit = GetComponent<SelectionNeuron>().SelectorNeuronOne.GetComponent<InspectorNeuron>().isNeuron.PostSynapses;
                for (int i = 0; i < hit.Count; i++)
                {
                    string ButtonName = "" + (i + 1) + ". #" + hit[i].parentNeuron.IDNeuron.ToString("000000") + " >>  #" + hit[i].targetNeuron.IDNeuron.ToString("000000");
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button(ButtonName))
                    {
                       ButtonOn(hit[i]);
                    }
                    GUILayout.EndHorizontal();
                }
            }

            GUILayout.EndScrollView();
            GUILayout.EndArea();

            if (EditSynanse != null)
            {
                GUI.Label(new Rect(210, 40, 100, 20), "Type");
                EditSynanse.TypeSynapse = GUI.SelectionGrid(new Rect(310, 40, 100, 20), EditSynanse.TypeSynapse, ButtonTypeS, ButtonTypeS.Length);
                GUI.Label(new Rect(210, 65, 100, 20), "Force");
                forceS = GUI.TextField(new Rect(310, 65, 100, 20), forceS);
                GUI.Label(new Rect(210, 90, 100, 20), "Delay");
                delayS = GUI.TextField(new Rect(310, 90, 100, 20), delayS);
               // GUI.Label(new Rect(210, 115, 100, 20), "descriptor");
               // descriptorS = GUI.TextField(new Rect(310, 115, 100, 20), descriptorS);
               // GUI.Label(new Rect(210, 140, 100, 20), "Freeze");
               // EditSynanse.Freeze = GUI.Toggle(new Rect(310, 140, 100, 20), EditSynanse.Freeze, "");
                GUI.Label(new Rect(210, 165, 200, 20), "Distanse = " + distanse.ToString("0.00"));
                if (GUI.Button(new Rect(260, 190, 110, 20), "Delete Synapse")) DeleteSynapse();
                if (GUI.Button(new Rect(210, 220, 100, 20), "Close"))
                {
                    EnableWindows = false;
                    if (GizmaSynapse != null) GizmaSynapse.SetActive(false);
                    MouseWindowsExit.Invoke();
                }
                if (GUI.Button(new Rect(315, 220, 100, 20), "OK")) 
                {
                    float tryFloat;
                    if (float.TryParse(forceS, out tryFloat)) EditSynanse.Force = tryFloat;
                    int tryInt;
                    if (int.TryParse(delayS, out tryInt)) EditSynanse.Delay = tryInt;
                    if (int.TryParse(descriptorS, out tryInt)) EditSynanse.descriptor = tryInt;
                }
            }
            else GUI.Label(new Rect(210, 20, 200, 20), "Not select synapse");
        }

        GUI.DragWindow(); 
    }

19 View Source File : SettingFieldDrawer.cs
License : GNU Lesser General Public License v3.0
Project Creator : BepInEx

public static void DrawCenteredLabel(string text, params GUILayoutOption[] options)
        {
            GUILayout.BeginHorizontal(options);
            GUILayout.FlexibleSpace();
            GUILayout.Label(text);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
        }

19 View Source File : SettingFieldDrawer.cs
License : GNU Lesser General Public License v3.0
Project Creator : BepInEx

private static void DrawFlagsField(SettingEntryBase setting, IList enumValues, int maxWidth)
        {
            var currentValue = Convert.ToInt64(setting.Get());
            var allValues = enumValues.Cast<Enum>().Select(x => new { name = x.ToString(), val = Convert.ToInt64(x) }).ToArray();

            // Vertically stack Horizontal groups of the options to deal with the options taking more width than is available in the window
            GUILayout.BeginVertical(GUILayout.MaxWidth(maxWidth));
            {
                for (var index = 0; index < allValues.Length;)
                {
                    GUILayout.BeginHorizontal();
                    {
                        var currentWidth = 0;
                        for (; index < allValues.Length; index++)
                        {
                            var value = allValues[index];

                            // Skip the 0 / none enum value, just uncheck everything to get 0
                            if (value.val != 0)
                            {
                                // Make sure this horizontal group doesn't extend over window width, if it does then start a new horiz group below
                                var textDimension = (int)GUI.skin.toggle.CalcSize(new GUIContent(value.name)).x;
                                currentWidth += textDimension;
                                if (currentWidth > maxWidth)
                                    break;

                                GUI.changed = false;
                                var newVal = GUILayout.Toggle((currentValue & value.val) == value.val, value.name,
                                    GUILayout.ExpandWidth(false));
                                if (GUI.changed)
                                {
                                    var newValue = newVal ? currentValue | value.val : currentValue & ~value.val;
                                    setting.Set(Enum.ToObject(setting.SettingType, newValue));
                                }
                            }
                        }
                    }
                    GUILayout.EndHorizontal();
                }

                GUI.changed = false;
            }
            GUILayout.EndVertical();
            // Make sure the reset button is properly spaced
            GUILayout.FlexibleSpace();
        }

19 View Source File : ConfigurationManager.cs
License : GNU Lesser General Public License v3.0
Project Creator : BepInEx

private void DrawTips()
        {
            GUILayout.BeginHorizontal();
            {
                GUILayout.Label("Tip: Click plugin names to expand. Click setting and group names to see their descriptions.");

                GUILayout.FlexibleSpace();

                if (GUILayout.Button(_pluginConfigCollapsedDefault.Value ? "Expand" : "Collapse", GUILayout.ExpandWidth(false)))
                {
                    var newValue = !_pluginConfigCollapsedDefault.Value;
                    _pluginConfigCollapsedDefault.Value = newValue;
                    foreach (var plugin in _filteredSetings)
                        plugin.Collapsed = newValue;
                }
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : ConfigurationManager.cs
License : GNU Lesser General Public License v3.0
Project Creator : BepInEx

private void DrawSingleSetting(SettingEntryBase setting)
        {
            GUILayout.BeginHorizontal();
            {
                try
                {
                    DrawSettingName(setting);
                    _fieldDrawer.DrawSettingValue(setting);
                    DrawDefaultButton(setting);
                }
                catch (Exception ex)
                {
                    Logger.Log(LogLevel.Error, $"Failed to draw setting {setting.DispName} - {ex}");
                    GUILayout.Label("Failed to draw this field, check log for details.");
                }
            }
            GUILayout.EndHorizontal();
        }

19 View Source File : ConfigurationManager.cs
License : GNU Lesser General Public License v3.0
Project Creator : BepInEx

private void DrawSinglePlugin(PluginSettingsData plugin)
        {
            GUILayout.BeginVertical(GUI.skin.box);

            var categoryHeader = _showDebug ?
                new GUIContent($"{plugin.Info.Name.TrimStart('!')} {plugin.Info.Version}", "GUID: " + plugin.Info.GUID) :
                new GUIContent($"{plugin.Info.Name.TrimStart('!')} {plugin.Info.Version}");

            var isSearching = !string.IsNullOrEmpty(SearchString);

            {
                var hasWebsite = plugin.Website != null;
                if (hasWebsite)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Space(29); // Same as the URL button to keep the plugin name centered
                }

                if (SettingFieldDrawer.DrawPluginHeader(categoryHeader, plugin.Collapsed && !isSearching) && !isSearching)
                    plugin.Collapsed = !plugin.Collapsed;

                if (hasWebsite)
                {
                    var origColor = GUI.color;
                    GUI.color = Color.gray;
                    if (GUILayout.Button(new GUIContent("URL", plugin.Website), GUI.skin.label, GUILayout.ExpandWidth(false)))
                        Utils.OpenWebsite(plugin.Website);
                    GUI.color = origColor;
                    GUILayout.EndHorizontal();
                }
            }

            if (isSearching || !plugin.Collapsed)
            {
                foreach (var category in plugin.Categories)
                {
                    if (!string.IsNullOrEmpty(category.Name))
                    {
                        if (plugin.Categories.Count > 1 || !_hideSingleSection.Value)
                            SettingFieldDrawer.DrawCategoryHeader(category.Name);
                    }

                    foreach (var setting in category.Settings)
                    {
                        DrawSingleSetting(setting);
                        GUILayout.Space(2);
                    }
                }
            }

            GUILayout.EndVertical();
        }

19 View Source File : About.cs
License : MIT License
Project Creator : BrunoS3D

public void OnGUI()
	{
		m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition );

		GUILayout.BeginVertical();

		GUILayout.Space( 10 );

		GUILayout.BeginHorizontal();
		GUILayout.FlexibleSpace();
		GUILayout.Box( m_aboutImage, GUIStyle.none );

		if( Event.current.type == EventType.MouseUp &&
				GUILayoutUtility.GetLastRect().Contains( Event.current.mousePosition ) )
		{
			Application.OpenURL( "http://www.amplify.pt" );
		}

		GUILayout.FlexibleSpace();
		GUILayout.EndHorizontal();

		GUIStyle labelStyle = new GUIStyle( EditorStyles.label );

		labelStyle.alignment = TextAnchor.MiddleCenter;
		labelStyle.wordWrap = true;

		GUILayout.Label( "\nAmplify Occlusion " + VersionInfo.StaticToString(), labelStyle, GUILayout.ExpandWidth( true ) );

		GUILayout.Label( "\nCopyright (c) Amplify Creations, Lda. All rights reserved.\n", labelStyle, GUILayout.ExpandWidth( true ) );

		GUILayout.EndVertical();

		GUILayout.EndScrollView();
	}

See More Examples