Exemple #1
0
 public override IResourceFileStream LoadFile(string path)
 {
     if (path == null)
     {
         return(null);
     }
     try
     {
         DefaultAssetFileStream fs = new DefaultAssetFileStream();
         bool v = fs.Open(path);
         if (v)
         {
             return(fs);
         }
         else
         {
             return(null);
         }
     }
     catch (System.Exception e)
     {
         Debug.LogError("load file exception->" + e.ToString());
         return(null);
     }
 }
Exemple #2
0
        public override IResourceFileStream LoadFile(string path)
        {
            if (path == null)
            {
                return(null);
            }

            bool doo = false;

            if (path.Length > 3)
            {
                if (path[0] == 'j' && path[1] == 'a' && path[2] == 'r')
                {
                    doo = true;
                }
            }

            if (doo)
            {
                try
                {
                    AndroidAssetFileStream fs = new AndroidAssetFileStream();
                    bool v = fs.Open(path);
                    if (v)
                    {
                        return(fs);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception e)
                {
                    Debugger.LogError("android resource loader load file error->" + e.ToString());
                    return(null);
                }
            }
            else
            {
                try
                {
                    DefaultAssetFileStream fs = new DefaultAssetFileStream();
                    bool v = fs.Open(path);
                    if (v)
                    {
                        return(fs);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (System.Exception e)
                {
                    Debugger.LogError("load file exception->" + e.ToString());
                    return(null);
                }
            }
        }