headers and subheaders

This commit is contained in:
minenice55
2022-09-03 22:29:50 -04:00
parent 7084d96cc1
commit cb2b5707e9
3 changed files with 432 additions and 26 deletions

View File

@ -66,13 +66,13 @@ namespace HeavenStudio.Editor
{
infoContainer.AddDivider(this);
}
else if (property.tag == "heading")
else if (property.tag == "header")
{
infoContainer.AddDivider(this);
infoContainer.AddHeader(this, property.label);
}
else if (property.tag == "subheading")
else if (property.tag == "subheader")
{
infoContainer.AddDivider(this);
infoContainer.AddSubHeader(this, property.label);
}
else
{

View File

@ -20,6 +20,8 @@ namespace HeavenStudio.Editor
[Header("Layout Prefabs")]
[SerializeField] private GameObject DividerP;
[SerializeField] private GameObject HeaderP;
[SerializeField] private GameObject SubHeaderP;
public void Init(RemixPropertiesDialog diag)
{
@ -84,10 +86,21 @@ namespace HeavenStudio.Editor
public void AddDivider(RemixPropertiesDialog diag)
{
GameObject prefab = DividerP;
InitPrefab(prefab);
InitPrefab(DividerP);
}
public void AddHeader(RemixPropertiesDialog diag, string text)
{
var input = InitPrefab(HeaderP);
input.GetComponent<RemixPropertyPrefab>().InitProperties(diag, "", text);
}
public void AddSubHeader(RemixPropertiesDialog diag, string text)
{
var input = InitPrefab(SubHeaderP);
input.GetComponent<RemixPropertyPrefab>().InitProperties(diag, "", text);
}
private GameObject InitPrefab(GameObject prefab, string tooltip = "")
{
GameObject input = Instantiate(prefab);