private void TurnDisplayOff() { if (IsBeingDeleted) { return; } if (_marineMonitorDisplay != null) { _marineMonitorDisplay.ShutDownDisplay(); Destroy(_marineMonitorDisplay); _marineMonitorDisplay = null; } }
private void TurnDisplayOn() { try { if (IsBeingDeleted) { return; } if (_marineMonitorDisplay != null) { Log.Info("Turnoff"); TurnDisplayOff(); } _marineMonitorDisplay = gameObject.AddComponent <MarineMoniterDisplay>(); _marineMonitorDisplay.Setup(this); } catch (Exception e) { Log.Error($"Error in TurnDisplayOn Method: {e.Message} || {e.InnerException} || {e.Source}"); } }