Esempio n. 1
0
 public void Load()
 {
     if (this.m_isAbandon)
     {
         this.m_state = enResourceState.Unload;
     }
     else
     {
         if (this.m_contentType == null)
         {
             this.m_content = Resources.Load(CFileManager.EraseExtension(this.m_fullPathInResources));
         }
         else
         {
             this.m_content = Resources.Load(CFileManager.EraseExtension(this.m_fullPathInResources), this.m_contentType);
         }
         this.m_state = enResourceState.Loaded;
         if ((this.m_content != null) && (this.m_content.GetType() == typeof(TextAsset)))
         {
             CBinaryObject obj2 = ScriptableObject.CreateInstance <CBinaryObject>();
             obj2.m_data    = (this.m_content as TextAsset).bytes;
             this.m_content = obj2;
         }
     }
 }
Esempio n. 2
0
 public void Load(string ifsExtractPath)
 {
     if (this.m_isAbandon)
     {
         this.m_state = enResourceState.Unload;
     }
     else
     {
         byte[] buffer = CFileManager.ReadFile(CFileManager.CombinePath(ifsExtractPath, this.m_fileFullPathInResources));
         this.m_state = enResourceState.Loaded;
         if (buffer != null)
         {
             CBinaryObject obj2 = ScriptableObject.CreateInstance <CBinaryObject>();
             obj2.m_data    = buffer;
             obj2.name      = this.m_name;
             this.m_content = obj2;
         }
     }
 }