_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/wuniusj.cs

47 lines
1.0 KiB
C#
Raw Normal View History

2024-11-16 05:56:57 +08:00
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()
{
}
}