47 lines
1.0 KiB
C#
47 lines
1.0 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class wuniusj : MonoBehaviour
|
|||
|
{
|
|||
|
Transform[] allChildren;
|
|||
|
// Start is called before the first frame update
|
|||
|
void Start()
|
|||
|
{
|
|||
|
Transform[] allChildren = GetComponentsInChildren<Transform>();
|
|||
|
}
|
|||
|
public void yingchang()
|
|||
|
{
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡÿ<D3A1><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
foreach (Transform child in allChildren)
|
|||
|
{
|
|||
|
if (child != transform) // <20>ų<EFBFBD><C5B3><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>屾<EFBFBD><E5B1BE>
|
|||
|
{
|
|||
|
child.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
public void show()
|
|||
|
{
|
|||
|
yingchang();
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡÿ<D3A1><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
foreach (Transform child in allChildren)
|
|||
|
{
|
|||
|
if (child != transform) // <20>ų<EFBFBD><C5B3><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>屾<EFBFBD><E5B1BE>
|
|||
|
{
|
|||
|
if (Random.Range(0,10) > 5)
|
|||
|
{
|
|||
|
child.gameObject.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|