using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityGameFramework.Runtime; /// /// 场景组件 大门 /// public class SceneEventGateLogic : MonoBehaviour { public bool isEntry = false; private void Awake() { } // Start is called before the first frame update void Start() { } public void OnTriggerEnter(Collider collider) { Role role = collider.GetComponent(); if(role && role.IsTeamLeader) { isEntry = true; SceneEventAreaLockLogic areaLock; if (this.TryGetComponent(out areaLock)) { if(areaLock.IsUnlockDoor) { OpenDoor(); } } } } public void OpenDoor() { if(isEntry) { Animator anim = this.GetComponent(); anim.Play("open"); } } public void OnTriggerExit(Collider collider) { //Role role = collider.GetComponent(); //if (role) //{ // isEntry = false; // Animator anim = this.GetComponent(); // anim.Play("close"); //} } public void EnableCollider() { } public void OnClickInteractive() { } }