/// <summary> /// This function is called when the behaviour becomes disabled or inactive. /// </summary> void OnDisable() { if (PlayerManager.HasInstance()) { PlayerManager.Instance().onDamaged -= OnDamaged; } if (TopMostControl.HasInstance()) { TopMostControl.Instance().onCameraShake -= CameraShake_Rot; } }
private void OnDestroy() { if (playerStatus != null) { playerStatus.onChangePlayerStatus -= OnChangePlayerStatus; } if (TopMostControl.HasInstance()) { TopMostControl.Instance().onClickGameOverMenu -= OnClickGameOverMenu; } }
private void OnDestroy() { if (flickController != null) { flickController.onPointerUp -= OnPointerUp; flickController.onPointerDown -= OnPointerDown; } if (PlayerManager.HasInstance()) { PlayerManager.Instance().onDeath -= OnDeath; PlayerManager.Instance().onFinishAirTime -= OnFinishAirTime; PlayerManager.Instance().onChangePlayerSkin -= OnChangePlayerSkin; } if (TopMostControl.HasInstance()) { TopMostControl.Instance().onClickReturn -= OnClickReturnButton; TopMostControl.Instance().onClickGameOverMenu -= OnClickGameOverMenu; } }