Fix event property dropdown

This commit is contained in:
Braedon
2022-02-06 04:28:32 -05:00
parent 3a76cac069
commit 57b14c3f3e
3 changed files with 16 additions and 3 deletions

View File

@ -21,6 +21,8 @@ namespace RhythmHeavenMania.Editor
private bool active;
private int childCountAtStart;
public static EventParameterManager instance { get; set; }
private void Awake()
@ -28,6 +30,11 @@ namespace RhythmHeavenMania.Editor
instance = this;
}
private void Start()
{
childCountAtStart = transform.childCount;
}
private void Update()
{
if (Input.GetMouseButtonDown(0))
@ -113,7 +120,7 @@ namespace RhythmHeavenMania.Editor
private void DestroyParams()
{
active = false;
for (int i = 2; i < transform.childCount; i++)
for (int i = childCountAtStart; i < transform.childCount; i++)
{
Destroy(transform.GetChild(i).gameObject);
}

View File

@ -48,6 +48,12 @@ namespace RhythmHeavenMania.Editor
inputField.text = slider.value.ToString();
parameterManager.entity[propertyName] = (int)slider.value;
});
inputField.onEndEdit.AddListener(delegate
{
slider.value = Mathf.RoundToInt(System.Convert.ToSingle(System.Convert.ToSingle(inputField.text)));
parameterManager.entity[propertyName] = (int)slider.value;
});
}
else if (objType == typeof(EntityTypes.Float))
{