public bool ResetLoadingMask() { if (mLoadingKeys.Count > 0) { return(false); } if (mLoadingMask == m_DefaultLoadingMask) { return(false); } mUILoader.UnloadInstance(mLoadingMask.gameObject); mLoadingMask = m_DefaultLoadingMask; return(true); }
public void SetLoadingMask(string name) { if (string.IsNullOrEmpty(name)) { return; } mUILoader.LoadLoadingMask(name, (GameObject go) => { if (go == null) { return; } if (mLoadingKeys.Count > 0) { mUILoader.UnloadInstance(go); return; } LoadingMaskBase lm = go.GetComponent <LoadingMaskBase>(); if (lm == null) { mUILoader.UnloadInstance(go); return; } RectTransform rectTrans = go.transform as RectTransform; rectTrans.SetParent(m_DefaultLoadingMask.transform.parent, false); rectTrans.offsetMin = Vector2.zero; rectTrans.offsetMax = Vector2.zero; rectTrans.localRotation = Quaternion.identity; rectTrans.localScale = Vector3.one; go.SetActive(false); if (mLoadingMask != m_DefaultLoadingMask) { mUILoader.UnloadInstance(mLoadingMask.gameObject); } mLoadingMask = lm; }); }