Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
namespace Michsky.MUIP
{
[RequireComponent(typeof(Toggle))]
[RequireComponent(typeof(Animator))]
public class CustomToggle : MonoBehaviour
{
[HideInInspector] public Toggle toggleObject;
[HideInInspector] public Animator toggleAnimator;
[Header("Settings")]
public bool invokeOnAwake;
bool isInitialized = false;
void Awake()
{
if (toggleObject == null) { toggleObject = gameObject.GetComponent<Toggle>(); }
if (toggleAnimator == null) { toggleAnimator = toggleObject.GetComponent<Animator>(); }
if (invokeOnAwake == true) { toggleObject.onValueChanged.Invoke(toggleObject.isOn); }
toggleObject.onValueChanged.AddListener(UpdateState);
UpdateState();
isInitialized = true;
}
void OnEnable()
{
if (isInitialized == false)
return;
UpdateState();
}
public void UpdateState()
{
if (gameObject.activeInHierarchy == true)
{
StopCoroutine("DisableAnimator");
StartCoroutine("DisableAnimator");
}
toggleAnimator.enabled = true;
if (toggleObject.isOn) { toggleAnimator.Play("On Instant"); }
else { toggleAnimator.Play("Off Instant"); }
}
public void UpdateState(bool value)
{
if (gameObject.activeInHierarchy == true)
{
StopCoroutine("DisableAnimator");
StartCoroutine("DisableAnimator");
}
toggleAnimator.enabled = true;
if (toggleObject.isOn) { toggleAnimator.Play("Toggle On"); }
else { toggleAnimator.Play("Toggle Off"); }
}
IEnumerator DisableAnimator()
{
yield return new WaitForSecondsRealtime(0.6f);
toggleAnimator.enabled = false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa5100cea443dc7448b10a5f20698420
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: b0f85f7da5042c0448a526d5ecacbfa9, type: 3}
userData:
assetBundleName:
assetBundleVariant: