Пример #1
0
 public void RemoveValue(BlackboardObject value)
 {
     ((BlackBoardGraph)graph).I_BlackboardValues.Remove(value);
     if (Application.isPlaying)
     {
         Destroy(value);
     }
 }
        public static BlackboardObject Create(string Name, Type type, object Value)
        {
            BlackboardObject o = CreateInstance <BlackboardObject>();

            o.name  = Name;
            o.Type  = type;
            o.Value = Value;

            return(o);
        }
Пример #3
0
        public static BlackboardVariableInstance Create(BlackboardObject value, BlackBoardGraph graph)
        {
            Node.graphHotfix = graph;
            Undo.RecordObject(graph, "Create Blackboard Value Instance");
            BlackboardVariableInstance node = CreateInstance <BlackboardVariableInstance>();

            node.value = value;
            node.graph = graph;
            if (node.name == null || node.name.Trim() == "")
            {
                node.name = NodeEditorUtilities.NodeDefaultName(typeof(BlackboardVariableInstance));
            }
            node.AddDynamicOutput(value.Type, ConnectionType.Multiple, TypeConstraint.InheritedInverse, "ValueOut");
            node.AddDynamicInput(value.Type, ConnectionType.Override, TypeConstraint.Inherited, "ValueIn");
            graph.nodes.Add(node);
            Undo.RegisterCreatedObjectUndo(node, "Create Blackboard Value Instance");
            AssetDatabase.AddObjectToAsset(node, graph);
            return(node);
        }
Пример #4
0
 public virtual BlackboardObject AddValue(BlackboardObject value)
 {
     value.Blackboard = this;
     ((BlackBoardGraph)graph).I_BlackboardValues.Add(value);
     return(value);
 }