Esempio n. 1
0
        void TestExtractMacro(IEnumerable <IGraphElementModel> toExtract, IO inputs, IO outputs)
        {
            MacroRefNodeModel macroRef = GraphModel.ExtractNodesAsMacro(m_MacroGraphModel, Vector2.zero, toExtract);

            Assert.That(macroRef.GraphAssetModel.GraphModel, Is.EqualTo(m_MacroGraphModel));

            inputs.Check(m_MacroGraphModel, macroRef.InputVariablePorts.ToList(), ModifierFlags.ReadOnly);
            outputs.Check(m_MacroGraphModel, macroRef.OutputVariablePorts.ToList(), ModifierFlags.WriteOnly);

            CompilationResult compilationResult = GraphModel.Compile(AssemblyType.None, GraphModel.CreateTranslator(), CompilationOptions.Default);

            Assert.That(
                compilationResult.status,
                Is.EqualTo(CompilationStatus.Succeeded));
            Debug.Log(compilationResult.sourceCode[0]);
        }