您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

36 行
921 B

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<CinemachineVirtualCamera>();
if (vcam != null)
{
vcam.Priority = 0;
}
return exit; // Continue execution
});
exit = ControlOutput("exit");
Succession(enter, exit);
}
}