mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-06 03:05:53 +00:00
Navigation and shooting modules
This commit is contained in:
parent
ef6c240e8e
commit
5a6d31e2f0
8 changed files with 229 additions and 11 deletions
|
|
@ -35,7 +35,9 @@ public partial class PlayerDetectionModule : Area2D
|
|||
|
||||
public bool IsPlayerInRange(float range)
|
||||
{
|
||||
if (!GameManager.Instance?.PlayerPosition.HasValue ?? false)
|
||||
if (GameManager.Instance is null) return false;
|
||||
|
||||
if (!GameManager.Instance.PlayerPosition.HasValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -45,8 +47,9 @@ public partial class PlayerDetectionModule : Area2D
|
|||
|
||||
public bool IsPlayerInSight()
|
||||
{
|
||||
if (GameManager.Instance is null) return false;
|
||||
//if (_cachedPlayer == null) return false;
|
||||
if (!GameManager.Instance?.PlayerPosition.HasValue ?? false) return false;
|
||||
if (!GameManager.Instance.PlayerPosition.HasValue) return false;
|
||||
|
||||
var spaceState = GetWorld2D().DirectSpaceState;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue