protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Normal Enabled", "normal", "NORMALMAP_ON", "NORMALMAP_OFF"));
     Toggles.Add(new FeatureToggle("Specular Enabled", "specular", "SPECULAR_ON", "SPECULAR_OFF"));
     Toggles.Add(new FeatureToggle("Fresnel Enabled", "fresnel", "FRESNEL_ON", "FRESNEL_OFF"));
     Toggles.Add(new FeatureToggle("Rim Light Enabled", "rim", "RIMLIGHT_ON", "RIMLIGHT_OFF"));
 }
예제 #2
0
        private void UpdateToggles()
        {
            var selectedToggle = SelectedToggle;
            var toggleFilter   = ToggleFilter;

            var allToggles = _featureToggleService.GetToggles().OrderBy(x => x).ToList();

            if (!string.IsNullOrWhiteSpace(toggleFilter))
            {
                allToggles = allToggles.Where(x => x.Name.IndexOf(toggleFilter, StringComparison.OrdinalIgnoreCase) >= 0).ToList();
            }

            using (Toggles.SuspendChangeNotifications())
            {
                Toggles.Clear();

                foreach (var toggle in allToggles)
                {
                    if (!toggle.IsHidden)
                    {
                        Toggles.Add(toggle);
                    }
                }
            }

            // restore selection
            if (selectedToggle is not null && Toggles.Any(x => string.Equals(x.Name, selectedToggle)))
            {
                SelectedToggle = selectedToggle;
            }
        }
예제 #3
0
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Emissive", "Emiss", "EMISSIVE_ENABLED", true));
     Toggles.Add(new FeatureToggle("Normal Map", "normal", "NORMAL_ENABLED", true));
     Toggles.Add(new FeatureToggle("Rim", "rim", "RIM_ENABLED", true));
     Toggles.Add(new FeatureToggle("Environ Mapping", "worldRef", "WORLDREF_ENABLED", true));
     this.AddRenderOpsToToggleList();
 }
예제 #4
0
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Outline", "outline", "OUTLINE", ""));
     Toggles.Add(new FeatureToggle("Color Palette", "palette", "PALETTE", ""));
     Toggles.Add(new FeatureToggle("Grid Snap", "grid", "GRIDSNAP", ""));
     Toggles.Add(new FeatureToggle("Alpha Threshold", "alpha", "CUTOUT", ""));
     Toggles.Add(new FeatureToggle("Pixel Snap", "pixel", "PIXELSNAP", ""));
 }
예제 #5
0
    protected override void CreateToggleList()
    {
        Toggles.Add(new FeatureToggle("Soft Dissolve Enabled", "soft_dissolve", "SOFTDISSOLVE_ON", "SOFTDISSOLVE_OFF"));
        Toggles.Add(new FeatureToggle("Opacity Slider Enabled", "opacity", "OPACITYSLIDER_ON", "OPACITYSLIDER_OFF"));

        Toggles.Add(new FeatureToggle("Soft Rim Enabled", "rim", "SOFTRIM_ON", "SOFTRIM_OFF"));
        Toggles.Add(new FeatureToggle("For_Stretch_Billboard Enabled", "stretch", "STRETCH_ON", "STRETCH_OFF"));

        Toggles.Add(new FeatureToggle("Edge Enabled", "edge", "EDGE_ON", "EDGE_OFF"));
    }
예제 #6
0
        public void Show(OnNameChangeDelegate nameChangeCallback, OnSearchDelegate searchCallback)
        {
            gameObject.SetActive(true);
            transform.SetAsLastSibling();
            NameChangeCallback = nameChangeCallback;
            SearchCallback     = searchCallback;

            stringPropertyPanel.gameObject.SetActive(false);
            integerPropertyPanel.gameObject.SetActive(false);
            enumPropertyPanel.gameObject.SetActive(false);
            for (int i = FilterPanels.Count - 1; i >= 0; i--)
            {
                Destroy(FilterPanels[i].gameObject);
                FilterPanels.RemoveAt(i);
            }
            InputFields.Clear();
            Toggles.Clear();

            nameInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); };
            InputFields.Add(nameInputField);
            idInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); };
            InputFields.Add(idInputField);
            setCodeInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); };
            InputFields.Add(setCodeInputField);

            propertyFiltersContent.sizeDelta = new Vector2(propertyFiltersContent.sizeDelta.x, PropertyPanelHeight * CardGameManager.Current.CardProperties.Count + (PropertyPanelHeight * 3));
            foreach (PropertyDef property in CardGameManager.Current.CardProperties)
            {
                GameObject newPanel;
                if (CardGameManager.Current.IsEnumProperty(property.Name))
                {
                    newPanel = CreateEnumPropertyFilterPanel(property);
                }
                else if (property.Type == PropertyType.Integer)
                {
                    newPanel = CreateIntegerPropertyFilterPanel(property.Name, property.Display);
                }
                else //if (property.Type == PropertyType.String)
                {
                    newPanel = CreateStringPropertyFilterPanel(property.Name, property.Display);
                }
                FilterPanels.Add(newPanel);
                foreach (InputField inputField in newPanel.GetComponentsInChildren <InputField>())
                {
                    inputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); };
                    InputFields.Add(inputField);
                }
                foreach (Toggle toggle in newPanel.GetComponentsInChildren <Toggle>())
                {
                    Toggles.Add(toggle);
                }
            }
        }
예제 #7
0
 // Creates and adds toggle to settings.
 internal static void Add(string label, string root, string group)
 {
     if (!Exists(label))
     {
         Toggle toggle = new Toggle(
             label: label,
             root: root,
             group: group
             );
         Toggles.Add(toggle);
         ToggleActive.Add(label, toggle);
     }
 }
예제 #8
0
 internal void RegisterCount(string toggleName, bool active)
 {
     if (Toggles.ContainsKey(toggleName))
     {
         Toggles[toggleName].Register(active);
     }
     else
     {
         var counter = new ToggleCount();
         counter.Register(active);
         Toggles.Add(toggleName, counter);
     }
 }
예제 #9
0
        public void AddPropertyPanel(PropertyDef forProperty, string propertyName)
        {
            if (forProperty == null || string.IsNullOrEmpty(propertyName))
            {
                Debug.LogWarning("AddPropertyPanel::NullPropertyOrName");
                return;
            }

            if (forProperty.Type == PropertyType.Object || forProperty.Type == PropertyType.ObjectList)
            {
                foreach (PropertyDef childProperty in forProperty.Properties)
                {
                    AddPropertyPanel(childProperty, propertyName + PropertyDef.ObjectDelimiter + childProperty.Name);
                }
                return;
            }

            GameObject newPanel;

            if (CardGameManager.Current.IsEnumProperty(propertyName))
            {
                newPanel = CreateEnumPropertyFilterPanel(propertyName, forProperty);
            }
            else if (forProperty.Type == PropertyType.Boolean)
            {
                newPanel = CreateBooleanPropertyFilterPanel(propertyName, forProperty.Display);
            }
            else if (forProperty.Type == PropertyType.Integer)
            {
                newPanel = CreateIntegerPropertyFilterPanel(propertyName, forProperty.Display);
            }
            else //if (property.Type == PropertyType.String)
            {
                newPanel = CreateStringPropertyFilterPanel(propertyName, forProperty.Display);
            }
            FilterPanels.Add(newPanel);
            foreach (InputField inputField in newPanel.GetComponentsInChildren <InputField>())
            {
                inputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); };
                InputFields.Add(inputField);
            }
            foreach (Toggle toggle in newPanel.GetComponentsInChildren <Toggle>())
            {
                Toggles.Add(toggle);
            }
        }
예제 #10
0
        protected override void OnPropertiesSet()
        {
            base.OnPropertiesSet();
            foreach (var toggle in Toggles)
            {
                Destroy(toggle.UIToggle.gameObject);
            }
            Toggles.Clear();

            foreach (var toggleProperties in Properties.GetToggleProperties())
            {
                var toggle = Instantiate(togglePrefab.UIToggle.gameObject, toggleContainer).GetComponent <TToggleController>();
                toggle.UIToggle.transform.SetParent(toggleContainer, false);
                toggle.UIToggle.Toggle.group = toggleGroup;
                toggle.ValueChanged         += (x, value) => Toggle_ValueChanged(toggle, value);
                toggle.SetProperties(toggleProperties);
                toggle.ToggleInteractability(IsInteractable);
                InitializeToggle(toggle);
                Toggles.Add(toggle);
            }
        }
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Normal Enabled", "normal", "NORMALMAP_ON", "NORMALMAP_OFF"));
 }
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Spec Controls", "SpecCont", "SPEC_CONTROL_MAPS_ENABLED", true));
     base.CreateToggleList();
 }
예제 #13
0
//	public override void OnInspectorGUI ()
//	{
//		base.OnInspectorGUI ();
//
//		if (!isVisible)
//		{
//			Debug.Log("not visible");
//			return;
//		}
//
//		Material targetMat = target as Material;
//		string[] keyWords = targetMat.shaderKeywords;
//
//		bool specularReflectionEnabled = keyWords.Contains ("SPECULAR_REFLECTION_ON");
//		EditorGUI.BeginChangeCheck();
//
//		specularReflectionEnabled = EditorGUILayout.Toggle ("Specular Reflection Enabled", specularReflectionEnabled);
//
//		if (EditorGUI.EndChangeCheck())
//		{
//			//If enabled, add keyword SPECULAR_REFLECTION_ON, otherwise add SPECULAR_REFLECTION_OFF
//			List<string> keywords = new List<string> { specularReflectionEnabled? "SPECULAR_REFLECTION_ON" : "SPECULAR_REFLECTION_OFF"};
//			targetMat.shaderKeywords = keywords.ToArray();
//			EditorUtility.SetDirty (targetMat);
//		}
//	}
    protected override void CreateToggleList()
    {
        Toggles.Add(new FeatureToggle("Specular Reflection Enabled", "reflection", "SPECULAR_REFLECTION_ON", "SPECULAR_REFLECTION_OFF"));
    }
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Color Enabled", "color", "COLOR_ON", "COLOR_OFF"));
     Toggles.Add(new FeatureToggle("Slice Enabled", "slice", "SLICE_ON", "SLICE_OFF"));
     Toggles.Add(new FeatureToggle("Burn Enabled", "burn", "BURN_ON", "BURN_OFF"));
 }
 public void AddToggle(Func <IInvokeHandlerContext, bool> toggle) => Toggles.Add(toggle);
예제 #16
0
 protected override void CreateToggleList()
 {
     Toggles.Add(new FeatureToggle("Dissolve Enabled", "Dissolve", "DISSOVLE_ON", "DISSOVLE_OFF"));
     Toggles.Add(new FeatureToggle("Mask Enabled", "Mask", "MASK_ON", "MASK_OFF"));
 }