Files
back_cantanBuilding/Assets/Scripts/GampPlay/ChallengeMatch/ChallengeMatchSceneUIRegion.cs
2026-05-26 16:15:54 +08:00

56 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
public class ChallengeMatchSceneUIRegion : MonoBehaviour
{
public List<Transform> posTran;
public List<RectTransform> posTranRect;
public Transform myself;
public RectTransform myselfRect;
public string myJumpAudioName;
public string followerJumpAudioName;
public string fallAudioName;
private void Reset()
{
Init();
}
//private void Awake()
//{
//}
void Init()
{
myself = transform.Find("myself");
var re = transform.Find("myself (1)");
if (re)
{
myselfRect = re.GetComponent<RectTransform>();
}
int count = transform.childCount;
Transform pos;
Transform posRect;
for (int i = 1; i < count; i++)
{
pos = transform.Find(i.ToString());
posRect = transform.Find(i.ToString() + " (1)");
if (posRect != null)
{
posTranRect.Add(posRect.GetComponent<RectTransform>());
}
if (pos != null)
{
posTran.Add(pos);
}
else
{
break;
}
}
}
}