2025-06-10 13:16:36 +00:00
|
|
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System;
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
{
|
|
|
|
[Tool]
|
|
|
|
[GlobalClass]
|
|
|
|
public partial class SetActiveCamera:CameraSlotSelector
|
|
|
|
{
|
|
|
|
[Export]
|
|
|
|
public VirtualCamera3D virtualCamera;
|
|
|
|
|
2025-06-12 09:03:02 +00:00
|
|
|
[ExportGroup( "Create Slot")]
|
2025-06-10 13:16:36 +00:00
|
|
|
[Export]
|
|
|
|
public bool createSlotIfNotPresent = true;
|
|
|
|
|
2025-06-12 09:03:02 +00:00
|
|
|
[Export]
|
|
|
|
public SelectorFlag[] slotFlags;
|
|
|
|
|
2025-06-10 13:16:36 +00:00
|
|
|
public override VirtualCamera3DSlot GetCameraSlot()
|
|
|
|
{
|
|
|
|
var vm = VirtualCamera3DManager.Get();
|
|
|
|
var slot = vm.GetSlot( virtualCamera );
|
|
|
|
|
|
|
|
if ( slot == null )
|
|
|
|
{
|
|
|
|
slot = vm.CreateChild<VirtualCamera3DSlot>();
|
|
|
|
slot.camera = virtualCamera;
|
2025-06-12 09:03:02 +00:00
|
|
|
slot.flags = slotFlags;
|
2025-06-10 13:16:36 +00:00
|
|
|
|
|
|
|
vm.RefreshSlots();
|
|
|
|
}
|
|
|
|
|
|
|
|
return slot;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|