2026-04-22 모듈러 에셋 포함

This commit is contained in:
2026-04-22 10:25:40 +09:00
parent abaf994ebf
commit 7bdb7b7cd1
2466 changed files with 208897 additions and 4 deletions

View File

@@ -0,0 +1,46 @@
// Magica Cloth 2.
// Copyright (c) 2023 MagicaSoft.
// https://magicasoft.jp
using UnityEngine;
using UnityEngine.UI;
namespace MagicaCloth2
{
public class SliderText : MonoBehaviour
{
[SerializeField]
private Text text = null;
[SerializeField]
private string lable = "";
[SerializeField]
private string format = "0.00";
private string formatString;
protected void Start()
{
formatString = "{0} ({1:" + format + "})";
var slider = GetComponent<Slider>();
if (slider)
{
slider.onValueChanged.AddListener(OnChangeValue);
var val = slider.value;
slider.value = 0.001f;
slider.value = val;
}
}
private void OnChangeValue(float value)
{
if (text)
{
text.text = string.Format(formatString, lable, value);
}
}
}
}