public UIType(UnityEngine.Color maskColor) { this.layerIndex = 0; this.form = UIFormType.Fixed; this.hideAlaph = 0; this.layer = UILayerType.Base; this.enterAnim = null; this.quitAnim = null; this.closeRule = CloseRule.DestroyNoraml; this.hideRule = HideRule.HideGameObject; this.cover = UIMask.None; this.maskColor = maskColor; }
public void MaskFull() { GameObject tmpGameObj = Resources.Load <GameObject>("Prefab/UGUI/UI/MaskFull"); tmpGameObj = GameObject.Instantiate(tmpGameObj); UIMask uimask = tmpGameObj.GetComponent <UIMask>(); if (uimask == null) { tmpGameObj.AddComponent <UIMask>(); } tmpGameObj.transform.SetParent(mainCanvas.transform, false); tmpGameObj.transform.SetAsLastSibling(); }
protected override void Init() { kernel = GameKernel.GetInstance(); m_uistacks = new Stack <int>(); m_uicache = new UIBase[(int)UIPageEnum.Max]; m_tips_cache = new List <int>(); sb = new StringBuilder(256); //生成uiroot GameObject temp = ResMgr.LoadGameObject(string.Format(m_UIPath, m_root_tag)); //Debug.Log(string.Format(m_UIPath, m_root_tag)); m_uiRoot = temp.GetComponentInChildren <UIBase>(); m_canvas = m_uiRoot.GetComponent <Canvas>(); //Debug.Log("init the muiRoot"); GameObject.DontDestroyOnLoad(temp); //生成背景遮罩 temp = ResMgr.LoadGameObject(string.Format(m_UIPath, m_mask_tag), m_uiRoot.transform); m_bgMask = temp.GetComponent <UIMask>(); m_bgMask.Hide(); }
public UIMask() { instance = this; }
void Awake() { _material = this.renderer.material; _mask = GetComponentInParent <UIMask>(); }