60 lines
1011 B
C#
60 lines
1011 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class NPCTrigger : MonoBehaviour
|
|
{
|
|
public List<GameObject> open;
|
|
|
|
public List<GameObject> close;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void Open()
|
|
{
|
|
foreach (var obj in open)
|
|
{
|
|
obj.SetActive(true);
|
|
}
|
|
|
|
foreach (var obj in close)
|
|
{
|
|
obj.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
foreach (var obj in open)
|
|
{
|
|
obj.SetActive(false);
|
|
}
|
|
|
|
foreach (var obj in close)
|
|
{
|
|
obj.SetActive(true);
|
|
}
|
|
}
|
|
|
|
public void OnNPCEventEnter()
|
|
{
|
|
GameSystem.ins.SaveNPCbo(true);
|
|
}
|
|
|
|
public void OnNPCEventExit()
|
|
{
|
|
GameSystem.ins.SaveNPCbo(false);
|
|
}
|
|
}
|