예제 #1
0
        public PrefabType AddPrefs <ValType, PrefabType>(Prefs.PrefsValueBase <ValType> prefs) where PrefabType : InputGuiValueBase <ValType>
        {
            var category = this.structs.GetCategory(prefs.GuiHierarchy);
            var gui      = this.creator.GetGui <ValType, PrefabType>(prefs, category);

            return(gui);
        }
예제 #2
0
            public PrefabType GetGui <ValType, PrefabType>(Prefs.PrefsValueBase <ValType> prefs, Category category) where PrefabType : InputGuiValueBase <ValType>
            {
                var gui = Instantiate(this.canvas.prefabs.GetGuiPrefab <PrefabType>(), category.Content);

                this.SetGuiListeners(prefs, gui);
                category.Prefs.Add(prefs, gui);

                return(gui);
            }
예제 #3
0
 public virtual void SetGuiListeners(Prefs.PrefsValueBase <ValType> prefs, bool withoutInitialize = true)
 {
     this.SetListener(prefs, withoutInitialize);
     this.OnValueChanged += () => prefs.Set(this.GetValue());
 }
예제 #4
0
 private void SetGuiListeners <ValType, PrefabType>(Prefs.PrefsValueBase <ValType> prefs, PrefabType gui) where PrefabType : InputGuiValueBase <ValType>
 {
     gui.SetGuiListeners(prefs);
     prefs.OnValueChanged += () => gui.SetValue(prefs.Value);
 }