public void AddNewNode(AIModules.Module mod, BTNode context, Vector2 contextPos) { var todo = BTEditableDO.New <BTAddNode>(this); todo.context = context; todo.position = contextPos; todo.mod = mod; DoEdit(todo); }
private void OnEnable() { if (this == null || target == null || serializedObject == null) { return; } mMod = AIModules.Get(target.GetType()); mComment = serializedObject.FindProperty("m_Comment"); comment = mComment.stringValue; }
string GetServiceName(BTNode node, AIModules.Module mod) { var s = node.Asset as BTServiceAsset; var name = s == null ? null : s.DisplayName; if (string.IsNullOrEmpty(name)) { name = mod.Title; } return(name); }
public BTNodeGUI(BehaviourTreeEditor editor, BTNode asset) : base(editor) { mNode = asset; mAsset = mNode.Asset as BTNodeAsset; mMod = AIModules.Get(asset); color = mMod.color; title = mMod.Title; enableChild = mAsset != null && mAsset.EnableChild; enableParent = mAsset != null; mContext = mNode; mDetail = GetDetail(); BreakToggle = mAsset == null ? false : mAsset.EditorBreakToggle; Resize(); }
bool FoldModule(AIModules.Module mod, bool foldout) { if (mod == null) { return(foldout); } EditorGUILayout.BeginHorizontal((GUIStyle)"IN Title"); foldout = EditorGUILayout.Foldout(foldout, mod.Title, true); EditorGUILayout.EndHorizontal(); if (!string.IsNullOrEmpty(mod.Detail)) { EditorGUILayout.HelpBox(mod.Detail, MessageType.Info); } return(foldout); }
string GetConditionName(BTNode node, AIModules.Module mod) { var n = node.Asset as BTConditionAsset; if (n == null) { return(mod.Title); } var s = n.DisplayName; if (string.IsNullOrEmpty(s)) { s = mod.Title; } return(s); }
public void AddNewNode(AIModules.Module mod) { AddNewNode(mod, mContextNode == null ? null : mContextNode.GetNode(), mContextPos); }