Load static configs from JSON, export build setup
parent
6a8d66d589
commit
2d56273d5a
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: abde7190bfdabb144b4a88431354716b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 401 KiB |
|
@ -0,0 +1,127 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c9e103a72cacde84ab9cd7dfeef678d2
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 125 KiB |
|
@ -0,0 +1,127 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f0c085caebb9eb14985bf3a253e0a5df
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
After Width: | Height: | Size: 228 KiB |
|
@ -0,0 +1,127 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 799154081e756314d8bf09b6c74bcde7
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -82,33 +82,33 @@ MonoBehaviour:
|
|||
m_Textures:
|
||||
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
|
||||
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
|
||||
m_PrefilteringModeMainLightShadows: 1
|
||||
m_PrefilteringModeAdditionalLight: 4
|
||||
m_PrefilteringModeAdditionalLightShadows: 1
|
||||
m_PrefilterXRKeywords: 0
|
||||
m_PrefilteringModeForwardPlus: 1
|
||||
m_PrefilteringModeDeferredRendering: 1
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 1
|
||||
m_PrefilterDebugKeywords: 0
|
||||
m_PrefilterWriteRenderingLayers: 0
|
||||
m_PrefilterHDROutput: 0
|
||||
m_PrefilterSSAODepthNormals: 0
|
||||
m_PrefilterSSAOSourceDepthLow: 0
|
||||
m_PrefilterSSAOSourceDepthMedium: 0
|
||||
m_PrefilterSSAOSourceDepthHigh: 0
|
||||
m_PrefilterSSAOInterleaved: 0
|
||||
m_PrefilterSSAOBlueNoise: 0
|
||||
m_PrefilterSSAOSampleCountLow: 0
|
||||
m_PrefilterSSAOSampleCountMedium: 0
|
||||
m_PrefilterSSAOSampleCountHigh: 0
|
||||
m_PrefilterDBufferMRT1: 0
|
||||
m_PrefilterDBufferMRT2: 0
|
||||
m_PrefilterDBufferMRT3: 0
|
||||
m_PrefilterSoftShadowsQualityLow: 0
|
||||
m_PrefilterSoftShadowsQualityMedium: 0
|
||||
m_PrefilterSoftShadowsQualityHigh: 0
|
||||
m_PrefilteringModeMainLightShadows: 3
|
||||
m_PrefilteringModeAdditionalLight: 3
|
||||
m_PrefilteringModeAdditionalLightShadows: 0
|
||||
m_PrefilterXRKeywords: 1
|
||||
m_PrefilteringModeForwardPlus: 0
|
||||
m_PrefilteringModeDeferredRendering: 0
|
||||
m_PrefilteringModeScreenSpaceOcclusion: 0
|
||||
m_PrefilterDebugKeywords: 1
|
||||
m_PrefilterWriteRenderingLayers: 1
|
||||
m_PrefilterHDROutput: 1
|
||||
m_PrefilterSSAODepthNormals: 1
|
||||
m_PrefilterSSAOSourceDepthLow: 1
|
||||
m_PrefilterSSAOSourceDepthMedium: 1
|
||||
m_PrefilterSSAOSourceDepthHigh: 1
|
||||
m_PrefilterSSAOInterleaved: 1
|
||||
m_PrefilterSSAOBlueNoise: 1
|
||||
m_PrefilterSSAOSampleCountLow: 1
|
||||
m_PrefilterSSAOSampleCountMedium: 1
|
||||
m_PrefilterSSAOSampleCountHigh: 1
|
||||
m_PrefilterDBufferMRT1: 1
|
||||
m_PrefilterDBufferMRT2: 1
|
||||
m_PrefilterDBufferMRT3: 1
|
||||
m_PrefilterSoftShadowsQualityLow: 1
|
||||
m_PrefilterSoftShadowsQualityMedium: 1
|
||||
m_PrefilterSoftShadowsQualityHigh: 1
|
||||
m_PrefilterSoftShadows: 0
|
||||
m_PrefilterScreenCoord: 0
|
||||
m_PrefilterNativeRenderPass: 0
|
||||
m_PrefilterScreenCoord: 1
|
||||
m_PrefilterNativeRenderPass: 1
|
||||
m_ShaderVariantLogLevel: 0
|
||||
m_ShadowCascades: 0
|
||||
|
|
|
@ -322,25 +322,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
_flightPhase: 0
|
||||
_target: {fileID: 0}
|
||||
StaticConfig:
|
||||
accelerationConfig:
|
||||
maxReferenceAcceleration: 300
|
||||
referenceSpeed: 1000
|
||||
boostConfig:
|
||||
boostTime: 0.3
|
||||
boostAcceleration: 350
|
||||
liftDragConfig:
|
||||
liftCoefficient: 0.2
|
||||
dragCoefficient: 0.7
|
||||
liftDragRatio: 5
|
||||
bodyConfig:
|
||||
mass: 0.37
|
||||
crossSectionalArea: 0.0003
|
||||
finArea: 0.0006
|
||||
bodyArea: 0.01
|
||||
hitConfig:
|
||||
hitRadius: 1
|
||||
killProbability: 0.9
|
||||
staticConfigFile: drone_target.json
|
||||
--- !u!54 &4451965530778273955
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -322,25 +322,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
_flightPhase: 0
|
||||
_target: {fileID: 0}
|
||||
StaticConfig:
|
||||
accelerationConfig:
|
||||
maxReferenceAcceleration: 300
|
||||
referenceSpeed: 1000
|
||||
boostConfig:
|
||||
boostTime: 0.3
|
||||
boostAcceleration: 100
|
||||
liftDragConfig:
|
||||
liftCoefficient: 0.2
|
||||
dragCoefficient: 1
|
||||
liftDragRatio: 5
|
||||
bodyConfig:
|
||||
mass: 15.8
|
||||
crossSectionalArea: 0.004
|
||||
finArea: 0.007
|
||||
bodyArea: 0.12
|
||||
hitConfig:
|
||||
hitRadius: 1
|
||||
killProbability: 0.9
|
||||
staticConfigFile: hydra70.json
|
||||
_showDebugVectors: 1
|
||||
_boostAcceleration: {x: 0, y: 0, z: 0}
|
||||
--- !u!54 &3328180170527195603
|
||||
|
|
|
@ -322,25 +322,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
_flightPhase: 0
|
||||
_target: {fileID: 0}
|
||||
StaticConfig:
|
||||
accelerationConfig:
|
||||
maxReferenceAcceleration: 300
|
||||
referenceSpeed: 1000
|
||||
boostConfig:
|
||||
boostTime: 0.3
|
||||
boostAcceleration: 350
|
||||
liftDragConfig:
|
||||
liftCoefficient: 0.2
|
||||
dragCoefficient: 0.7
|
||||
liftDragRatio: 5
|
||||
bodyConfig:
|
||||
mass: 0.37
|
||||
crossSectionalArea: 0.0003
|
||||
finArea: 0.0006
|
||||
bodyArea: 0.01
|
||||
hitConfig:
|
||||
hitRadius: 1
|
||||
killProbability: 0.9
|
||||
staticConfigFile: micromissile.json
|
||||
_showDebugVectors: 1
|
||||
_boostAcceleration: {x: 0, y: 0, z: 0}
|
||||
_navigationGain: 5
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using Unity.PlasticSCM.Editor.UI;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class Agent : MonoBehaviour {
|
||||
|
@ -22,7 +19,9 @@ public abstract class Agent : MonoBehaviour {
|
|||
protected double _timeInPhase = 0;
|
||||
|
||||
[SerializeField]
|
||||
public StaticConfig StaticConfig;
|
||||
public string staticConfigFile = "generic_static_config.json";
|
||||
|
||||
protected StaticConfig _staticConfig;
|
||||
|
||||
// Define delegates
|
||||
public delegate void AgentHitEventHandler(Agent agent);
|
||||
|
@ -130,6 +129,10 @@ public abstract class Agent : MonoBehaviour {
|
|||
protected abstract void UpdateBoost(double deltaTime);
|
||||
protected abstract void UpdateMidCourse(double deltaTime);
|
||||
|
||||
protected virtual void Awake() {
|
||||
_staticConfig = ConfigLoader.LoadStaticConfig(staticConfigFile);
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
protected virtual void Start() {
|
||||
_flightPhase = FlightPhase.READY;
|
||||
|
@ -141,7 +144,7 @@ public abstract class Agent : MonoBehaviour {
|
|||
_timeInPhase += Time.fixedDeltaTime;
|
||||
|
||||
var launch_time = _agentConfig.dynamic_config.launch_config.launch_time;
|
||||
var boost_time = launch_time + StaticConfig.boostConfig.boostTime;
|
||||
var boost_time = launch_time + _staticConfig.boostConfig.boostTime;
|
||||
double elapsedSimulationTime = SimManager.Instance.GetElapsedSimulationTime();
|
||||
|
||||
if (_flightPhase == FlightPhase.TERMINATED) {
|
||||
|
|
|
@ -17,6 +17,20 @@ public static class ConfigLoader {
|
|||
}
|
||||
}
|
||||
|
||||
public static StaticConfig LoadStaticConfig(string configFileName) {
|
||||
string configFilePath = Path.Combine(Application.streamingAssetsPath, "Configs/Models", configFileName);
|
||||
if (File.Exists(configFilePath)) {
|
||||
string json = File.ReadAllText(configFilePath);
|
||||
StaticConfig config = JsonConvert.DeserializeObject<StaticConfig>(json, new JsonSerializerSettings {
|
||||
Converters = { new Newtonsoft.Json.Converters.StringEnumConverter() }
|
||||
});
|
||||
return config;
|
||||
} else {
|
||||
Debug.LogError($"Static configuration file not found at path: {configFilePath}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void PrintSimulationConfig(SimulationConfig config)
|
||||
{
|
||||
if (config == null)
|
||||
|
|
|
@ -1,67 +1,43 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class StaticConfig {
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class AccelerationConfig {
|
||||
[Tooltip("Maximum reference acceleration")]
|
||||
public float maxReferenceAcceleration = 300f;
|
||||
[Tooltip("Reference speed")]
|
||||
public float referenceSpeed = 1000f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class BoostConfig {
|
||||
[Tooltip("Boost time in seconds")]
|
||||
public float boostTime = 0.3f;
|
||||
[Tooltip("Boost acceleration")]
|
||||
public float boostAcceleration = 350f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class LiftDragConfig {
|
||||
[Tooltip("Lift coefficient")]
|
||||
public float liftCoefficient = 0.2f;
|
||||
[Tooltip("Drag coefficient")]
|
||||
public float dragCoefficient = 0.7f;
|
||||
[Tooltip("Lift to drag ratio")]
|
||||
public float liftDragRatio = 5f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class BodyConfig {
|
||||
[Tooltip("Mass in kg")]
|
||||
public float mass = 0.37f;
|
||||
[Tooltip("Cross-sectional area in m²")]
|
||||
public float crossSectionalArea = 3e-4f;
|
||||
[Tooltip("Fin area in m²")]
|
||||
public float finArea = 6e-4f;
|
||||
[Tooltip("Body area in m²")]
|
||||
public float bodyArea = 1e-2f;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
[Serializable]
|
||||
public class HitConfig {
|
||||
[Tooltip("Hit radius")]
|
||||
public float hitRadius = 1f;
|
||||
[Tooltip("Kill probability")]
|
||||
public float killProbability = 0.9f;
|
||||
}
|
||||
|
||||
[Header("Acceleration Configuration")]
|
||||
public AccelerationConfig accelerationConfig;
|
||||
|
||||
[Header("Boost Configuration")]
|
||||
public BoostConfig boostConfig;
|
||||
|
||||
[Header("Lift and Drag Configuration")]
|
||||
public LiftDragConfig liftDragConfig;
|
||||
|
||||
[Header("Body Configuration")]
|
||||
public BodyConfig bodyConfig;
|
||||
|
||||
[Header("Hit Configuration")]
|
||||
public HitConfig hitConfig;
|
||||
}
|
|
@ -120,8 +120,11 @@ public class InputManager : MonoBehaviour
|
|||
void HandleNonLockableInput()
|
||||
{
|
||||
HandleScrollWheelInput();
|
||||
if (Input.GetKeyDown(KeyCode.I))
|
||||
|
||||
if(Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.C))
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ public class Missile : Agent {
|
|||
|
||||
// Calculate boost acceleration
|
||||
float boostAcceleration =
|
||||
(float)(StaticConfig.boostConfig.boostAcceleration * Constants.kGravity);
|
||||
(float)(_staticConfig.boostConfig.boostAcceleration * Constants.kGravity);
|
||||
Vector3 accelerationInput = boostAcceleration * rollAxis;
|
||||
|
||||
// Calculate the total acceleration
|
||||
|
@ -81,7 +81,7 @@ public class Missile : Agent {
|
|||
Agent otherAgent = other.gameObject.GetComponentInParent<Agent>();
|
||||
if (otherAgent != null && otherAgent.GetComponent<Target>() != null) {
|
||||
// Check kill probability before marking as hit
|
||||
float killProbability = StaticConfig.hitConfig.killProbability;
|
||||
float killProbability = _staticConfig.hitConfig.killProbability;
|
||||
GameObject markerObject = Instantiate(Resources.Load<GameObject>("Prefabs/HitMarkerPrefab"),
|
||||
transform.position, Quaternion.identity);
|
||||
if (Random.value <= killProbability) {
|
||||
|
@ -102,8 +102,8 @@ public class Missile : Agent {
|
|||
|
||||
protected float CalculateMaxAcceleration() {
|
||||
float maxReferenceAcceleration =
|
||||
(float)(StaticConfig.accelerationConfig.maxReferenceAcceleration * Constants.kGravity);
|
||||
float referenceSpeed = StaticConfig.accelerationConfig.referenceSpeed;
|
||||
(float)(_staticConfig.accelerationConfig.maxReferenceAcceleration * Constants.kGravity);
|
||||
float referenceSpeed = _staticConfig.accelerationConfig.referenceSpeed;
|
||||
return Mathf.Pow(GetComponent<Rigidbody>().velocity.magnitude / referenceSpeed, 2) *
|
||||
maxReferenceAcceleration;
|
||||
}
|
||||
|
@ -122,9 +122,9 @@ public class Missile : Agent {
|
|||
}
|
||||
|
||||
private float CalculateDrag() {
|
||||
float dragCoefficient = StaticConfig.liftDragConfig.dragCoefficient;
|
||||
float crossSectionalArea = StaticConfig.bodyConfig.crossSectionalArea;
|
||||
float mass = StaticConfig.bodyConfig.mass;
|
||||
float dragCoefficient = _staticConfig.liftDragConfig.dragCoefficient;
|
||||
float crossSectionalArea = _staticConfig.bodyConfig.crossSectionalArea;
|
||||
float mass = _staticConfig.bodyConfig.mass;
|
||||
float dynamicPressure = (float)GetDynamicPressure();
|
||||
float dragForce = dragCoefficient * dynamicPressure * crossSectionalArea;
|
||||
return dragForce / mass;
|
||||
|
@ -133,7 +133,7 @@ public class Missile : Agent {
|
|||
private float CalculateLiftInducedDrag(Vector3 accelerationInput) {
|
||||
float liftAcceleration =
|
||||
(accelerationInput - Vector3.Dot(accelerationInput, transform.up) * transform.up).magnitude;
|
||||
float liftDragRatio = StaticConfig.liftDragConfig.liftDragRatio;
|
||||
float liftDragRatio = _staticConfig.liftDragConfig.liftDragRatio;
|
||||
return Mathf.Abs(liftAcceleration / liftDragRatio);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d896f75c5d864994b9d88c2da1515a52
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"accelerationConfig": {
|
||||
"maxReferenceAcceleration": 300,
|
||||
"referenceSpeed": 1000
|
||||
},
|
||||
"boostConfig": {
|
||||
"boostTime": 0.3,
|
||||
"boostAcceleration": 350
|
||||
},
|
||||
"liftDragConfig": {
|
||||
"liftCoefficient": 0.2,
|
||||
"dragCoefficient": 0.7,
|
||||
"liftDragRatio": 5
|
||||
},
|
||||
"bodyConfig": {
|
||||
"mass": 0.37,
|
||||
"crossSectionalArea": 0.0003,
|
||||
"finArea": 0.0006,
|
||||
"bodyArea": 0.01
|
||||
},
|
||||
"hitConfig": {
|
||||
"hitRadius": 1,
|
||||
"killProbability": 0.9
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1a7820df17edabd4aa31868d2fd396a6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"accelerationConfig": {
|
||||
"maxReferenceAcceleration": 300,
|
||||
"referenceSpeed": 1000
|
||||
},
|
||||
"boostConfig": {
|
||||
"boostTime": 0.3,
|
||||
"boostAcceleration": 100
|
||||
},
|
||||
"liftDragConfig": {
|
||||
"liftCoefficient": 0.2,
|
||||
"dragCoefficient": 1,
|
||||
"liftDragRatio": 5
|
||||
},
|
||||
"bodyConfig": {
|
||||
"mass": 15.8,
|
||||
"crossSectionalArea": 0.004,
|
||||
"finArea": 0.007,
|
||||
"bodyArea": 0.12
|
||||
},
|
||||
"hitConfig": {
|
||||
"hitRadius": 1,
|
||||
"killProbability": 0.9
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3a8f5736c9337c84a9871d02d98bdae2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"accelerationConfig": {
|
||||
"maxReferenceAcceleration": 300,
|
||||
"referenceSpeed": 1000
|
||||
},
|
||||
"boostConfig": {
|
||||
"boostTime": 0.3,
|
||||
"boostAcceleration": 350
|
||||
},
|
||||
"liftDragConfig": {
|
||||
"liftCoefficient": 0.2,
|
||||
"dragCoefficient": 0.7,
|
||||
"liftDragRatio": 5
|
||||
},
|
||||
"bodyConfig": {
|
||||
"mass": 0.37,
|
||||
"crossSectionalArea": 0.0003,
|
||||
"finArea": 0.0006,
|
||||
"bodyArea": 0.01
|
||||
},
|
||||
"hitConfig": {
|
||||
"hitRadius": 1,
|
||||
"killProbability": 0.9
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 54835a0f75efb1041a19e5fa8d9c2de3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -4,5 +4,8 @@
|
|||
EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes: []
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/MainScene.unity
|
||||
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||
m_configObjects: {}
|
||||
|
|
|
@ -12,7 +12,7 @@ PlayerSettings:
|
|||
targetDevice: 2
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
companyName: BAMLAB
|
||||
productName: micromissiles
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
|
@ -92,7 +92,7 @@ PlayerSettings:
|
|||
bakeCollisionMeshes: 0
|
||||
forceSingleInstance: 0
|
||||
useFlipModelSwapchain: 1
|
||||
resizableWindow: 0
|
||||
resizableWindow: 1
|
||||
useMacAppStoreValidation: 0
|
||||
macAppStoreCategory: public.app-category.games
|
||||
gpuSkinning: 1
|
||||
|
@ -103,7 +103,7 @@ PlayerSettings:
|
|||
xboxEnableFitness: 0
|
||||
visibleInBackground: 1
|
||||
allowFullscreenSwitch: 1
|
||||
fullscreenMode: 1
|
||||
fullscreenMode: 3
|
||||
xboxSpeechDB: 0
|
||||
xboxEnableHeadOrientation: 0
|
||||
xboxEnableGuest: 0
|
||||
|
@ -160,7 +160,8 @@ PlayerSettings:
|
|||
resetResolutionOnWindowResize: 0
|
||||
androidSupportedAspectRatio: 1
|
||||
androidMaxAspectRatio: 2.1
|
||||
applicationIdentifier: {}
|
||||
applicationIdentifier:
|
||||
Standalone: com.BAMLAB.micromissiles
|
||||
buildNumber:
|
||||
Standalone: 0
|
||||
VisionOS: 0
|
||||
|
@ -282,7 +283,14 @@ PlayerSettings:
|
|||
AndroidMinifyDebug: 0
|
||||
AndroidValidateAppBundleSize: 1
|
||||
AndroidAppBundleSizeToValidate: 150
|
||||
m_BuildTargetIcons: []
|
||||
m_BuildTargetIcons:
|
||||
- m_BuildTarget:
|
||||
m_Icons:
|
||||
- serializedVersion: 2
|
||||
m_Icon: {fileID: 2800000, guid: 799154081e756314d8bf09b6c74bcde7, type: 3}
|
||||
m_Width: 128
|
||||
m_Height: 128
|
||||
m_Kind: 0
|
||||
m_BuildTargetPlatformIcons: []
|
||||
m_BuildTargetBatching:
|
||||
- m_BuildTarget: Standalone
|
||||
|
|
Loading…
Reference in New Issue