using System; using Unity.VisualScripting; using UnityEngine; using Cinemachine; [UnitCategory("Custom")] public class TriggerExitNode : Unit { [DoNotSerialize] public ControlInput enter { get; private set; } [DoNotSerialize] public ControlOutput exit { get; private set; } protected override void Definition() { enter = ControlInput("enter", (flow) => { // Get the current game object var gameObject = flow.stack.gameObject; // Set the priority of the Virtual Camera to 10 var vcam = gameObject.transform.GetChild(0).GetComponent(); if (vcam != null) { vcam.Priority = 0; } return exit; // Continue execution }); exit = ControlOutput("exit"); Succession(enter, exit); } }