IsInGameOrLobby
This commit is contained in:
@@ -7,5 +7,22 @@
|
|||||||
OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>();
|
OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>();
|
||||||
return optionsHelpers.inGame;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user