private void ShowNodeMenu(WitResponseNode node, string path) { GenericMenu menu = new GenericMenu(); menu.AddItem(Content.createStringValue, false, () => WitDataCreation.CreateStringValue(path)); menu.AddItem(Content.createIntValue, false, () => WitDataCreation.CreateIntValue(path)); menu.AddItem(Content.createFloatValue, false, () => WitDataCreation.CreateFloatValue(path)); menu.AddSeparator(""); menu.AddItem(Content.copyPath, false, () => { EditorGUIUtility.systemCopyBuffer = path; }); menu.AddItem(Content.copyCode, false, () => { EditorGUIUtility.systemCopyBuffer = WitResultUtilities.GetCodeFromPath(path); }); if (Selection.activeGameObject) { menu.AddSeparator(""); var label = new GUIContent($"Add response matcher to {Selection.activeObject.name}"); menu.AddItem(label, false, () => { var valueHandler = Selection.activeGameObject.AddComponent <WitResponseMatcher>(); valueHandler.intent = response.GetIntentName(); valueHandler.valueMatchers = new ValuePathMatcher[] { new ValuePathMatcher() { path = path } }; }); AddMultiValueUpdateItems(path, menu); } menu.ShowAsContext(); }
public static void WitCreateFloatValue() { WitDataCreation.CreateFloatValue(""); }
public static WitFloatValue CreateFloatValue(string path) { return(WitDataCreation.CreateFloatValue(path)); }