コード例 #1
0
 protected void loadAtlasAsync(string atlasName, AtlasLoadDone callback, object userData, bool errorIfNull = true)
 {
     if (!mSpriteNameList.ContainsKey(atlasName))
     {
         object[] userDatas = new object[] { callback, userData };
         mResourceManager.loadSubResourceAsync <Sprite>(atlasName, onAssetLoadDone, userDatas, errorIfNull);
     }
 }
コード例 #2
0
 //---------------------------------------------------------------------------------------------------------------
 // 异步加载图集
 protected void loadAtlasAsync(string atlasName, AtlasLoadDone callback, object userData, bool errorIfNull = true)
 {
     if (!mSpriteNameList.ContainsKey(atlasName))
     {
         var param = new AtlasLoadParam()
         {
             mCallback = callback, mUserData = userData
         };
         mResourceManager.loadSubResourceAsync <Sprite>(atlasName, mAtlasCallback, param, errorIfNull);
     }
 }
コード例 #3
0
 public void getAtlasAsync(string atlasName, AtlasLoadDone callback, object userData, bool errorInNull, bool loadIfNull)
 {
     if (mAtlasNameList.TryGetValue(atlasName, out UGUIAtlas atlas))
     {
         callback?.Invoke(atlas, userData);
         return;
     }
     if (loadIfNull)
     {
         loadAtlasAsync(atlasName, callback, userData, errorInNull);
     }
 }
コード例 #4
0
 public void getAtlasAsync(string atlasName, AtlasLoadDone callback, object userData, bool errorInNull, bool loadIfNull)
 {
     if (mAtlasNameList.ContainsKey(atlasName))
     {
         callback?.Invoke(mAtlasNameList[atlasName] as Texture2D, userData);
         return;
     }
     if (!mAtlasNameList.ContainsKey(atlasName) && loadIfNull)
     {
         loadAtlasAsync(atlasName, callback, userData, errorInNull);
     }
 }
コード例 #5
0
 public override void resetProperty()
 {
     base.resetProperty();
     mCallback = null;
     mUserData = null;
 }