예제 #1
0
    public static void LayoutToggles()
    {
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        GUILayout.BeginVertical();
        for (int i = 0; i < refGroups.Count; i++)
        {
            GUILayout.BeginHorizontal();

            RefPointGroup group       = refGroups[i];
            bool          isActiveOld = IsActive(group);
            bool          isActive    = EditorGUILayout.ToggleLeft("", isActiveOld, GUILayout.Width(20));
            if (isActive != isActiveOld)
            {
                SetActive(group, isActive);
            }
            GUI.color = group.color;
            EditorGUILayout.LabelField(group.type.ToString() + " ", GUILayout.Width(60));
            foreach (RefPointType type in group.pairs)
            {
                EditorGUILayout.LabelField(type.ToString() + " ", GUILayout.Width(60));
            }
            GUI.color = Color.white;

            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
    }
예제 #2
0
 public static bool IsActive(RefPointGroup group)
 {
     return(EditorPrefs.GetBool(string.Format("RefPoint_{0}_active", group.type), true));
 }
예제 #3
0
 public static void SetActive(RefPointGroup group, bool active)
 {
     EditorPrefs.SetBool(string.Format("RefPoint_{0}_active", group.type), active);
 }