This commit is contained in:
2025-11-14 18:44:06 +08:00
parent 10156da245
commit 22e867d077
7013 changed files with 2572882 additions and 1804 deletions

View File

@@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
public class BF_SnowSubShowcase : MonoBehaviour
{
public BF_SnowAssetManager aM;
public Text uiText;
public List<GameObject> subShowcases;
public List<string> nameSubs;
private int oldIndex = -1;
private UnityAction showcaseChange;
// Start is called before the first frame update
private void OnEnable()
{
aM.maxSubIndex = subShowcases.Count-1;
aM.m_ShowcaseChange.AddListener(ChangeIndex);
}
private void OnDisable()
{
aM.m_ShowcaseChange.RemoveListener(ChangeIndex);
}
void Update()
{
/*
if(aM.subShowcaseIndex != oldIndex)
{
oldIndex = aM.subShowcaseIndex;
foreach(GameObject GO in subShowcases)
{
GO.SetActive(false);
}
subShowcases[oldIndex].SetActive(true);
uiText.text = nameSubs[oldIndex];
}
*/
}
private void ChangeIndex()
{
oldIndex = aM.subShowcaseIndex;
foreach (GameObject GO in subShowcases)
{
GO.SetActive(false);
}
subShowcases[oldIndex].SetActive(true);
uiText.text = nameSubs[oldIndex];
}
}