您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
32 行
903 B
32 行
903 B
using UnityEngine;
|
|
using Cinemachine;
|
|
using NaughtyAttributes;
|
|
|
|
namespace GameplayIngredients.Actions
|
|
{
|
|
[Callable("Cinemachine", "Misc/ic-cinemachine.png")]
|
|
public class CinemachineSetCameraNoiseAction : ActionBase
|
|
{
|
|
[SerializeField]
|
|
bool useLiveCamera;
|
|
[SerializeField, HideIf("useLiveCamera")]
|
|
CinemachineVirtualCameraBase targetCamera;
|
|
|
|
public override void Execute(GameObject instigator = null)
|
|
{
|
|
CinemachineVirtualCameraBase cam = useLiveCamera ?
|
|
Manager.Get<VirtualCameraManager>().GetComponent<CinemachineBrain>().ActiveVirtualCamera as CinemachineVirtualCameraBase
|
|
: targetCamera;
|
|
|
|
if(cam == null)
|
|
{
|
|
Debug.Log("CinemachineSetCameraNoiseAction : Cannot find a suitable Camera to set noise");
|
|
return;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|