private void OnEnable() { _stateReporter = stateReporter.GetComponent <IARSessionStateReporter>(); _planeManager = GetComponent <ARPlaneManager>(); ARSession.stateChanged += StateChangedEvent; if (_planeManager != null) { _planeManager.planesChanged += PlaneChangedEvent; } }
private void OnValidate() { if (stateReporter == null) { return; } _stateReporter = stateReporter.GetComponent <IARSessionStateReporter>(); if (_stateReporter == null) { stateReporter = null; } }