void OnTriggerEnter(Collider other) { XkPlayerCtrl playerScript = other.GetComponent <XkPlayerCtrl>(); if (playerScript == null) { return; } IsActiveTrigger = true; TimeLast = Time.time; if (SSXuanYaTiShi.GetInstance() != null) { SSXuanYaTiShi.GetInstance().SetActive(true); } }
void Update() { if (!IsActiveTrigger) { return; } if (Time.time - TimeLast < TimeOpen) { return; } if (SSXuanYaTiShi.GetInstance() != null) { SSXuanYaTiShi.GetInstance().RemoveSelf(); } Destroy(gameObject); }
void Start() { if (SSXuanYaTiShi.GetInstance() != null) { SSXuanYaTiShi.GetInstance().SetActive(false); } MeshRenderer mesh = gameObject.GetComponent <MeshRenderer>(); if (mesh != null) { Destroy(mesh); } MeshFilter meshFt = gameObject.GetComponent <MeshFilter>(); if (meshFt != null) { Destroy(meshFt); } }