备份CatanBuilding瘦身独立工程

This commit is contained in:
JSD\13999
2026-05-26 16:15:54 +08:00
commit 2d0e6a61b7
12001 changed files with 2431925 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using asap.core;
using Game;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.UI;
[RequireComponent(typeof(Toggle))]
[AddComponentMenu("UGUI/UI/UIToggleSound")]
public class UIToggleSound : MonoBehaviour
{
public AssetReferenceT<AudioClip> assetReference;
public float startTimer = 0f;
public bool isOn = true;
void Start()
{
var btn = gameObject.GetComponent<Toggle>();
if (null != btn)
{
btn.onValueChanged.AddListener(OnClick);
}
}
public void OnClick(bool isOn)
{
if (isOn != this.isOn)
{
return;
}
if (assetReference != null && assetReference.RuntimeKeyIsValid())
{
GContext.Publish(new AssetReferenceAudioClip(assetReference, time: startTimer));
}
}
}