mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Cache guys in invul
This commit is contained in:
parent
4499bc3312
commit
a12395b547
@ -4,7 +4,7 @@ using UnityEngine.SceneManagement;
|
|||||||
|
|
||||||
namespace NewHorizons.Handlers
|
namespace NewHorizons.Handlers
|
||||||
{
|
{
|
||||||
internal class InvulnerabilityHandler
|
public static class InvulnerabilityHandler
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used in patches
|
/// Used in patches
|
||||||
@ -32,8 +32,25 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DeathManager GetDeathManager() => GameObject.FindObjectOfType<DeathManager>();
|
private static DeathManager _deathManager;
|
||||||
private static PlayerResources GetPlayerResouces() => GameObject.FindObjectOfType<PlayerResources>();
|
private static DeathManager GetDeathManager()
|
||||||
|
{
|
||||||
|
if (_deathManager == null)
|
||||||
|
{
|
||||||
|
_deathManager = GameObject.FindObjectOfType<DeathManager>();
|
||||||
|
}
|
||||||
|
return _deathManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PlayerResources _playerResources;
|
||||||
|
private static PlayerResources GetPlayerResouces()
|
||||||
|
{
|
||||||
|
if (_playerResources == null)
|
||||||
|
{
|
||||||
|
_playerResources = GameObject.FindObjectOfType<PlayerResources>();
|
||||||
|
}
|
||||||
|
return _playerResources;
|
||||||
|
}
|
||||||
|
|
||||||
static InvulnerabilityHandler()
|
static InvulnerabilityHandler()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user