コード例 #1
0
        public virtual byte[] ReadFile(string fileName)
        {
            if (!beZip)
            {
                string path = FindFile(fileName);
                byte[] str  = null;


                if (!string.IsNullOrEmpty(path) && File.Exists(path))
                {
#if !UNITY_WEBPLAYER
                    if (LuaConst.USE_AB)
                    {
                        //if (LuaState.m_script.ContainsKey(fileName))
                        {
                            str = LuaState.getLua(fileName);// m_script[fileName];
                        }
                    }
                    else
                    {
                        str = File.ReadAllBytes(path);
                    }
#else
                    throw new LuaException("can't run in web platform, please switch to other platform");
#endif
                }

                return(str);
            }
            else
            {
                return(ReadZipFile(fileName));
            }
        }