Page 428 - MDP2022-3
P. 428
public void LightOff()
{
girlToiletLight.SetActive(false);
audio.Stop();
audio.Play();
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player" && !isTricked)
{
StartCoroutine(DoorOff());
isTricked = true; //한번이라도 트리거enter를 했다면 실행안되게하는 함수
IsPlayerIn = true; //플레이어가 들어옴을 알려줌
StartCoroutine("LightControl");
}
}
private void Update()
{
GameObject.Find("Girl_Toilet_Door_").GetComponent<XRGrabInteractable>().enabled =
can_open;
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GirlGhostKill : MonoBehaviour
{
public Transform player;
public Vector3 offset;
public GameObject mainCamera;
public GameObject subCamera;