Example #1
0
        //Resource 方式读取
        #region Resources 方式读取

        //加载
        public void Load()
        {
#if UNITY_EDITOR
            if (!string.IsNullOrEmpty(Ext))
            {
                Load(string.Format("{0}/Resources", Application.dataPath), "");
                //失败从StreamingAsset读取
                if (_content == null)
                {
                    if (FileUtil.IsFileExistInStreamingAssets(OriginPath))
                    {
                        byte[] data = FileUtil.ReadFileInStreamingAssets(OriginPath);
                        if (data != null)
                        {
                            OnBinaryLoaded(data);
                        }
                    }
                }
            }
            else
#endif
            {
                _content = ExtResources.Load(Path);
                if (_content == null)
                {
                    JW.Common.Log.LogE("Resource.Load Fail:" + Path);
                }
                else
                {
                    PostProcessContent();
                }
            }
        }