Exemplo n.º 1
0
        async Task Save()
        {
            await CurrentResourceInfo.Save();

            if (CommonVisible == Visibility.Visible)
            {
                Macross_Common.Save();
            }
            if (ClientVisible == Visibility.Visible)
            {
                Macross_Client.Save();
            }
            if (ServerVisible == Visibility.Visible)
            {
                Macross_Server.Save();
            }

            CurrentResourceInfo.CustomFunctions_Client.Clear();
            Macross_Client.CollectFuncDatas(CurrentResourceInfo.CustomFunctions_Client);
            CurrentResourceInfo.CustomFunctions_Server.Clear();
            Macross_Server.CollectFuncDatas(CurrentResourceInfo.CustomFunctions_Server);
            await CurrentResourceInfo.Save();

            await CompileCode(EngineNS.EPlatformType.PLATFORM_DROID);
            await CompileCode(EngineNS.EPlatformType.PLATFORM_WIN);
        }
Exemplo n.º 2
0
 void UpdateUndoRedoKey()
 {
     OnPropertyChanged("UndoRedoKey");
     Macross_Common.UpdateUndoRedoKey();
     Macross_Client.UpdateUndoRedoKey();
     Macross_Server.UpdateUndoRedoKey();
 }
 async Task Load()
 {
     if (ClientVisible == Visibility.Visible)
     {
         await Macross_Client.Load();
     }
     if (ServerVisible == Visibility.Visible)
     {
         await Macross_Server.Load();
     }
 }
Exemplo n.º 4
0
        async Task Save()
        {
            CurrentResourceInfo.ReferenceRNameList.Clear();
            if (ClientVisible == Visibility.Visible)
            {
                Macross_Client.Save();
            }
            if (ServerVisible == Visibility.Visible)
            {
                Macross_Server.Save();
            }

            var className     = Program.GetClassName(CurrentResourceInfo, ECSType.Client);
            var classFullName = Program.GetClassNamespace(CurrentResourceInfo, ECSType.Client) + "." + className;

            WPG.Data.PropertyCollection.RemoveCache(EngineNS.CEngine.Instance.MacrossDataManager.MacrossScripAssembly.GetType(classFullName));

            CurrentResourceInfo.CustomFunctions_Client.Clear();
            Macross_Client.CollectFuncDatas(CurrentResourceInfo.CustomFunctions_Client);
            CurrentResourceInfo.CustomFunctions_Server.Clear();
            Macross_Server.CollectFuncDatas(CurrentResourceInfo.CustomFunctions_Server);
            //await CurrentResourceInfo.Save();

            //await CompileCode(EngineNS.EPlatformType.PLATFORM_DROID);
            await CompileCode(EngineNS.EPlatformType.PLATFORM_WIN);

            List <RName> rnames = new List <RName>();

            if (ClientVisible == Visibility.Visible)
            {
                await mCodeGenerator.CollectMacrossResource(Macross_Client, rnames);
            }
            if (ServerVisible == Visibility.Visible)
            {
                await mCodeGenerator.CollectMacrossResource(Macross_Server, rnames);
            }

            CurrentResourceInfo.ReferenceRNameList.AddRange(rnames);
            await CurrentResourceInfo.Save();
        }
        public McLogicAnimationEditorControl()
        {
            EditorCommon.Resources.ResourceInfoManager.Instance.RegResourceInfo(typeof(ResourceInfos.McLogicAnimationResourceInfo));
            InitializeComponent();

            EngineNS.CEngine.Instance.MetaClassManager.GetMetaClass(typeof(LAAnimLayerCategoryItemInitData));
            EngineNS.CEngine.Instance.MetaClassManager.GetMetaClass(typeof(LAAnimLayerCategoryItemPropertys));

            mCodeGenerator = new McLogicAnimationEditor.CodeGenerator();
            CodeGenerateSystem.Program.RegisterNodeAssembly();
            CodeGenerateSystem.Program.RegisterNodeAssembly("Macross.dll", this.GetType().Assembly);

            Macross_Client.HostControl = this;
            Macross_Server.HostControl = this;

            var template = TryFindResource("TypeSetterTemplate") as DataTemplate;

            WPG.Program.RegisterDataTemplate("TypeSetterTemplate", template);
            template = TryFindResource("MethodParamSetterTemplate") as DataTemplate;
            WPG.Program.RegisterDataTemplate("MethodParamSetterTemplate", template);

            PreviewMeshCtrl.HostControl             = this;
            PreviewMeshCtrl.OnResourceItemSelected += async(EditorCommon.Resources.ResourceInfo rInfo) =>
            {
                if (rInfo == null)
                {
                    return;
                }
                var animRinfo = CurrentResourceInfo as ResourceInfos.McLogicAnimationResourceInfo;

                animRinfo.PreViewMesh            = rInfo.ResourceName.Name;
                PreviewMeshShowBtn.IsSubmenuOpen = false;
                await Macross_Client.RefreshPreviewActor(animRinfo.PreViewMesh);

                await Macross_Server.RefreshPreviewActor(animRinfo.PreViewMesh);

                await animRinfo.Save();
            };
        }