UnityEngine.GUILayout.Toggle C# (CSharp) Method

Toggle() public static method

public static Toggle ( bool value, GUIContent content ) : bool
value bool
content GUIContent
return bool
        public static bool Toggle (bool value, GUIContent content, params GUILayoutOption[] options) { return true; }
        public static bool Toggle (bool value, Texture image, GUIStyle style, params GUILayoutOption[] options) { return true; }

Same methods

GUILayout::Toggle ( bool value, GUIContent content, GUIStyle style ) : bool
GUILayout::Toggle ( bool value, Texture image ) : bool
GUILayout::Toggle ( bool value, Texture image, GUIStyle style ) : bool
GUILayout::Toggle ( bool value, string text ) : bool
GUILayout::Toggle ( bool value, string text, GUIStyle style ) : bool

Usage Example

コード例 #1
0
ファイル: InspectorSearch.cs プロジェクト: patel22p/dorumon
    protected virtual void OnGUI()
    {
        if (!SetPivot && Selection.activeGameObject)
        {
            oldpos = Selection.activeGameObject.transform.position;
        }
        GUI.BeginHorizontal();
        SetPivot = (GUI.Toggle(SetPivot, "Pivot", GUI.ExpandWidth(false)) && Selection.activeGameObject != null);

        var old = SetCam;

        SetCam = (GUI.Toggle(SetCam && Camera.main != null, "Cam", GUI.ExpandHeight(false))); //camset

        if (SetCam != old && SetCam == false)
        {
            ResetCam();
        }
        if (GUI.Button("Apply"))
        {
            ApplyAll();
        }
        if (GUI.Button("Add"))
        {
            if (!instances.Contains(Selection.activeObject.name))
            {
                instances.Add(Selection.activeObject.name);
                SaveParams();
            }
        }
        GUI.EndHorizontal();
        DrawObjects();
        DrawSearch();
    }
All Usage Examples Of UnityEngine.GUILayout::Toggle