alright, looks like that's all the bugs gone
This commit is contained in:
parent
82fa8ed1d8
commit
2dc7678d8c
|
|
@ -97,7 +97,14 @@ namespace HeavenStudio.Editor
|
|||
eventSelector.SetActive(false);
|
||||
this.entity = entity;
|
||||
|
||||
string col = EditorTheme.theme.properties.LayerColors[(int)entity["track"]];
|
||||
string col = (int)entity["track"] switch
|
||||
{
|
||||
1 => EditorTheme.theme.properties.Layer2Col,
|
||||
2 => EditorTheme.theme.properties.Layer3Col,
|
||||
3 => EditorTheme.theme.properties.Layer4Col,
|
||||
4 => EditorTheme.theme.properties.Layer5Col,
|
||||
_ => EditorTheme.theme.properties.Layer1Col
|
||||
};
|
||||
Editor.instance.SetGameEventTitle($"Properties for <color=#{col}>{action.displayName}</color> on Beat {entity.beat.ToString("F2")} on <color=#{col}>Track {(int)entity["track"] + 1}</color>");
|
||||
|
||||
DestroyParams();
|
||||
|
|
@ -138,7 +145,6 @@ namespace HeavenStudio.Editor
|
|||
Debug.LogError("Can't make property interface of type: " + typeType);
|
||||
return null;
|
||||
}
|
||||
print(propertyPrefab.name);
|
||||
|
||||
GameObject input = Instantiate(propertyPrefab, transform);
|
||||
input.SetActive(true);
|
||||
|
|
|
|||
|
|
@ -892,7 +892,7 @@ namespace HeavenStudio.Editor.Track
|
|||
EntityTypes.Integer intVal => intVal.val,
|
||||
EntityTypes.Float floatVal => floatVal.val,
|
||||
EntityTypes.Button buttonVal => buttonVal.defaultLabel,
|
||||
EntityTypes.Dropdown ddVal => new EntityTypes.DropdownObj(ddVal.defaultValue, ddVal.values),
|
||||
EntityTypes.Dropdown ddVal => new EntityTypes.DropdownObj(ddVal),
|
||||
_ => ep[i].parameter,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine.Assertions.Must;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace HeavenStudio
|
||||
{
|
||||
|
|
@ -266,6 +267,13 @@ namespace HeavenStudio
|
|||
e.dynamicData[param.propertyName] = (int)e[param.propertyName];
|
||||
else if (type == typeof(EntityTypes.Float))
|
||||
e.dynamicData[param.propertyName] = (float)e[param.propertyName];
|
||||
else if (type == typeof(EntityTypes.Button))
|
||||
e.dynamicData[param.propertyName] = (string)e[param.propertyName];
|
||||
else if (type == typeof(EntityTypes.Dropdown)) {
|
||||
JValue value = e[param.propertyName]["value"];
|
||||
JArray values = e[param.propertyName]["Values"];
|
||||
e.dynamicData[param.propertyName] = new EntityTypes.DropdownObj((int)value, values.Select(x => (string)x).ToList());
|
||||
}
|
||||
else if (type == typeof(EntityTypes.Resource))
|
||||
e.dynamicData[param.propertyName] = (EntityTypes.Resource)e[param.propertyName];
|
||||
else if (type.IsEnum)
|
||||
|
|
|
|||
|
|
@ -105,6 +105,14 @@ namespace HeavenStudio
|
|||
|
||||
onValueChanged = null;
|
||||
}
|
||||
|
||||
public DropdownObj(Dropdown dd)
|
||||
{
|
||||
value = dd.defaultValue;
|
||||
Values = dd.values ?? new();
|
||||
|
||||
onValueChanged = null;
|
||||
}
|
||||
}
|
||||
|
||||
public struct Resource
|
||||
|
|
|
|||
Loading…
Reference in a new issue