Compare commits

...

5 Commits

Author SHA1 Message Date
Stedd f7ae5d6549 Merge remote-tracking branch 'origin/Dev/ScriptableObjectsRefactor' into Dev/ScriptableObjectsRefactor
# Conflicts:
#	Assets/Entities/Scripts/EntityBase.cs
#	Assets/Entities/Scripts/PowerBase.cs
#	Assets/Entities/Structures/Scripts/StructureBase.cs
2024-10-05 15:39:14 +02:00
Stedd 9e0304fe93 Fixed bug in PowerBase initialization 2024-10-05 15:35:58 +02:00
Stedd 53560fcc6b Nicer syntax for adding components if null 2024-10-05 15:34:39 +02:00
Stedd b9d9e52c49 Disabled OpenGL for linux 2024-10-05 15:31:57 +02:00
Stedd 37d0e02368 Updated unity 2024-10-05 15:24:41 +02:00
9 changed files with 92 additions and 57 deletions

@ -1 +1 @@
Subproject commit b031ed3db7b4a08253cf5fcf25059ad299fddaa0 Subproject commit 4005878930047e686a5efbd876ebee4cb3d97442

View File

@ -15,7 +15,6 @@ namespace AsteroidGame.Entities
[Header("UI")] [Header("UI")]
[SerializeField] protected string _uiFriendlyName; [SerializeField] protected string _uiFriendlyName;
#region Props #region Props
public string UiFriendlyName => _uiFriendlyName; public string UiFriendlyName => _uiFriendlyName;
@ -30,17 +29,15 @@ namespace AsteroidGame.Entities
AssignDamageable(); AssignDamageable();
} }
private void InitializeDamageable() private void InitializeDamageable()
{ {
if (Damageable != null) return; Damageable ??= gameObject.AddComponent<Damageable>();
Damageable = gameObject.AddComponent<Damageable>();
} }
private void InitializeTargetable() private void InitializeTargetable()
{ {
if (Targetable != null) return; Targetable ??= gameObject.AddComponent<Targetable>();
Targetable = gameObject.AddComponent<Targetable>();
} }
private void AssignDamageable() private void AssignDamageable()

View File

@ -1,7 +1,3 @@
//using AsteroidGame.ScriptableObjects;
using System;
using AsteroidGame.ScriptableObjects;
using GameDev.CoreSystems; using GameDev.CoreSystems;
using UnityEngine; using UnityEngine;
@ -17,7 +13,7 @@ namespace AsteroidGame.Entities
[SerializeField] private SoPowerSystemRuntimeSet _powerBaseSet; [SerializeField] private SoPowerSystemRuntimeSet _powerBaseSet;
public void SetConfig(SoPowerConfig config) public void Initialize(SoPowerConfig config)
{ {
_isGenerator = config.isGenerator; _isGenerator = config.isGenerator;
_isConsumer = config.isConsumer; _isConsumer = config.isConsumer;
@ -26,11 +22,6 @@ namespace AsteroidGame.Entities
_powerBaseSet.Add(this); _powerBaseSet.Add(this);
} }
private void OnEnable()
{
_powerBaseSet.Add(this);
}
private void OnDisable() private void OnDisable()
{ {
_powerBaseSet.Remove(this); _powerBaseSet.Remove(this);

View File

@ -1,3 +1,4 @@
using AsteroidGame.ScriptableObjects;
using GameDev.CoreSystems; using GameDev.CoreSystems;
using UnityEngine; using UnityEngine;
@ -32,8 +33,8 @@ namespace AsteroidGame.Entities
private void InitializePower() private void InitializePower()
{ {
_power = gameObject.AddComponent<PowerBase>(); _power ??= gameObject.AddComponent<PowerBase>();
_power.SetConfig(_powerConfig); _power.Initialize(_powerConfig);
} }
protected void OnDisable() protected void OnDisable()

View File

@ -38,7 +38,6 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 262.33694, g: 325.04984, b: 430.2193, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@ -336,7 +335,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8704396752535238434, guid: 534f8d15e0c83c646887bebfda2bdfd6, type: 3} - target: {fileID: 8704396752535238434, guid: 534f8d15e0c83c646887bebfda2bdfd6, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
@ -1043,7 +1042,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5599539567497807159, guid: 4af571b983b23f94f8d5ca4dbda27de5, type: 3} - target: {fileID: 5599539567497807159, guid: 4af571b983b23f94f8d5ca4dbda27de5, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
@ -1486,6 +1485,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Version: 11
m_ObsoleteShadowResolutionTier: 1
m_ObsoleteUseShadowQualitySettings: 0
m_ObsoleteCustomShadowResolution: 512
m_ObsoleteContactShadows: 0
m_PointlightHDType: 0
m_SpotLightShape: 0
m_AreaLightShape: 0
m_Intensity: 100000 m_Intensity: 100000
m_EnableSpotReflector: 1 m_EnableSpotReflector: 1
m_LuxAtDistance: 1 m_LuxAtDistance: 1
@ -1588,14 +1595,6 @@ MonoBehaviour:
m_AreaLightEmissiveMeshShadowCastingMode: 0 m_AreaLightEmissiveMeshShadowCastingMode: 0
m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
m_AreaLightEmissiveMeshLayer: -1 m_AreaLightEmissiveMeshLayer: -1
m_Version: 11
m_ObsoleteShadowResolutionTier: 1
m_ObsoleteUseShadowQualitySettings: 0
m_ObsoleteCustomShadowResolution: 512
m_ObsoleteContactShadows: 0
m_PointlightHDType: 0
m_SpotLightShape: 0
m_AreaLightShape: 0
--- !u!4 &2079460687 stripped --- !u!4 &2079460687 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 8324879816836607384, guid: 534f8d15e0c83c646887bebfda2bdfd6, type: 3} m_CorrespondingSourceObject: {fileID: 8324879816836607384, guid: 534f8d15e0c83c646887bebfda2bdfd6, type: 3}
@ -1653,6 +1652,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Turret value: Turret
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8704396752535238434, guid: 534f8d15e0c83c646887bebfda2bdfd6, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
@ -1966,6 +1969,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: PowerPlant value: PowerPlant
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1134055636167264334, guid: 57a75520298c47140a928041b05d7f3c, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []

View File

@ -10,6 +10,7 @@
"com.unity.test-framework": "1.1.33", "com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6", "com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.5", "com.unity.timeline": "1.7.5",
"com.unity.toolchain.linux-x86_64": "2.0.9",
"com.unity.ugui": "1.0.0", "com.unity.ugui": "1.0.0",
"com.unity.ui": "2.0.0", "com.unity.ui": "2.0.0",
"com.unity.ui.builder": "2.0.0", "com.unity.ui.builder": "2.0.0",

View File

@ -10,11 +10,12 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.burst": { "com.unity.burst": {
"version": "1.8.8", "version": "1.8.18",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.mathematics": "1.2.1" "com.unity.mathematics": "1.2.1",
"com.unity.modules.jsonserialize": "1.0.0"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
@ -37,18 +38,18 @@
"depth": 0, "depth": 0,
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.ide.visualstudio": "2.0.18", "com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.rider": "3.0.24", "com.unity.ide.rider": "3.0.31",
"com.unity.ide.vscode": "1.2.5", "com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0", "com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.2.2", "com.unity.performance.profile-analyzer": "1.2.2",
"com.unity.test-framework": "1.1.33", "com.unity.test-framework": "1.1.33",
"com.unity.testtools.codecoverage": "1.2.4" "com.unity.testtools.codecoverage": "1.2.6"
} }
}, },
"com.unity.ide.rider": { "com.unity.ide.rider": {
"version": "3.0.25", "version": "3.0.31",
"depth": 0, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.ext.nunit": "1.0.6" "com.unity.ext.nunit": "1.0.6"
@ -56,8 +57,8 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.ide.visualstudio": { "com.unity.ide.visualstudio": {
"version": "2.0.21", "version": "2.0.22",
"depth": 0, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.test-framework": "1.1.9" "com.unity.test-framework": "1.1.9"
@ -95,7 +96,7 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.render-pipelines.core": { "com.unity.render-pipelines.core": {
"version": "14.0.8", "version": "14.0.11",
"depth": 1, "depth": 1,
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
@ -111,23 +112,23 @@
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.mathematics": "1.2.4", "com.unity.mathematics": "1.2.4",
"com.unity.burst": "1.8.4", "com.unity.burst": "1.8.9",
"com.unity.modules.video": "1.0.0", "com.unity.modules.video": "1.0.0",
"com.unity.modules.animation": "1.0.0", "com.unity.modules.animation": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrain": "1.0.0",
"com.unity.render-pipelines.core": "14.0.8", "com.unity.render-pipelines.core": "14.0.11",
"com.unity.shadergraph": "14.0.8", "com.unity.shadergraph": "14.0.11",
"com.unity.visualeffectgraph": "14.0.8", "com.unity.visualeffectgraph": "14.0.11",
"com.unity.render-pipelines.high-definition-config": "14.0.8" "com.unity.render-pipelines.high-definition-config": "14.0.11"
} }
}, },
"com.unity.render-pipelines.high-definition-config": { "com.unity.render-pipelines.high-definition-config": {
"version": "14.0.8", "version": "14.0.11",
"depth": 1, "depth": 1,
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.render-pipelines.core": "14.0.8" "com.unity.render-pipelines.core": "14.0.11"
} }
}, },
"com.unity.searcher": { "com.unity.searcher": {
@ -145,14 +146,30 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.shadergraph": { "com.unity.shadergraph": {
"version": "14.0.8", "version": "14.0.11",
"depth": 1, "depth": 1,
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.render-pipelines.core": "14.0.8", "com.unity.render-pipelines.core": "14.0.11",
"com.unity.searcher": "4.9.2" "com.unity.searcher": "4.9.2"
} }
}, },
"com.unity.sysroot": {
"version": "2.0.10",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.9",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": { "com.unity.test-framework": {
"version": "1.1.33", "version": "1.1.33",
"depth": 0, "depth": 0,
@ -165,7 +182,7 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.testtools.codecoverage": { "com.unity.testtools.codecoverage": {
"version": "1.2.4", "version": "1.2.6",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
@ -188,13 +205,23 @@
"depth": 0, "depth": 0,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.director": "1.0.0", "com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0", "com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0" "com.unity.modules.particlesystem": "1.0.0"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.toolchain.linux-x86_64": {
"version": "2.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": { "com.unity.ugui": {
"version": "1.0.0", "version": "1.0.0",
"depth": 0, "depth": 0,
@ -217,12 +244,12 @@
"dependencies": {} "dependencies": {}
}, },
"com.unity.visualeffectgraph": { "com.unity.visualeffectgraph": {
"version": "14.0.8", "version": "14.0.11",
"depth": 1, "depth": 1,
"source": "builtin", "source": "builtin",
"dependencies": { "dependencies": {
"com.unity.shadergraph": "14.0.8", "com.unity.shadergraph": "14.0.11",
"com.unity.render-pipelines.core": "14.0.8" "com.unity.render-pipelines.core": "14.0.11"
} }
}, },
"com.unity.modules.ai": { "com.unity.modules.ai": {

View File

@ -48,6 +48,7 @@ PlayerSettings:
defaultScreenHeightWeb: 600 defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0 m_StereoRenderingPath: 0
m_ActiveColorSpace: 1 m_ActiveColorSpace: 1
unsupportedMSAAFallback: 0
m_SpriteBatchVertexThreshold: 300 m_SpriteBatchVertexThreshold: 300
m_MTRendering: 1 m_MTRendering: 1
mipStripping: 0 mipStripping: 0
@ -75,6 +76,7 @@ PlayerSettings:
androidMinimumWindowWidth: 400 androidMinimumWindowWidth: 400
androidMinimumWindowHeight: 300 androidMinimumWindowHeight: 300
androidFullscreenMode: 1 androidFullscreenMode: 1
androidAutoRotationBehavior: 1
defaultIsNativeResolution: 1 defaultIsNativeResolution: 1
macRetinaSupport: 1 macRetinaSupport: 1
runInBackground: 1 runInBackground: 1
@ -82,6 +84,7 @@ PlayerSettings:
muteOtherAudioSources: 0 muteOtherAudioSources: 0
Prepare IOS For Recording: 0 Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0 Force IOS Speakers When Recording: 0
audioSpatialExperience: 0
deferSystemGesturesMode: 0 deferSystemGesturesMode: 0
hideHomeButton: 0 hideHomeButton: 0
submitAnalytics: 1 submitAnalytics: 1
@ -135,6 +138,8 @@ PlayerSettings:
vulkanEnableLateAcquireNextImage: 0 vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1 vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0 loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 0.1 bundleVersion: 0.1
preloadedAssets: preloadedAssets:
- {fileID: 11400000, guid: 2f27ffbbbd54d9c4b9435071982af520, type: 2} - {fileID: 11400000, guid: 2f27ffbbbd54d9c4b9435071982af520, type: 2}
@ -148,6 +153,7 @@ PlayerSettings:
isWsaHolographicRemotingEnabled: 0 isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0 enableFrameTimingStats: 0
enableOpenGLProfilerGPURecorders: 1 enableOpenGLProfilerGPURecorders: 1
allowHDRDisplaySupport: 0
useHDRDisplay: 0 useHDRDisplay: 0
hdrBitDepth: 0 hdrBitDepth: 0
m_ColorGamuts: 00000000 m_ColorGamuts: 00000000
@ -156,7 +162,8 @@ PlayerSettings:
resetResolutionOnWindowResize: 0 resetResolutionOnWindowResize: 0
androidSupportedAspectRatio: 1 androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1 androidMaxAspectRatio: 2.1
applicationIdentifier: {} applicationIdentifier:
Standalone: com.DefaultCompany.AsteroidGame
buildNumber: buildNumber:
Standalone: 0 Standalone: 0
VisionOS: 0 VisionOS: 0
@ -228,6 +235,7 @@ PlayerSettings:
iOSMetalForceHardShadows: 0 iOSMetalForceHardShadows: 0
metalEditorSupport: 1 metalEditorSupport: 1
metalAPIValidation: 1 metalAPIValidation: 1
metalCompileShaderBinary: 0
iOSRenderExtraFrameOnPause: 0 iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0 iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID: appleDeveloperTeamID:
@ -341,6 +349,9 @@ PlayerSettings:
- m_BuildTarget: WebGLSupport - m_BuildTarget: WebGLSupport
m_APIs: 0b000000 m_APIs: 0b000000
m_Automatic: 1 m_Automatic: 1
- m_BuildTarget: LinuxStandaloneSupport
m_APIs: 1100000015000000
m_Automatic: 0
m_BuildTargetVRSettings: m_BuildTargetVRSettings:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
m_Enabled: 0 m_Enabled: 0
@ -414,7 +425,6 @@ PlayerSettings:
switchScreenResolutionBehavior: 2 switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0 switchUseCPUProfiler: 0
switchEnableFileSystemTrace: 0 switchEnableFileSystemTrace: 0
switchUseGOLDLinker: 0
switchLTOSetting: 0 switchLTOSetting: 0
switchApplicationID: 0x01004b9000490000 switchApplicationID: 0x01004b9000490000
switchNSODependencies: switchNSODependencies:
@ -544,7 +554,6 @@ PlayerSettings:
switchSocketBufferEfficiency: 4 switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1 switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0 switchUseNewStyleFilepaths: 0
switchUseLegacyFmodPriorities: 0 switchUseLegacyFmodPriorities: 0
switchUseMicroSleepForYield: 1 switchUseMicroSleepForYield: 1
@ -707,6 +716,7 @@ PlayerSettings:
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0 metroSplashScreenUseBackgroundColor: 0
syncCapabilities: 0
platformCapabilities: {} platformCapabilities: {}
metroTargetDeviceFamilies: {} metroTargetDeviceFamilies: {}
metroFTAName: metroFTAName:

View File

@ -7,6 +7,7 @@ VFXManager:
m_CopyBufferShader: {fileID: 7200000, guid: 23c51f21a3503f6428b527b01f8a2f4e, type: 3} m_CopyBufferShader: {fileID: 7200000, guid: 23c51f21a3503f6428b527b01f8a2f4e, type: 3}
m_SortShader: {fileID: 7200000, guid: ea257ca3cfb12a642a5025e612af6b2a, type: 3} m_SortShader: {fileID: 7200000, guid: ea257ca3cfb12a642a5025e612af6b2a, type: 3}
m_StripUpdateShader: {fileID: 7200000, guid: 8fa6c4009fe2a4d4486c62736fc30ad8, type: 3} m_StripUpdateShader: {fileID: 7200000, guid: 8fa6c4009fe2a4d4486c62736fc30ad8, type: 3}
m_EmptyShader: {fileID: 4800000, guid: 33a2079f6a2db4c4eb2e44b33f4ddf6b, type: 3}
m_RenderPipeSettingsPath: m_RenderPipeSettingsPath:
m_FixedTimeStep: 0.016666668 m_FixedTimeStep: 0.016666668
m_MaxDeltaTime: 0.05 m_MaxDeltaTime: 0.05