디자인 적용

This commit is contained in:
logonkhi
2025-08-07 21:12:44 +09:00
parent 2e4718291e
commit 3297a5d1f3
139 changed files with 35760 additions and 736 deletions

View File

@@ -0,0 +1,24 @@
namespace Gpm.Ui.Sample
{
using UnityEngine;
using UnityEngine.UI;
public class ContentSizeSetterSample : MonoBehaviour
{
public Entity entry;
public InputField input;
public RectTransform root;
public void AddEntity(RectTransform parent)
{
if (parent == null)
{
parent = root;
}
Entity add = GameObject.Instantiate<Entity>(entry, parent);
add.Init(input.text, this);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: dd7403b4893f5ba4c8de2d1cd1dc3870

View File

@@ -0,0 +1,65 @@
namespace Gpm.Ui.Sample
{
using UnityEngine;
using UnityEngine.UI;
public class Entity : MonoBehaviour
{
public ContentSizeSetterSample control;
public Text valueText;
public Text childExpand;
public GameObject childContainer;
public RectTransform childRoot;
public void Init(string text, ContentSizeSetterSample control)
{
this.valueText.text = text;
this.control = control;
}
public void OnEnable()
{
SetExpandText();
}
public void ChildToggle()
{
childContainer.SetActive(childContainer.activeSelf == false);
SetExpandText();
}
private void SetExpandText()
{
if(childRoot.childCount > 0)
{
if (childContainer.activeSelf == true)
{
childExpand.text = "-";
}
else
{
childExpand.text = "+";
}
}
else
{
childExpand.text = string.Empty;
}
}
public void AddChild()
{
control.AddEntity(childRoot);
childContainer.SetActive(true);
SetExpandText();
}
public void Delete()
{
GameObject.Destroy(gameObject);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 73ec133407840524993759764953e6a9