Skip to content

Commit

Permalink
0.12.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibodan committed Nov 28, 2018
1 parent fcf736c commit 3cbe939
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CustomAvatar/BeatSaberUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class BeatSaberUtil
private static Transform _originTransform;
private static MainSettingsModel _mainSettingsModel;
private static float _lastPlayerHeight = MainSettingsModel.kDefaultPlayerHeight;
private static PlayerDataModelSO _playerDataModel;

private static MainSettingsModel MainSettingsModel
{
Expand All @@ -31,6 +32,7 @@ static BeatSaberUtil()

private static void SceneManagerOnSceneLoaded(Scene scene, LoadSceneMode mode)
{
_playerDataModel = Resources.FindObjectsOfTypeAll<PlayerDataModelSO>().FirstOrDefault();
var originObject = GameObject.Find("Origin");
if (originObject != null)
{
Expand All @@ -40,7 +42,7 @@ private static void SceneManagerOnSceneLoaded(Scene scene, LoadSceneMode mode)

public static float GetPlayerHeight()
{
var playerHeight = MainSettingsModel == null ? _lastPlayerHeight : MainSettingsModel.playerHeight;
var playerHeight = _playerDataModel == null ? _lastPlayerHeight : _playerDataModel.currentLocalPlayer.playerSpecificSettings.playerHeight;
_lastPlayerHeight = playerHeight;
return playerHeight;
}
Expand Down

0 comments on commit 3cbe939

Please sign in to comment.