BS 0.2.0 Visual

This commit is contained in:
2025-07-21 15:58:52 +08:00
parent f6750189d0
commit d0e5420f95
142 changed files with 11176 additions and 11 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Convention.WindowsUI.Variant
{
public class InspectorToggle : InspectorDrawer
{
[Resources] public ModernUIToggle Toggle;
private void OnCallback(bool value)
{
targetItem.SetValue(value);
if (targetItem.target is IInspectorUpdater updater)
{
updater.OnInspectorUpdate();
}
}
private void Start()
{
Toggle.AddListener(OnCallback);
}
private void FixedUpdate()
{
if (targetItem.UpdateType)
{
Toggle.ref_value = (bool)targetItem.GetValue();
}
}
private void OnEnable()
{
Toggle.interactable = targetItem.AbleChangeType;
Toggle.ref_value = (bool)targetItem.GetValue();
}
private void Reset()
{
Toggle = GetComponent<ModernUIToggle>();
}
}
}