internal void DelVariableBindFunc(EngineNS.UISystem.VariableBindInfo bindInfo) { var uiElement = HostControl.mCurrentUIHost.FindChildElement(bindInfo.BindFromUIElementId); List <EngineNS.UISystem.VariableBindInfo> infos = new List <EngineNS.UISystem.VariableBindInfo>(); if (uiElement.VariableBindInfosDic.TryGetValue(bindInfo.BindFromPropertyName, out infos)) { var category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var item_Get = category.FindItem(bindInfo.FunctionName_Get); if (item_Get != null) { category.RemoveItem(bindInfo.FunctionName_Get); Macross_Client.RemoveNodesContainer(item_Get); var fileName = Macross_Client.GetGraphFileName(item_Get.Name); EngineNS.CEngine.Instance.FileManager.DeleteFile(fileName); } var item_Set = category.FindItem(bindInfo.FunctionName_Set); if (item_Set != null) { category.RemoveItem(bindInfo.FunctionName_Set); Macross_Client.RemoveNodesContainer(item_Set); var fileName = Macross_Client.GetGraphFileName(item_Set.Name); EngineNS.CEngine.Instance.FileManager.DeleteFile(fileName); } infos.Remove(bindInfo); if (infos.Count == 0) { uiElement.VariableBindInfosDic.Remove(bindInfo.BindFromPropertyName); } } }
public async Task SetObjectToEdit(EngineNS.CRenderContext rc, EditorCommon.Resources.ResourceEditorContext context) { await EngineNS.Thread.AsyncDummyClass.DummyFunc(); Macross_Client.CurrentResourceInfo = HostControl.CurrentResInfo; await Macross_Client.Load(); }
void UpdateUndoRedoKey() { OnPropertyChanged("UndoRedoKey"); Macross_Common.UpdateUndoRedoKey(); Macross_Client.UpdateUndoRedoKey(); Macross_Server.UpdateUndoRedoKey(); }
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); }
public async Task Save() { await EngineNS.Thread.AsyncDummyClass.DummyFunc(); Macross_Client.Save(); HostControl.CurrentResInfo.CustomFunctions_Client.Clear(); Macross_Client.CollectFuncDatas(HostControl.CurrentResInfo.CustomFunctions_Client); }
async Task Load() { if (ClientVisible == Visibility.Visible) { await Macross_Client.Load(); } if (ServerVisible == Visibility.Visible) { await Macross_Server.Load(); } }
internal async Task FindPropertyCustomBindFunc(EngineNS.UISystem.UIElement uiElement, string propertyName) { string funcName; if (uiElement.PropertyBindFunctions.TryGetValue(propertyName, out funcName)) { Macross.Category category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var item = category.FindItem(funcName); if (item != null) { await Macross_Client.ShowNodesContainer(item); HostControl.ChangeToLogic(); } } }
internal void SetIsVariable(EngineNS.UISystem.UIElement element, bool setValue) { var category = Macross_Client.GetCategory(MacrossPanel.UIElementVariableCategoryName); var elementType = element.GetType(); var variables = category.Items.ToArray(); for (int i = 0; i < variables.Length; i++) { var pro = variables[i].PropertyShowItem as UIElementVariableCategoryItemPropertys; if (pro == null) { continue; } if (pro.ElementId == element.Id) { if (!setValue) { category.Items.Remove(variables[i]); } return; } } if (setValue) { // 没找到则创建一个 var item = new Macross.CategoryItem(null, category); item.CategoryItemType = Macross.CategoryItem.enCategoryItemType.Unknow; BindingOperations.SetBinding(item, Macross.CategoryItem.NameProperty, new Binding("Name") { Source = element.Initializer, Mode = BindingMode.TwoWay }); item.CanDrag = true; item.InitTypeStr = "UI_UIElement_Variable"; var data = new UIElementVariableCategoryItemInitData(); data.Reset(); data.UIElement = element; data.ElementType = elementType; data.UIElementId = element.Id; data.Deleteable = false; item.Initialize(Macross_Client, data); category.Items.Add(item); } }
internal async Task FindEventFunction(EngineNS.UISystem.UIElement element, string functionName) { var key = new UIResourceInfo.UIEventDicKey(element.Id, functionName); string dicValue; if (HostControl.CurrentResInfo.UIEventsDic.TryGetValue(key, out dicValue)) { var category = Macross_Client.GetCategory(MacrossPanel.UIEventFuncCategoryName); var item = category.FindItem(dicValue); if (item != null) { await Macross_Client.ShowNodesContainer(item); HostControl.ChangeToLogic(); } } }
internal async Task FindVariableBindFunc(EngineNS.UISystem.VariableBindInfo bindInfo) { var category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var item_Get = category.FindItem(bindInfo.FunctionName_Get); if (item_Get != null) { await Macross_Client.ShowNodesContainer(item_Get); } var item_Set = category.FindItem(bindInfo.FunctionName_Set); if (item_Set != null) { await Macross_Client.ShowNodesContainer(item_Set); } HostControl.ChangeToLogic(); }
//bool CheckCompileResult(System.CodeDom.Compiler.CompilerResults result, EngineNS.EPlatformType platform) //{ // if (result.Errors.HasErrors) // { // CompileStatusIcon = TryFindResource("Fail") as ImageSource; // var errorStr = ""; // foreach (var error in result.Errors) // { // errorStr += error.ToString() + "\r\n"; // } // EditorCommon.MessageBox.Show($"{platform}平台MacrossScript编译失败!\r\n" + errorStr); // return false; // } // else if (result.Errors.HasWarnings) // { // CompileStatusIcon = TryFindResource("Warning") as ImageSource; // return false; // } // else // { // CompileStatusIcon = TryFindResource("Good") as ImageSource; // return true; // } //} async Task CompileCode(EngineNS.EPlatformType platform) { if (CurrentResourceInfo.NotGenerateCode) { return; } if (!Macross_Client.CheckError()) { return; } CurrentResourceInfo.Version++; List <ResourceInfos.MacrossResourceInfo.CustomFunctionData> functions = new List <ResourceInfos.MacrossResourceInfo.CustomFunctionData>(); Macross_Client.CollectFuncDatas(functions); //if (CheckCompileResult(await CompileCode(Macross_Client, platform, functions), platform) == false) // return; //if (CheckCompileResult(await CompileMacrossCollector(Macross_Client, platform), platform) == false) // return; if (await CompileCode(Macross_Client, ECSType.Client)) { CompileStatusIcon = TryFindResource("Good") as ImageSource; } else { CompileStatusIcon = TryFindResource("Fail") as ImageSource; EditorCommon.MessageBox.Show($"{platform}平台MacrossScript编译失败!详细信息请编译游戏工程!\r\n"); return; } if (platform == EngineNS.EPlatformType.PLATFORM_WIN) { //var scriptDllName = EngineNS.CEngine.Instance.FileManager.Bin + "MacrossScript.dll"; //EngineNS.CEngine.Instance.MacrossDataManager.RefreshMacrossCollector(); var assembly = EngineNS.CEngine.Instance.MacrossDataManager.MacrossScripAssembly;//EngineNS.Rtti.RttiHelper.GetAssemblyFromDllFileName(EngineNS.CIPlatform.Instance.CSType, scriptDllName, "", true, true); var clsType = assembly.GetType(Program.GetClassNamespace(CurrentResourceInfo, ECSType.Client) + "." + Program.GetClassName(CurrentResourceInfo, ECSType.Client)); EngineNS.Macross.MacrossFactory.SetVersion(CurrentResourceInfo.ResourceName, CurrentResourceInfo.Version); } Macross_Client.PG.Instance = null; Macross_Server.PG.Instance = null; }
async Task CompileCode(EngineNS.EPlatformType platform) { if (!Macross_Client.CheckError()) { return; } CurrentResourceInfo.Version++; List <Macross.ResourceInfos.MacrossResourceInfo.CustomFunctionData> functions = new List <Macross.ResourceInfos.MacrossResourceInfo.CustomFunctionData>(); Macross_Client.CollectFuncDatas(functions); //if (CheckCompileResult(await CompileCode(Macross_Client, platform, functions), platform) == false) // return; //if (CheckCompileResult(await CompileMacrossCollector(Macross_Client, platform), platform) == false) // return; if (await CompileCode(Macross_Client, EngineNS.ECSType.Client)) { CompileStatusIcon = TryFindResource("Good") as ImageSource; } else { CompileStatusIcon = TryFindResource("Fail") as ImageSource; EditorCommon.MessageBox.Show($"{platform}平台MacrossScript编译失败!详细信息请编译游戏工程!\r\n"); return; } if (platform == EngineNS.EPlatformType.PLATFORM_WIN) { //var scriptDllName = EngineNS.CEngine.Instance.FileManager.Bin + "MacrossScript.dll"; EngineNS.CEngine.Instance.MacrossDataManager.RefreshMacrossCollector(); //var assembly = EngineNS.CEngine.Instance.MacrossDataManager.MacrossScripAssembly;// EngineNS.Rtti.RttiHelper.GetAssemblyFromDllFileName(EngineNS.CIPlatform.Instance.CSType, scriptDllName, "", true, true); //var clsTypeFullName = CurrentResourceInfo.ResourceName.RelativePath().Replace("/", ".") + CurrentResourceInfo.ResourceName.PureName(); //var clsType = assembly.GetType(clsTypeFullName); //var clsIdPro = clsType.GetProperty("ClassId"); //var classId = (EngineNS.Hash64)clsIdPro.GetValue(null); //EngineNS.CEngine.Instance.MacrossDataManager.RefreshMacrossData(ref classId, clsType); EngineNS.Macross.MacrossFactory.SetVersion(CurrentResourceInfo.ResourceName, CurrentResourceInfo.Version); Macross_Client.ResetPreview(); } Macross_Client.PropertiesPG.Instance = null; Macross_Server.PropertiesPG.Instance = null; }
internal void DelPropertyCustomBindFunc(EngineNS.UISystem.UIElement uiElement, string propertyName) { string funcName; if (uiElement.PropertyBindFunctions.TryGetValue(propertyName, out funcName)) { Macross.Category category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var item = category.FindItem(funcName); if (item != null) { category.RemoveItem(funcName); Macross_Client.RemoveNodesContainer(item); var fileName = Macross_Client.GetGraphFileName(item.Name); EngineNS.CEngine.Instance.FileManager.DeleteFile(fileName); } uiElement.PropertyBindFunctions.Remove(propertyName); } }
internal void DeleteEventFunction(EngineNS.UISystem.UIElement element, string functionName) { var key = new UIResourceInfo.UIEventDicKey(element.Id, functionName); string dicValue; if (HostControl.CurrentResInfo.UIEventsDic.TryGetValue(key, out dicValue)) { var category = Macross_Client.GetCategory(MacrossPanel.UIEventFuncCategoryName); var item = category.FindItem(dicValue); if (item != null) { Macross_Client.RemoveNodesContainer(item); category.RemoveItem(dicValue); var fileName = Macross_Client.GetGraphFileName(item.Name); EngineNS.CEngine.Instance.FileManager.DeleteFile(fileName); } HostControl.CurrentResInfo.UIEventsDic.Remove(key); } }
internal async Task SetPropertyCustomBindOperation(EngineNS.UISystem.UIElement uiElement, string bindPropertyName, Type bindPropertyType) { Macross.Category category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var item = new Macross.CategoryItem(null, category); item.CategoryItemType = Macross.CategoryItem.enCategoryItemType.Unknow; item.CanDrag = false; item.InitTypeStr = "UI_UIElement_PropertyCustomBind"; var data = new UIElementPropertyCustomBindCategoryitemInitData(); data.Reset(); data.UIElement = uiElement; data.UIElementId = uiElement.Id; data.PropertyName = bindPropertyName; data.PropertyType = bindPropertyType; data.FunctionName = $"UIBindFunc_{bindPropertyName}_{uiElement.Id.ToString().Replace("-","_")}_{item.Id.ToString().Replace("-", "_")}";// bindFunctionName; item.Initialize(Macross_Client, data); category.Items.Add(item); uiElement.PropertyBindFunctions[bindPropertyName] = data.FunctionName; var varItemPro = item.PropertyShowItem as UIElementPropertyCustomBindCategoryItemPropertys; var nodesContainer = await Macross_Client.CreateNodesContainer(item); var nodeType = typeof(CodeDomNode.MethodCustom); var csParam = new CodeDomNode.MethodCustom.MethodCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, IsShowProperty = false, }; var node = nodesContainer.NodesControl.AddOrigionNode(nodeType, csParam, 0, 0); node.IsDeleteable = false; node.NodeNameAddShowNodeName = false; nodesContainer.Save(); await Macross_Client.ShowNodesContainer(item); }
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(); }; }
internal async Task SetEventFunction(EngineNS.UISystem.UIElement element, string functionName, Type eventType) { Macross.Category category = Macross_Client.GetCategory(MacrossPanel.UIEventFuncCategoryName); var item = new Macross.CategoryItem(null, category); item.CategoryItemType = Macross.CategoryItem.enCategoryItemType.Unknow; item.CanDrag = true; item.InitTypeStr = "UI_UIElement_Event"; var data = new UIElementEventCategoryItemInitData(); data.Reset(); data.UIElement = element; data.UIElementId = element.Id; data.FunctionName = functionName; data.EventType = eventType; item.Initialize(Macross_Client, data); category.Items.Add(item); string dicValue; var key = new UIResourceInfo.UIEventDicKey(element.Id, functionName); if (!HostControl.CurrentResInfo.UIEventsDic.TryGetValue(key, out dicValue)) { HostControl.CurrentResInfo.UIEventsDic[key] = item.Name; } // 创建NodesContainer var varItemPro = item.PropertyShowItem as UIElementEventCategoryItemPorpertys; var nodesContainer = await Macross_Client.CreateNodesContainer(item); var nodeType = typeof(CodeDomNode.MethodCustom); var csParam = new CodeDomNode.MethodCustom.MethodCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, IsShowProperty = false, }; var node = nodesContainer.NodesControl.AddOrigionNode(nodeType, csParam, 0, 0); node.IsDeleteable = false; node.NodeNameAddShowNodeName = false; // 有输出参数时才默认添加return if (varItemPro.MethodInfo.OutParams.Count > 0) { var retNodeType = typeof(CodeDomNode.ReturnCustom); var retParam = new CodeDomNode.ReturnCustom.ReturnCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, ShowPropertyType = CodeDomNode.ReturnCustom.ReturnCustomConstructParam.enShowPropertyType.ReturnValue, }; var retNode = nodesContainer.NodesControl.AddOrigionNode(retNodeType, retParam, 300, 0) as CodeDomNode.ReturnCustom; retNode.IsDeleteable = false; } nodesContainer.Save(); await Macross_Client.ShowNodesContainer(item); }
internal async Task SetVariableBindOperation(EngineNS.UISystem.VariableBindInfo bindInfo) { var category = Macross_Client.GetCategory(MacrossPanel.UIBindFuncCategoryName); var bindFromUI = HostControl.mCurrentUIHost.FindChildElement(bindInfo.BindFromUIElementId); var bindToUI = HostControl.mCurrentUIHost.FindChildElement(bindInfo.BindToUIElementId); // from->to if (bindInfo.BindMode == EngineNS.UISystem.enBindMode.OnWayToSource || bindInfo.BindMode == EngineNS.UISystem.enBindMode.TwoWay) { var item = new Macross.CategoryItem(null, category); item.CategoryItemType = Macross.CategoryItem.enCategoryItemType.Unknow; item.CanDrag = false; item.InitTypeStr = "UI_UIElement_VariableBind"; var data = new UIElementVariableBindCategoryItemInitData(); data.Reset(); data.UIElement = bindFromUI; data.UIElementId = bindInfo.BindFromUIElementId; data.PropertyName = bindInfo.BindFromPropertyName; data.PropertyType = bindInfo.BindFromPropertyType; data.TargetUIElement = bindToUI; data.TargetUIElementId = bindInfo.BindToUIElementId; data.TargetPropertyName = bindInfo.VariableName; data.TargetPropertyType = bindInfo.BindToVariableType; data.FunctionName = $"UIVariableBindFunc_Set_{bindInfo.BindFromUIElementId.ToString().Replace("-", "_")}_{item.Id.ToString().Replace("-", "_")}"; bindInfo.FunctionName_Set = data.FunctionName; item.Initialize(Macross_Client, data); category.Items.Add(item); var varItemPro = item.PropertyShowItem as UIElementVariableBindCategoryItemPropertys; var nodesContainer = await Macross_Client.CreateNodesContainer(item); var nodeType = typeof(CodeDomNode.MethodCustom); var csParam = new CodeDomNode.MethodCustom.MethodCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, IsShowProperty = false, }; var node = nodesContainer.NodesControl.AddOrigionNode(nodeType, csParam, 0, 0); node.IsDeleteable = false; node.NodeNameAddShowNodeName = false; var retNodeType = typeof(CodeDomNode.ReturnCustom); var retCSParam = new CodeDomNode.ReturnCustom.ReturnCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, ShowPropertyType = CodeDomNode.ReturnCustom.ReturnCustomConstructParam.enShowPropertyType.ReturnValue, }; var retNode = nodesContainer.NodesControl.AddOrigionNode(retNodeType, retCSParam, 500, 0) as CodeDomNode.ReturnCustom; retNode.IsDeleteable = false; // 相同或可强转类型自动连接 var nodePins = node.GetLinkPinInfos(); var retNodePins = retNode.GetLinkPinInfos(); foreach (var pin in nodePins) { if (pin.Visibility != Visibility.Visible) { continue; } foreach (var retPin in retNodePins) { if (retPin.Visibility != Visibility.Visible) { continue; } if (CodeGenerateSystem.Base.LinkInfo.CanLinkWith(pin, retPin)) { var linkInfo = new CodeGenerateSystem.Base.LinkInfo(nodesContainer.NodesControl.GetDrawCanvas(), pin, retPin); } } } nodesContainer.Save(); await Macross_Client.ShowNodesContainer(item); } // to->from if (bindInfo.BindMode == EngineNS.UISystem.enBindMode.OnWay || bindInfo.BindMode == EngineNS.UISystem.enBindMode.TwoWay) { var item = new Macross.CategoryItem(null, category); item.CategoryItemType = Macross.CategoryItem.enCategoryItemType.Unknow; item.CanDrag = false; item.InitTypeStr = "UI_UIElement_VariableBind"; var data = new UIElementVariableBindCategoryItemInitData(); data.Reset(); data.UIElement = bindToUI; data.UIElementId = bindInfo.BindToUIElementId; data.PropertyName = bindInfo.VariableName; data.PropertyType = bindInfo.BindToVariableType; data.TargetUIElement = bindFromUI; data.TargetUIElementId = bindInfo.BindFromUIElementId; data.TargetPropertyName = bindInfo.BindFromPropertyName; data.TargetPropertyType = bindInfo.BindFromPropertyType; data.FunctionName = $"UIVariableBindFunc_Get_{bindInfo.BindToUIElementId.ToString().Replace("-", "_")}_{item.Id.ToString().Replace("-", "_")}"; bindInfo.FunctionName_Get = data.FunctionName; item.Initialize(Macross_Client, data); category.Items.Add(item); var varItemPro = item.PropertyShowItem as UIElementVariableBindCategoryItemPropertys; var nodesContainer = await Macross_Client.CreateNodesContainer(item); var nodeType = typeof(CodeDomNode.MethodCustom); var csParam = new CodeDomNode.MethodCustom.MethodCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, IsShowProperty = false, }; var node = nodesContainer.NodesControl.AddOrigionNode(nodeType, csParam, 0, 0); node.IsDeleteable = false; node.NodeNameAddShowNodeName = false; var retNodeType = typeof(CodeDomNode.ReturnCustom); var retCSParam = new CodeDomNode.ReturnCustom.ReturnCustomConstructParam() { CSType = Macross_Client.CSType, HostNodesContainer = nodesContainer.NodesControl, ConstructParam = "", MethodInfo = varItemPro.MethodInfo, ShowPropertyType = CodeDomNode.ReturnCustom.ReturnCustomConstructParam.enShowPropertyType.ReturnValue, }; var retNode = nodesContainer.NodesControl.AddOrigionNode(retNodeType, retCSParam, 500, 0) as CodeDomNode.ReturnCustom; retNode.IsDeleteable = false; // 相同或可强转类型自动连接 bool childLinked = false; var nodeChildren = node.GetChildNodes(); var retNodeChildren = retNode.GetChildNodes(); foreach (var nodeChild in nodeChildren) { foreach (var retNodeChild in retNodeChildren) { foreach (var pin in nodeChild.GetLinkPinInfos()) { if (pin.Visibility != Visibility.Visible) { continue; } foreach (var retPin in retNodeChild.GetLinkPinInfos()) { if (retPin.Visibility != Visibility.Visible) { continue; } if (CodeGenerateSystem.Base.LinkInfo.CanLinkWith(pin, retPin)) { var linkInfo = new CodeGenerateSystem.Base.LinkInfo(nodesContainer.NodesControl.GetDrawCanvas(), pin, retPin); childLinked = true; } } } } } if (childLinked) { var nodePins = node.GetLinkPinInfos(); var retNodePins = retNode.GetLinkPinInfos(); foreach (var pin in nodePins) { if (pin.Visibility != Visibility.Visible) { continue; } foreach (var retPin in retNodePins) { if (retPin.Visibility != Visibility.Visible) { continue; } if (CodeGenerateSystem.Base.LinkInfo.CanLinkWith(pin, retPin)) { var linkInfo = new CodeGenerateSystem.Base.LinkInfo(nodesContainer.NodesControl.GetDrawCanvas(), pin, retPin); } } } } nodesContainer.Save(); await Macross_Client.ShowNodesContainer(item); } List <EngineNS.UISystem.VariableBindInfo> infos; if (!bindFromUI.VariableBindInfosDic.TryGetValue(bindInfo.BindFromPropertyName, out infos)) { infos = new List <EngineNS.UISystem.VariableBindInfo>(); bindFromUI.VariableBindInfosDic[bindInfo.BindFromPropertyName] = infos; } infos.Add(bindInfo); HostControl.ChangeToLogic(); }