Project_WL/Assets/Script/Ingame/ControlSpecificContent.cs

44 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-12-15 01:39:39 +00:00
using UnityEngine;
using UnityEngine.AI;
public class ControlSpecificContent : MyCoroutine
{
public eCommon StisfyCondition;
public string NotOpenMsg;
public GameObject[] gos;
bool isOpen;
float msgTime;
private void Awake()
{
var sdata = ServerInfo.Ins.m_ServerData;
isOpen = sdata.Get_Common(StisfyCondition) > 0;
if (isOpen)
{
var obtacle = GetComponentsInChildren<NavMeshObstacle>();
for (int i = 0; i < obtacle.Length; i++)
obtacle[i].carving = false;
Set_Coroutine(() =>
{
gameObject.SetActive(false);
DSUtil.InActivateGameObjects(gos);
}, Time.deltaTime);
}
msgTime = 0f;
}
void Update()
2024-12-15 01:39:39 +00:00
{
if (!isOpen)
{
if (msgTime > 0f)
msgTime -= Time.deltaTime;
if (msgTime <= 0f && Vector3.Distance(MyValue.MyPC.Get_position(), transform.position) < 1f)
{
msgTime = 10f;
ToastUI.Ins.Set(0); // TODO 정인호
}
}
}
}