备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user