using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityGameFramework.Runtime; public class SceneEventBubbleCmptLogic : MonoBehaviour { Button btnInteractive; private void Awake() { } // Start is called before the first frame update void Start() { SceneEventOpenBox info = this.gameObject.GetComponent(); } public void OnTriggerEnter(Collider collider) { if(collider.gameObject.layer != LayerMask.NameToLayer("Player")) { return; } ResourceHelper.Instance.LoadAssetBundle("SceneBubbleWindow", ab => { if (ab != null) { GameObject bubble = (GameObject)GameObject.Instantiate(ab.LoadAsset("SceneBubbleWindow")); bubble.transform.SetParent(this.transform); bubble.transform.localPosition = Vector3.zero; bubble.transform.SetLocalPositionY(2.0f); SceneCmptBubbleWindow buCmpt = bubble.AddComponent(); TransformRotation rtCmpt = bubble.AddComponent(); buCmpt.SetContent("Test"); } }); } public void OnTriggerExit(Collider collider) { btnInteractive.gameObject.SetActive(false); } public void EnableCollider() { } }