Beispiel #1
0
        //scene
        public bool Load()
        {
            DestroyScene();
            XQFileStream file = new XQFileStream();

            if (file != null)
            {
                file.Open("Data/sceneinfo");
                if (file.IsOpen())
                {
                    UInt16 usNumber = 0;
                    file.ReadUShort(ref usNumber);

                    for (UInt16 i = 0; i < usNumber; i++)
                    {
                        CSceneInfo sceneinfo = new CSceneInfo();
                        sceneinfo.Load(ref file);
                        RegistSceneInfo(sceneinfo);
                    }
                    file.Close();
                    s_SceneInfoMap.Sort();
                    return(true);
                }
            }
            return(false);
        }
Beispiel #2
0
    public static void _GenerateAndroidAsset()
    {
        string resPath  = "Assets/Plugins/Android/assets/res_unity/";
        string filePath = resPath + "androidasset.bytes";

        if (!Directory.Exists(resPath))
        {
            Directory.CreateDirectory(resPath);
        }

        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }

        List <string> listAsset = new List <string>();

        if (Directory.Exists(AssetSrcDir))
        {
            BuildAssetList(AssetSrcDir, listAsset);
        }

        XQFileStream fs = new XQFileStream();

        fs.OpenOverWrite(filePath);

        fs.WriteInt(listAsset.Count);
        foreach (var v in listAsset)
        {
            FileInfo fi = new FileInfo(v);
            fs.WriteString2(fi.Name);
        }

        fs.Close();
    }
Beispiel #3
0
        public override void LoadDataFromBuffer(byte[] bytes)
        {
            XQFileStream file = new XQFileStream();


            if (file != null)
            {
                file.Open(bytes);
            }
            {
                CMusicInfoManager MusicinfoMgr = CMusicInfoManager.MusicDataMgr;
                bool nRes = MusicinfoMgr.LoadMusic(file);

                if (null != MusicinfoMgr)
                {
                    if (!nRes)
                    {
                        Debug.LogError("CMusicInfoManager load data failed!");
                    }

                    nRes = MusicinfoMgr.LoadStage(file);
                }
                else
                {
                    Debug.LogError("CMusicInfoManager is null!");
                }

                CSceneInfoManager ScenceinfoMgr = StaticData.SceneDataMgr;
                if (null != ScenceinfoMgr)
                {
                    nRes = ScenceinfoMgr.Load(file);
                    if (!nRes)
                    {
                        Debug.LogError("CSceneInfoManager load data failed!");
                    }
                }
                else
                {
                    Debug.LogError("CSceneInfoManager is null!");
                }

                CModelInfoManager ModelinfoMgr = StaticData.ModelDataMgr;
                if (null != ModelinfoMgr)
                {
                    nRes = ModelinfoMgr.Load(file);
                    if (!nRes)
                    {
                        Debug.LogError("CModelInfoManager load data failed!");
                    }
                }
                else
                {
                    Debug.LogError("CModelInfoManager is null!");
                }
                file.Close();
            }
        }
Beispiel #4
0
        bool ParseFile(XQFileStream file)
        {
            if (file != null && file.IsOpen())
            {
                UInt16 usNumber = 0;
                file.ReadUShort(ref usNumber);

                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CItemInfo iteminfo = new CItemInfo();
                    iteminfo.Load(ref file);
                    RegistItemInfo(iteminfo);
                }

                // 额外时尚值 客户端不使用
                List <PlaceFashionInfo> m_PlaceFashionList = new List <PlaceFashionInfo>();
                _Load <PlaceFashionInfo>(file, m_PlaceFashionList);

                // 光效石属性
                XQDataLoadHelper.LoadToDic <byte, uint>(ref m_dicEffectStoneInfo, file, XQDataLoadHelper.ReadByte, XQDataLoadHelper.ReadUInt, false);

                // skin
                usNumber = 0;
                file.ReadUShort(ref usNumber);

                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CSkinInfo skinInfo = new CSkinInfo();
                    skinInfo.Load(ref file);
                    AddSkinInfo(skinInfo);
                }

                //Item animation
                file.ReadUShort(ref usNumber);
                for (UInt16 i = 0; i < usNumber; i++)
                {
                    CItemAniInfo itemAniInfo = new CItemAniInfo();
                    itemAniInfo.Load(ref file);
                    AddItemAniInfo(itemAniInfo);
                }

                file.Close();
                s_ItemInfoMap.Sort();
                s_SkinInfoMap.Sort();
                s_ItemAniInfoMap.Sort();
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public static void Load(byte[] bytes)
        {
            XQFileStream fs = new XQFileStream();

            fs.Open(bytes);

            if (fs.IsOpen())
            {
                int    count     = fs.ReadInt();
                string assetName = null;
                for (int i = 0; i < count; ++i)
                {
                    assetName            = fs.ReadString();
                    mDicAsset[assetName] = 0;
                }
            }

            fs.Close();
        }