Added Checkbox Parameter + Toggle Inputs Event

So now you can disable inputs if you need to :)
This commit is contained in:
Carson Kompon
2022-03-01 02:27:49 -05:00
parent daf19fae54
commit 687f2b53f4
8 changed files with 42 additions and 8 deletions

View File

@ -15,6 +15,7 @@ namespace RhythmHeavenMania.Editor
[Header("Property Prefabs")]
[SerializeField] private GameObject IntegerP;
[SerializeField] private GameObject FloatP;
[SerializeField] private GameObject BooleanP;
[SerializeField] private GameObject DropdownP;
[SerializeField] private GameObject ColorP;
@ -106,6 +107,10 @@ namespace RhythmHeavenMania.Editor
{
prefab = FloatP;
}
else if(type is bool)
{
prefab = BooleanP;
}
else if (objType.IsEnum)
{
prefab = DropdownP;

View File

@ -21,6 +21,10 @@ namespace RhythmHeavenMania.Editor
public Slider slider;
public TMP_InputField inputField;
[Header("Boolean")]
[Space(10)]
public Toggle toggle;
[Header("Dropdown")]
[Space(10)]
public TMP_Dropdown dropdown;
@ -86,6 +90,15 @@ namespace RhythmHeavenMania.Editor
parameterManager.entity[propertyName] = slider.value;
});
}
else if(type is bool)
{
toggle.isOn = (bool)type;
toggle.onValueChanged.AddListener(delegate
{
parameterManager.entity[propertyName] = toggle.isOn;
});
}
else if (objType.IsEnum)
{
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();