NG_/Scripts/3D/摄像机/ZhengJiaoCamera.cs
2024-12-13 18:49:44 +08:00

35 lines
1005 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ZhengJiaoCamera : MonoBehaviour,IPointerClickHandler
{
public List<GameObject> ShowGameObjectParents;
public List<GameObject> showGameObject;
public List<GameObject> hideGameObject;
public void OnPointerClick(PointerEventData eventData)
{
if (!CameraMove.isStaticMove)
{
for (int i = 0; i < ShowGameObjectParents.Count; i++)
{
foreach (Transform child in ShowGameObjectParents[i].transform)
{
child.gameObject.SetActive(true);
}
}
for (int i = 0; i < showGameObject.Count; i++)
{
showGameObject[i].SetActive(true);
}
for (int i = 0; i < hideGameObject.Count; i++)
{
hideGameObject[i].SetActive(false);
}
}
}
}