本文整理汇总了C#中UnityEngine.UI.Windows.Plugins.Flow.FlowWindow.GetFunctionContainer方法的典型用法代码示例。如果您正苦于以下问题:C# FlowWindow.GetFunctionContainer方法的具体用法?C# FlowWindow.GetFunctionContainer怎么用?C# FlowWindow.GetFunctionContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.UI.Windows.Plugins.Flow.FlowWindow
的用法示例。
在下文中一共展示了FlowWindow.GetFunctionContainer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateReturnMethod
public static string GenerateReturnMethod(FlowSystemEditorWindow flowEditor, FlowWindow exitWindow) {
var file = Resources.Load("UI.Windows/Functions/Templates/TemplateReturnMethod") as TextAsset;
if (file == null) {
Debug.LogError("Functions Template Loading Error: Could not load template 'TemplateReturnMethod'");
return string.Empty;
}
var data = FlowSystem.GetData();
if (data == null) return string.Empty;
var result = string.Empty;
var part = file.text;
var functionContainer = exitWindow.GetFunctionContainer();
var functionName = functionContainer.title;
var functionCallName = functionContainer.directory;
var classNameWithNamespace = Tpl.GetNamespace(exitWindow) + "." + Tpl.GetDerivedClassName(exitWindow);
result +=
part.Replace("{FUNCTION_NAME}", functionName)
.Replace("{FUNCTION_CALL_NAME}", functionCallName)
.Replace("{CLASS_NAME_WITH_NAMESPACE}", classNameWithNamespace);
return result;
}
示例2: DrawWindowToolbar
private void DrawWindowToolbar(FlowWindow window) {
//var edit = false;
var id = window.id;
var buttonStyle = ME.Utilities.CacheStyle("FlowEditor.DrawWindowToolbar.Styles", "toolbarButton", (name) => {
var _buttonStyle = new GUIStyle(EditorStyles.toolbarButton);
_buttonStyle.stretchWidth = false;
return _buttonStyle;
});
GUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));
if (this.waitForAttach == false || this.currentAttachComponent == null) {
if (this.waitForAttach == true) {
if (id != this.currentAttachId) {
var currentAttach = FlowSystem.GetWindow(this.currentAttachId);
if (currentAttach != null) {
//var attachTo = FlowSystem.GetWindow(id);
//var hasContainer = currentAttach.HasContainer();
if (currentAttach.IsContainer() == false) {
if (FlowSystem.AlreadyAttached(this.currentAttachId, id) == true) {
if (GUILayout.Button(string.Format("Detach Here{0}", (Event.current.alt == true ? " (Double Direction)" : string.Empty)), buttonStyle) == true) {
FlowSystem.Detach(this.currentAttachId, id, oneWay: Event.current.alt == false);
if (Event.current.shift == false) this.WaitForAttach(-1);
}
} else {
if (GUILayout.Button(string.Format("Attach Here{0}", (Event.current.alt == true ? " (Double Direction)" : string.Empty)), buttonStyle) == true) {
FlowSystem.Attach(this.currentAttachId, id, oneWay: Event.current.alt == false);
if (Event.current.shift == false) this.WaitForAttach(-1);
}
}
}
}
} else {
if (GUILayout.Button("Cancel", buttonStyle) == true) {
this.WaitForAttach(-1);
}
}
} else {
if (window.IsSmall() == false ||
window.IsFunction() == true) {
if (GUILayout.Button("Attach/Detach", buttonStyle) == true) {
this.ShowNotification(new GUIContent("Use Attach/Detach buttons to Connect/Disconnect a window"));
this.WaitForAttach(id);
}
}
if (GUILayout.Button("Destroy", buttonStyle) == true) {
if (EditorUtility.DisplayDialog("Are you sure?", "Current window will be destroyed with all links", "Yes, destroy", "No") == true) {
this.ShowNotification(new GUIContent(string.Format("The window `{0}` was successfully destroyed", window.title)));
FlowSystem.DestroyWindow(id);
return;
}
}
}
if (window.IsSmall() == false) {
//var isExit = false;
var functionWindow = window.GetFunctionContainer();
if (functionWindow != null) {
if (functionWindow.functionRootId == 0) functionWindow.functionRootId = id;
if (functionWindow.functionExitId == 0) functionWindow.functionExitId = id;
//.........这里部分代码省略.........
示例3: OnCompilerTransitionGeneration
public override string OnCompilerTransitionGeneration(FlowWindow window) {
var functionContainer = window.GetFunctionContainer();
if (functionContainer != null) {
var exit = FlowSystem.GetWindow(functionContainer.functionExitId);
if (exit != null && exit.id == window.id) {
return FlowFunctionsTemplateGenerator.GenerateReturnMethod(this.flowEditor, exit);
}
}
return base.OnCompilerTransitionGeneration(window);
}