46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System.Linq;
|
|
using Godot;
|
|
|
|
namespace KarrotStarterTemplate.Common.CameraController;
|
|
|
|
[Tool]
|
|
|
|
public partial class CharacterCameraController : Node3D
|
|
{
|
|
|
|
public override string[] _GetConfigurationWarnings()
|
|
{
|
|
SpringArm3D checkSpringArm = GetChildren().OfType<SpringArm3D>().FirstOrDefault();
|
|
|
|
if (checkSpringArm == null)
|
|
{
|
|
return ["No SpringArm3D found"];
|
|
}
|
|
else
|
|
{
|
|
Camera3D checkCamera = checkSpringArm.GetChildren().OfType<Camera3D>().FirstOrDefault();
|
|
if (checkCamera == null)
|
|
{
|
|
return ["No Camera3D (inside camera) found"];
|
|
}
|
|
}
|
|
|
|
return [];
|
|
}
|
|
//
|
|
// public override void _Notification(int what)
|
|
// {
|
|
// switch ((long)what)
|
|
// {
|
|
// case NotificationChildOrderChanged:
|
|
// if (Engine.IsEditorHint())
|
|
// {
|
|
// UpdateConfigurationWarnings();
|
|
// }
|
|
//
|
|
// break;
|
|
// }
|
|
// }
|
|
|
|
}
|