Ejemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="hierarchy">Hierarchy of GUI.</param>
        /// <param name="sortOrders">Sort order for GUI hierarchy from root.</param>
        /// <param name="parent">Parent in GUI.</param>
        public GuiHierarchy(string hierarchy, int[] sortOrders, GuiHierarchy parent = null)
        {
            this.parent     = parent;
            this.sortOrders = (sortOrders == null || sortOrders.Length <= 0) ? new int[] { DefaultSortOrder } : sortOrders;

            this.hierarchy = (hierarchy.TrimEnd(HierarchySeparator) + HierarchySeparator).TrimStart(HierarchySeparator);
        }
Ejemplo n.º 2
0
 public PrefsFloatSlider(string key, float minValue, float maxValue,
                         float defaultValue = default(float), GuiHierarchy hierarchy = null, string guiLabel = "")
     : this(key, defaultValue, hierarchy, guiLabel)
 {
     this.min = minValue;
     this.max = maxValue;
 }
Ejemplo n.º 3
0
 public PrefsFloatSlider(string key, float minValue, float maxValue,
                         float defaultValue = default(float), GuiHierarchy hierarchy = null, string guiLabel = null,
                         Action <Prefs.PrefsGuiBaseConnector <float, PrefsGuiNumericSliderDecimal> > onCreatedGui = null)
     : this(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
     this.min = minValue;
     this.max = maxValue;
 }
Ejemplo n.º 4
0
 public PrefsIntSlider(string key, int minValue, int maxValue,
                       int defaultValue = default(int), GuiHierarchy hierarchy = null, string guiLabel = null,
                       Action <Prefs.PrefsGuiBaseConnector <int, PrefsGuiNumericSliderInteger> > onCreatedGui = null)
     : this(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
     this.min = minValue;
     this.max = maxValue;
 }
Ejemplo n.º 5
0
            public PrefsBase(string key, GuiHierarchy hierarchy = null, string guiLabel = "")
            {
                this.key       = key;
                this.hierarchy = hierarchy;
                this.guiLabel  = string.IsNullOrEmpty(guiLabel) == true?key.ToLabelable() : guiLabel;

                this.Register();
            }
Ejemplo n.º 6
0
            public PrefsBase(string key, GuiHierarchy hierarchy = null, string guiLabel = null)
            {
                this.key       = key;
                this.hierarchy = hierarchy;
                this.guiLabel  = guiLabel ?? key.ToLabelable();

                this.Unsave = false;
                this.Regist();
            }
Ejemplo n.º 7
0
        private List <GuiHierarchy> GetParents()
        {
            var parents = new List <GuiHierarchy>();
            var parent  = this.Parent;

            while (parent != null)
            {
                parents.Insert(0, parent);
                parent = parent.Parent;
            }

            return(parents);
        }
Ejemplo n.º 8
0
        public PrefsEnum(string key, T defaultValue = default(T), GuiHierarchy hierarchy = null, string guiLabel = "")
            : base(key, 0, hierarchy, guiLabel)
        {
            var type = typeof(T);

            if (type.IsEnum == false)
            {
                throw new ArgumentException(nameof(T) + " must be an enumerated type");
            }

            this.enumType     = type;
            this.defaultValue = Convert.ToInt32(defaultValue);
        }
Ejemplo n.º 9
0
        public PrefsEnum(string key, T defaultValue = default(T), GuiHierarchy hierarchy = null,
                         string guiLabel            = null, Action <Prefs.PrefsGuiBaseConnector <int, PrefsGuiEnum> > onCreatedGui = null)
            : base(key, 0, hierarchy, guiLabel, onCreatedGui)
        {
            var type = typeof(T);

            if (type.IsEnum == false)
            {
                throw new ArgumentException(nameof(T) + " must be an enumerated type");
            }

            this.enumType     = type;
            this.defaultValue = Convert.ToInt32(defaultValue);
        }
Ejemplo n.º 10
0
 public PrefsColor(string key, Color defaultValue = default(Color), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 11
0
 public static void RemoveGuiHierarchy(GuiHierarchy hierarchy)
 => PrefsGuis?.RemoveCategory(hierarchy);
Ejemplo n.º 12
0
 public PrefsIntSlider(string key, int defaultValue = default(int), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 13
0
 public PrefsExtends(string key, ValType defaultValue = default(ValType), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
     ;
 }
Ejemplo n.º 14
0
 public PrefsString(string key, string defaultValue = "", GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 15
0
 public PrefsFloat(string key, float defaultValue = default(float), GuiHierarchy hierarchy = null,
                   string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <float, PrefsGuiNumericDecimal> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 16
0
 public PrefsVector3(string key, Vector3 defaultValue = default(Vector3), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 17
0
 public PrefsButton(string key, UnityAction action, GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, action ?? delegate { }, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 18
0
 public PrefsGuiConnector(string key, ValType defaultValue = default(ValType), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 19
0
 public PrefsBool(string key, bool defaultValue = default(bool), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 20
0
 public PrefsInt(string key, int defaultValue = default(int), GuiHierarchy hierarchy = null,
                 string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <int, PrefsGuiNumericInteger> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 21
0
 public PrefsString(string key, string defaultValue = "", GuiHierarchy hierarchy = null,
                    string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <string, PrefsGuiString> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 22
0
 public PrefsRect(string key, Rect defaultValue = default(Rect), GuiHierarchy hierarchy = null,
                  string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <Rect, PrefsGuiRect> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 23
0
 public PrefsValueBase(string key, ValType defaultValue = default(ValType), GuiHierarchy hierarchy = null, string guiLabel = null)
     : base(key, hierarchy, guiLabel)
 {
     this.value        = defaultValue;
     this.defaultValue = defaultValue;
 }
Ejemplo n.º 24
0
 public PrefsColorSlider(string key, Color defaultValue = default(Color), GuiHierarchy hierarchy = null,
                         string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <Color, PrefsGuiColorSlider> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 25
0
 public PrefsGuiConnector(string key, ValType defaultValue = default(ValType),
                          GuiHierarchy hierarchy           = null, string guiLabel = null, Action <PrefsGuiBaseConnector <ValType, GuiType> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="hierarchy">Hierarchy of GUI.</param>
 /// <param name="sortOrder">Sort order for GUI hierarchy</param>
 /// <param name="parent">Parent in GUI.</param>
 public GuiHierarchy(string hierarchy, int sortOrder = DefaultSortOrder, GuiHierarchy parent = null)
     : this(hierarchy, new int[] { sortOrder }, parent)
 {
     ;
 }
Ejemplo n.º 27
0
 public PrefsFloatSlider(string key, float defaultValue = default(float), GuiHierarchy hierarchy = null, string guiLabel = "")
     : base(key, defaultValue, hierarchy, guiLabel)
 {
 }
Ejemplo n.º 28
0
 public PrefsButton(string key, UnityAction action, GuiHierarchy hierarchy = null,
                    string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <UnityAction, GuiButton> > onCreatedGui = null)
     : base(key, action ?? delegate { }, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 29
0
 public PrefsVector2Int(string key, Vector2Int defaultValue = default(Vector2Int), GuiHierarchy hierarchy = null,
                        string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <Vector2Int, PrefsGuiVector2Int> > onCreatedGui = null)
     : base(key, defaultValue, hierarchy, guiLabel, onCreatedGui)
 {
 }
Ejemplo n.º 30
0
 public PrefsLabel(string key, string text, GuiHierarchy hierarchy = null,
                   string guiLabel = null, Action <Prefs.PrefsGuiBaseConnector <string, PrefsGuiLabel> > onCreatedGui = null)
     : base(key, text ?? "", hierarchy, guiLabel, onCreatedGui)
 {
 }