I just started to experiment with events. This error sometimes happens when I exit play mode in the editor.
NullReferenceException: Object reference not set to an instance of an object
PlayerController.OnDisable () (at Assets/Scripts/PlayerController.cs:176)
PlayerController Script:
Unsubscribing Event NullReferenceException
NullReferenceException: Object reference not set to an instance of an object
PlayerController.OnDisable () (at Assets/Scripts/PlayerController.cs:176)
PlayerController Script:
Code (CSharp):
- private void OnEnable()
- {
- GameGraphics.Instance.OnFOVChange += HandleCameraFOV;
- OnFallGroundHard += PlayHit;...