using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using UnityEngine; using UnityGameFramework.Runtime; public class FunctionGuideCanvas : MonoBehaviour { int _siblingIndex; YL_FunctionGuide.ClickType _clickType; Image _mask; Canvas _guideCanvas; GameObject _arrow; // Start is called before the first frame update void Start() { } private void OnEnable() { } private void Update() { if(_arrow) { _arrow.transform.position = this.transform.position; } } public void InitData(YL_FunctionGuide.ClickType clickType,Image mask, GameObject arrow) { this.gameObject.SetActive(true); if(this.transform.parent != null) { this.transform.parent.gameObject.SetActive(true); } _clickType = clickType; _mask = mask; _arrow = arrow; if (!this.gameObject.TryGetComponent(out _guideCanvas)) { _guideCanvas = this.gameObject.AddComponent(); } _guideCanvas.overrideSorting = true; _guideCanvas.sortingLayerName = "top"; _guideCanvas.sortingOrder = 1001; GraphicRaycaster raycaster; if (!this.gameObject.TryGetComponent(out raycaster)) { raycaster = this.gameObject.AddComponent(); } _siblingIndex = this.transform.GetSiblingIndex(); EventTriggerListener.Get(this.gameObject).onClick2 = ((_btn) => { EventTriggerListener.Get(this.gameObject).onClick2 = null; GuideFunctionComplete(); }); if (clickType == YL_FunctionGuide.ClickType.Blank) { Button btn = null; if (mask.TryGetComponent