private void OnEnable() { if (IsBeingDeleted) { return; } if (_runStartUpOnEnable) { if (!IsInitialized) { Initialize(); } if (_data == null) { ReadySaveData(); } if (_fromSave && _data != null) { if (QPatch.Configuration.AllowDamage) { StartCoroutine(SetHeath()); } PowerManager.LoadData(_data); DeepDrillerContainer.LoadData(_data.Items); if (_data.IsFocused) { OreGenerator.SetIsFocus(_data.IsFocused); OreGenerator.Load(_data.FocusOres); } ColorManager.SetMaskColorFromSave(_data.BodyColor.Vector4ToColor()); CurrentBiome = _data.Biome; OilHandler.SetOilTimeLeft(_data.OilTimeLeft); UpgradeManager.Load(_data?.Upgrades); _fromSave = false; } StartCoroutine(TryGetLoot()); _runStartUpOnEnable = false; } }
private void OnEnable() { if (IsBeingDeleted) { return; } if (_runStartUpOnEnable) { if (!IsInitialized) { Initialize(); } if (_saveData == null) { ReadySaveData(); } if (IsFromSave && _saveData != null) { PowerManager.LoadData(_saveData); DeepDrillerContainer.LoadData(_saveData.Items); if (_saveData.IsFocused) { OreGenerator.SetIsFocus(_saveData.IsFocused); OreGenerator.Load(_saveData.FocusOres); } ColorManager.SetMaskColorFromSave(_saveData.BodyColor.Vector4ToColor()); CurrentBiome = _saveData.Biome; OilHandler.SetOilTimeLeft(_saveData.OilTimeLeft); UpgradeManager.Load(_saveData?.Upgrades); OreGenerator.SetBlackListMode(_saveData.IsBlackListMode); _isRangeVisible = _saveData.IsRangeVisible; } StartCoroutine(TryGetLoot()); _runStartUpOnEnable = false; } }