Ejemplo n.º 1
0
 public bool ResetLoadingMask()
 {
     if (mLoadingKeys.Count > 0)
     {
         return(false);
     }
     if (mLoadingMask == m_DefaultLoadingMask)
     {
         return(false);
     }
     mUILoader.UnloadInstance(mLoadingMask.gameObject);
     mLoadingMask = m_DefaultLoadingMask;
     return(true);
 }
Ejemplo n.º 2
0
 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;
     });
 }