您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
36 行
923 B
36 行
923 B
using System;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using Cinemachine;
|
|
|
|
[UnitCategory("Custom")]
|
|
public class TriggerEnterNode : 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 = 10;
|
|
}
|
|
|
|
return exit; // Continue execution
|
|
});
|
|
|
|
exit = ControlOutput("exit");
|
|
|
|
Succession(enter, exit);
|
|
}
|
|
}
|