Exemplo n.º 1
0
        public bool InitEngine(string pkgName, CEngineDesc desc, bool isServer = false)
        {
            if (mNativeRttiManager == null)
            {
                PreInitEngine();
            }
            InitVAssembly(isServer);
            IO.Serializer.TypeDescGenerator.Instance.BuildTypes(System.AppDomain.CurrentDomain.GetAssemblies(), (isServer ? ECSType.Server : ECSType.Client));

            var typeRedirectionFile = FileManager.ProjectContent + "typeredirection.xml";

            EngineNS.Rtti.TypeRedirectionHelper.Load(typeRedirectionFile);

            if (desc == null)
            {
                var rn = RName.GetRName($"{nameof(CEngineDesc)}.cfg");
                desc = IO.XmlHolder.CreateObjectFromXML(rn) as CEngineDesc;
                if (desc == null)
                {
                    desc = new CEngineDesc();
                    IO.XmlHolder.SaveObjectToXML(desc, rn);
                }
            }

            mDesc = desc;

            StartSystemThreads();

            MetaClassManager.MetaDirectory = RName.GetRName("MetaClasses");
            MetaClassManager.LoadMetaClasses();
            return(true);
        }
Exemplo n.º 2
0
        public async System.Threading.Tasks.Task CollectAssets(RName gameEntry, string platform, bool copyRInfo, string[] sm)
        {
            var RInfoManager = CMDEngine.CMDEngineInstance.mInfoManager;

            World = new EngineNS.GamePlay.GWorld();
            World.Init();

            MacrossAssets.Add(gameEntry);
            await CollectImpl(gameEntry);

            {
                var engineDesc = new EngineNS.CEngineDesc();
                HashSet <object> visitedObjects = new HashSet <object>();
                visitedObjects.Add(CMDEngine.Instance);
                await CollectRNameFromObject(engineDesc, visitedObjects);

                var rn = RName.GetRName("ui/mi_ui_default.instmtl", RName.enRNameType.Engine);
                MaterialInstanceAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("ui/uv_ui_default.uvanim", RName.enRNameType.Engine);
                UVAnimAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("EngineAsset/Texture/default_envmap.txpic");
                TextureAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("Texture/eyeenvmap0.txpic");
                TextureAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("EngineAsset/Texture/default_vignette.txpic");
                TextureAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("ui/mi_ui_defaultfont.instmtl", RName.enRNameType.Engine);
                MaterialInstanceAssets.Add(rn);
                await CollectImpl(rn);

                rn = RName.GetRName("ui/defbutton.txpic", RName.enRNameType.Engine);
                TextureAssets.Add(rn);

                //rn = RName.GetRName("tutorials/gameplay/dataset/students_table.xls");
                //XlsAssets.Add(rn);

                await CollectImpl(rn);
            }

            CookResourceSet(SceneAssets, platform, copyRInfo);
            CookResourceSet(MeshAssets, platform, copyRInfo);
            CookResourceSet(MeshSourceAssets, platform, copyRInfo);
            CookResourceSet(TextureAssets, platform, copyRInfo, null, ResourceCooker.CookTxPic);
            CookResourceSet(UVAnimAssets, platform, copyRInfo);
            CookResourceSet(NotifyAssets, platform, copyRInfo);
            CookResourceSet(SkeletonAssets, platform, copyRInfo);
            CookResourceSet(AnimationAssets, platform, copyRInfo);
            CookResourceSet(MaterialAssets, platform, copyRInfo, new string[] { ".code", ".link", ".var" });
            CookResourceSet(MaterialInstanceAssets, platform, copyRInfo);
            CookResourceSet(MacrossAssets, platform, copyRInfo);
            CookResourceSet(PrefabAssets, platform, copyRInfo);
            CookResourceSet(ClusterAssets, platform, copyRInfo);
            CookResourceSet(PhyMtlAssets, platform, copyRInfo);
            CookResourceSet(AnimationBlendSpace1DAssets, platform, copyRInfo);
            CookResourceSet(AnimationBlendSpaceAssets, platform, copyRInfo);
            CookResourceSet(AnimationAdditiveBlendSpace1DAssets, platform, copyRInfo);
            CookResourceSet(AnimationAdditiveBlendSpaceAssets, platform, copyRInfo);
            CookResourceSet(AnimationClipAssets, platform, copyRInfo);
            CookResourceSet(VertexCloudAssets, platform, copyRInfo);
            CookResourceSet(UIAssets, platform, copyRInfo);
            CookResourceSet(FontAssets, platform, copyRInfo);
            CookResourceSet(XlsAssets, platform, copyRInfo, null, ResourceCooker.CookXls);
        }