Exemplo n.º 1
0
        // Add edges to virtual methods or after the fact?
        public override void OnMethodCall(MethodDefinition callingContext, MethodReference methodCall,
                                          string callTypeName, string callMethodName, bool isSystem, bool isExternal)
        {
            // Don't include system calls.
            if (isSystem)
            {
                return;
            }

            string contextTypeName = CodeProperties.GetClassName(callingContext.DeclaringType);
            string contextMethName = CodeProperties.GetMethodNameWithParameters(callingContext);

            m_graph.Add(contextTypeName, contextMethName, callTypeName, callMethodName);
        }
Exemplo n.º 2
0
        public static AbstractNode CreateNode(NodeGraph graph, Type nodeType, Vector2 position)
        {
            if (graph == null)
            {
                return(null);
            }

            AbstractNode node = (AbstractNode)ScriptableObject.CreateInstance(nodeType);

            if (node == null)
            {
                return(null);
            }

            node.InitNode();
            node.Position = position;
            graph.Add(node);

            AssetDatabase.AddObjectToAsset(node, graph);
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            return(node);
        }