mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
37 lines
No EOL
808 B
C#
37 lines
No EOL
808 B
C#
using Cirno.Scripts.Misc;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Interactables;
|
|
|
|
public partial class Interactable3D : Area3D, IInteractable
|
|
{
|
|
public virtual bool Activate(ActivationType activationType = ActivationType.Toggle)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected virtual bool MeetsRequirements()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public virtual bool CanActivate()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public Vector2 GetGlobalPosition2D()
|
|
{
|
|
return new Vector2(this.GlobalPosition.X, this.GlobalPosition.Z);
|
|
}
|
|
|
|
public Vector2 GetScreenPosition()
|
|
{
|
|
if (CameraController3D.Instance is null)
|
|
{
|
|
return this.GetGlobalPosition2D();
|
|
}
|
|
|
|
return CameraController3D.Instance.UnprojectPosition(this.GlobalPosition);
|
|
}
|
|
} |