using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System; using Godot; namespace Rokojori { [Tool] [GlobalClass] public partial class PlayCameraEffect:RJAction { [Export] public CameraEffect cameraEffect; [Export] public VirtualCamera3DSlot cameraSlot; [Export] public int cameraSlotIndex = -1; [Export] public RJSelector cameraSlotSelector; public override void _OnTrigger() { var resolvedSlot = cameraSlot; if ( resolvedSlot == null && cameraSlotIndex != -1 ) { var manager = Unique.Get(); if ( cameraSlotIndex != -1 ) { resolvedSlot = manager.GetSlot( cameraSlotIndex ); } else if ( cameraSlotSelector != null ) { resolvedSlot = Selectors.GetFromDirectChildren( manager, cameraSlotSelector ); } } if ( resolvedSlot == null ) { this.LogError( "No camera slot found" ); return; } resolvedSlot.SetCameraEffect( cameraEffect ); } } }