mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 11:25:55 +00:00
3D Switches
This commit is contained in:
parent
003dde1b7f
commit
cb60226ced
20 changed files with 267 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.Interactables;
|
||||
using Cirno.Scripts.Misc;
|
||||
using Cirno.Scripts.Resources.Events;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
|
@ -32,4 +33,20 @@ public partial class NPC : Area2D, IInteractable
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public Vector2 GetScreenPosition()
|
||||
{
|
||||
if (CameraController.Instance is null)
|
||||
{
|
||||
return this.GlobalPosition;
|
||||
}
|
||||
|
||||
return this.GlobalPosition - CameraController.Instance.GlobalPosition +
|
||||
(GetViewport().GetVisibleRect().Size / 2);
|
||||
}
|
||||
|
||||
public Vector2 GetGlobalPosition2D()
|
||||
{
|
||||
return GetGlobalPosition();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue