Files
DevourClient/DevourClient/Helpers/StateHelper.cs
2022-07-22 12:55:13 +03:00

43 lines
1.0 KiB
C#
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
namespace DevourClient.Helpers
{
public class Player
{
public static bool IsInGame()
{
OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>();
return optionsHelpers.inGame;
}
public static bool IsInGameOrLobby()
{
return GetPlayer() != null;
}
public static NolanBehaviour GetPlayer()
{
foreach (NolanBehaviour nb in UnityEngine.Object.FindObjectsOfType<NolanBehaviour>())
{
if (nb.entity.IsOwner)
{
return nb;
}
}
return null;
}
public static bool IsPlayerCrawling()
{
NolanBehaviour nb = Player.GetPlayer();
if (nb.IsCrawling())
{
return true;
}
return false;
}
}
}