Skip to content

Commit

Permalink
First Person Exclusions fixed. Ibodan saves the day once again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Assistant committed Dec 2, 2018
1 parent c77a346 commit 8ba0510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CustomAvatar/FirstPersonExclusion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ private void OnDisable()
Plugin.Instance.FirstPersonEnabledChanged -= OnFirstPersonEnabledChanged;
}

private void OnFirstPersonEnabledChanged(bool firstPersonEnabled)
public void OnFirstPersonEnabledChanged(bool firstPersonEnabled)
{
for (var i = 0; i < Exclude.Length; i++)
{
var excludeObject = Exclude[i];
excludeObject.layer = firstPersonEnabled ? AvatarLayers.OnlyInThirdPerson : _startLayers[i];
excludeObject.layer = AvatarLayers.OnlyInThirdPerson;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions CustomAvatar/PlayerAvatarManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ private void OnFirstPersonEnabledChanged(bool firstPersonEnabled)
if (_currentSpawnedPlayerAvatar == null) return;
AvatarLayers.SetChildrenToLayer(_currentSpawnedPlayerAvatar.GameObject,
firstPersonEnabled ? 0 : AvatarLayers.OnlyInThirdPerson);
foreach (var ex in _currentSpawnedPlayerAvatar.GameObject.GetComponentsInChildren<AvatarScriptPack.FirstPersonExclusion>())
ex.OnFirstPersonEnabledChanged(firstPersonEnabled);
}

private void SceneManagerOnSceneLoaded(Scene newScene, LoadSceneMode mode)
Expand Down

0 comments on commit 8ba0510

Please sign in to comment.