/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Flow/Framework/Graph/GetGraph.cs
39 строк
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using UnityEngine; namespace Unity.VisualScripting { [UnitCategory("Graphs/Graph Nodes")] public abstract class GetGraph<TGraph, TGraphAsset, TMachine> : Unit where TGraph : class, IGraph, new() where TGraphAsset : Macro<TGraph> where TMachine : Machine<TGraph, TGraphAsset> { /// <summary> /// The GameObject to retrieve the graph from. /// </summary> [DoNotSerialize] [PortLabelHidden] [NullMeansSelf] public ValueInput gameObject { get; protected set; } /// <summary> /// The graph that is set on the GameObject. /// </summary> [DoNotSerialize] [PortLabel("Graph")] [PortLabelHidden] public ValueOutput graphOutput { get; protected set; } protected override void Definition() { gameObject = ValueInput<GameObject>(nameof(gameObject), null).NullMeansSelf(); graphOutput = ValueOutput(nameof(graphOutput), Get); } TGraphAsset Get(Flow flow) { var go = flow.GetValue<GameObject>(gameObject); return go.GetComponent<TMachine>().nest.macro; } } }