1234567891011121314151617181920212223242526272829 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- namespace KairoEngine.CharacterSystem
- {
- public class DoorTrigger : MonoBehaviour
- {
- public DoorController doorController;
- public List<CharacterController> charactersInRange = new List<CharacterController>();
- void OnTriggerEnter(Collider co)
- {
- CharacterController character = co.gameObject.transform.root.GetComponentInChildren<CharacterController>();
- if(character == null) return;
- charactersInRange.Add(character);
- }
- void OnTriggerExit(Collider co)
- {
- CharacterController character = co.gameObject.transform.root.GetComponentInChildren<CharacterController>();
- if(character == null) return;
- charactersInRange.Remove(character);
- }
- }
- }
|