38 lines
891 B
C#
38 lines
891 B
C#
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using Unity.VisualScripting;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.EventSystems;
|
||
|
|
|
||
|
|
public class HiddenView : MonoBehaviour,IPointerClickHandler
|
||
|
|
{
|
||
|
|
public List<GameObject> hideObjects;
|
||
|
|
public GameObject hideObjectParent;
|
||
|
|
public List<GameObject> showObjects;
|
||
|
|
|
||
|
|
|
||
|
|
public void OnPointerClick(PointerEventData eventData)
|
||
|
|
{
|
||
|
|
if (CameraMove.isStaticMove)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
foreach (GameObject obj in hideObjects)
|
||
|
|
{
|
||
|
|
obj.SetActive(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (hideObjectParent != null)
|
||
|
|
{
|
||
|
|
foreach (Transform child in hideObjectParent.transform)
|
||
|
|
{
|
||
|
|
child.gameObject.SetActive(false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
foreach (GameObject obj in showObjects)
|
||
|
|
{
|
||
|
|
obj.SetActive(true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|