7 Commits

Author SHA1 Message Date
5667884f75 Merge branch 'main' into feature-enemy-behavior
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-19 15:13:12 -05:00
c5e0375731 add personal dev scene (#27)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Fixes #25.

Co-authored-by: Branden J Brown <zephyrtronium@gmail.com>
Reviewed-on: #27
Reviewed-by: madxmike <madxmike@noreply.localhost>
2023-08-19 15:12:09 -05:00
ec2ede72ed simplify runtime set access
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 21:54:48 -05:00
db7559cd16 initial work on enemy behavior
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-08-16 15:17:32 -05:00
ad725ee518 refactor: unify runtime sets, update naming of event channels (#17)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Some general refactors:
Turns HeroPartySO into a runtime set class.
Make runtime set an IEnumerable
Simplify name of events

Reviewed-on: #17
Reviewed-by: zephyr <zephyr@noreply.localhost>
Co-authored-by: Michael <mep053@gmail.com>
Co-committed-by: Michael <mep053@gmail.com>
2023-08-12 22:26:36 -05:00
7b48612c4b Implement wave based spawning of enemies #11
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Implements basic waves of enemies that spawn. #11

Reviewed-on: #16
Reviewed-by: zephyr <zephyr@noreply.localhost>
Co-authored-by: Michael <mep053@gmail.com>
Co-committed-by: Michael <mep053@gmail.com>
2023-08-10 16:24:42 -05:00
a67aee24aa party (#15)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Resolves #6.
Updates #3.

Co-authored-by: Branden J Brown <zephyrtronium@gmail.com>
Reviewed-on: #15
Reviewed-by: madxmike <madxmike@noreply.localhost>
2023-08-07 11:34:42 -05:00
52 changed files with 1499 additions and 45 deletions

View File

@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

8
Assets/EventChannels.meta generated Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 243302c56bf8926489fe86e5626dd4d3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
Assets/EventChannels/EndSpawnWave.asset generated Normal file
View File

@@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 908e283bf3a54c859a0771fd8aed7bce, type: 3}
m_Name: EndSpawnWave
m_EditorClassIdentifier:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b8a8049e92364834ebac76909a03324b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 908e283bf3a54c859a0771fd8aed7bce, type: 3}
m_Name: StartSpawnWave
m_EditorClassIdentifier:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3f9039af54fd5d240b144e1ab3bbeb72
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -50,7 +50,7 @@ MonoBehaviour:
level: 0
xp: 0
attrs: {fileID: 0}
party: {fileID: 11400000, guid: c9a46588e6ec04d4d91bb80fdffd7869, type: 2}
_party: {fileID: 11400000, guid: 2fdb3d0bb73994d4ba32eb41950b8f15, type: 2}
--- !u!1 &4632618406133265053
GameObject:
m_ObjectHideFlags: 0

8
Assets/Runtime Sets.meta generated Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57024de5f8ad4f74ba5d83bb062a7612
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f1e329a7f6343f88553db21ffb55693, type: 3}
m_Name: ActiveEnemyRuntimeSet
m_EditorClassIdentifier:
Items: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c32c32e039cdda409e8a56d2e320f2d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

15
Assets/Runtime Sets/PlayerParty.asset generated Normal file
View File

@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ec1a0df7a5949a2959596c722680f76, type: 3}
m_Name: PlayerParty
m_EditorClassIdentifier:
items: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2fdb3d0bb73994d4ba32eb41950b8f15
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

311
Assets/Scenes/ZephyrDev.unity generated Normal file
View File

@@ -0,0 +1,311 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641275, b: 0.5748172, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &908666545
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 908666548}
- component: {fileID: 908666547}
- component: {fileID: 908666546}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &908666546
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 908666545}
m_Enabled: 1
--- !u!20 &908666547
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 908666545}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &908666548
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 908666545}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1497259212
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1497259214}
- component: {fileID: 1497259213}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1497259213
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1497259212}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1497259214
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1497259212}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}

7
Assets/Scenes/ZephyrDev.unity.meta generated Normal file
View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1d308f2ef17118e4fa742eb845bbad04
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

128
Assets/Scenes/test.unity generated
View File

@@ -497,6 +497,73 @@ MonoBehaviour:
cameraController: {fileID: 1176001025}
rotationSensitivity: 100
zoomSensitivity: 0.05
--- !u!1 &880655848
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 880655850}
- component: {fileID: 880655849}
- component: {fileID: 880655851}
m_Layer: 0
m_Name: LevelDirector
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &880655849
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 880655848}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bb718e52728142e4a8db081fd6a36a70, type: 3}
m_Name:
m_EditorClassIdentifier:
startNewSpawnWaveEvent: {fileID: 11400000, guid: 3f9039af54fd5d240b144e1ab3bbeb72, type: 2}
endSpawnWaveEventEvent: {fileID: 11400000, guid: b8a8049e92364834ebac76909a03324b, type: 2}
activeEnemies: {fileID: 11400000, guid: 7c32c32e039cdda409e8a56d2e320f2d, type: 2}
spawnCenter: {fileID: 19609788}
minimumSpawnRadius: 10
timeBetweenClearedWaves: 0
timeBeforeFirstWave: 0
--- !u!4 &880655850
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 880655848}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &880655851
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 880655848}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a91533ae182d470c88ce779956713e02, type: 3}
m_Name:
m_EditorClassIdentifier:
waveSpawner: {fileID: 880655849}
spawnWaves:
- {fileID: 11400000, guid: e7512725c2f0b3148bd090141c5eed5d, type: 2}
--- !u!1 &1038072789
GameObject:
m_ObjectHideFlags: 0
@@ -685,3 +752,64 @@ Transform:
m_Father: {fileID: 1176001024}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &5742654212719732323
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6229410894397123332, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_Name
value: TestEnemy
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 200dea255585b154f8222e550c23b55e, type: 3}

8
Assets/Scriptables/Waves.meta generated Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 409432f90c2931d49a55a87ded944aa9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52673fed940f4a67b5a08641a55feff6, type: 3}
m_Name: SpawnPack_Test
m_EditorClassIdentifier:
possibleEnemies:
- {fileID: 7321161463868935016, guid: 200dea255585b154f8222e550c23b55e, type: 3}
- {fileID: 1158114420728610952, guid: 9dff131d77697b242ae2e2b68aa7e1db, type: 3}
minCount: 30
maxCount: 50

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 970a884aa40996749b022ebb2765d769
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 17a69c35e3e64b6d9f655533478f9772, type: 3}
m_Name: SpawnWave_Test
m_EditorClassIdentifier:
packs:
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
- {fileID: 11400000, guid: 970a884aa40996749b022ebb2765d769, type: 2}
distribution: 2
radius: 50
packRadius: 7
timeBetweenSpawns: 0.01
timeBetweenPacks: 0.1
timeToComplete: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e7512725c2f0b3148bd090141c5eed5d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

181
Assets/Scripts/Enemy.cs Normal file
View File

@@ -0,0 +1,181 @@
using RuntimeSet;
using UnityEngine;
using UnityEngine.Assertions;
namespace DefaultNamespace
{
public class Enemy : MonoBehaviour
{
private enum BehaviorState
{
Create,
Spawning,
Chasing,
Attacking,
Feared,
Dead,
}
[SerializeField] private EnemyAttributesSO attributes;
[SerializeField] private EnemyRuntimeSetSO enemySet;
[SerializeField] private HeroUnitRuntimeSetSO heroSet;
[SerializeField] private GameObject target;
// TODO(zeph): Having behavior as a serialized member is convenient for
// experimentation early on so we can change it mid-play through the
// inspector, but later we'll more likely want it to be a property.
[SerializeField] private BehaviorState _behavior = BehaviorState.Spawning;
[SerializeField] private float _behaviorTime = 0;
[SerializeField] private float _fear = 0;
[SerializeField] private long _hp;
private void Update()
{
// When the current behavior indicates movement, we do it in Update
// to ensure it is smooth at all framerates.
if (_behavior != BehaviorState.Chasing && _behavior != BehaviorState.Feared)
{
// No movement.
return;
}
if (target == null)
{
// No target. Find a new one.
Retarget();
return;
}
// TODO(zeph): how do we actually,, get SPD attribute
var spd = SpaceSpeed(1000, Time.deltaTime);
var to = Vector3.MoveTowards(transform.position, target.transform.position, spd);
if (_behavior == BehaviorState.Feared)
{
// Move away rather than toward.
// TODO(zeph): this will limit speed moving away by distance
// to target if we're close
to = transform.position - 2 * (transform.position - to);
}
transform.position = to;
}
private void FixedUpdate()
{
// We do behavior changes in the fixed update so that enemy actions
// do not depend on the framerate. Since movement happens in
// Update, the overall effect as framerate varies is that enemies
// might change their behaviors at slightly different distances,
// but they'll always be in a given state for the same duration.
// TODO(zeph): we could probably do this with coroutines instead,
// also i still haven't read anything about the actual fsm system
_behaviorTime += Time.fixedDeltaTime;
float dd;
switch (_behavior)
{
case BehaviorState.Create:
// TODO(zeph): calculate starting hp from CON attribute
_hp = 1;
SetBehavior(BehaviorState.Spawning);
break;
case BehaviorState.Spawning:
// TODO(zeph): move spawn time to an asset
if (_behaviorTime >= 0.5)
{
Retarget();
SetBehavior(BehaviorState.Chasing);
}
break;
case BehaviorState.Chasing:
dd = SquareDistanceToTarget();
// TODO(zeph): RNG attribute
if (dd <= SpaceRange(20000))
{
SetBehavior(BehaviorState.Attacking);
}
break;
case BehaviorState.Attacking:
dd = SquareDistanceToTarget();
if (dd > SpaceRange(20000))
{
SetBehavior(BehaviorState.Chasing);
}
break;
case BehaviorState.Feared:
if (_behaviorTime > _fear)
{
SetBehavior(BehaviorState.Chasing);
}
break;
case BehaviorState.Dead:
// do nothing
break;
default:
// TODO(zeph): unreachable
break;
}
if (_behavior != BehaviorState.Dead && _hp == 0)
{
SetBehavior(BehaviorState.Dead);
// TODO(zeph): put a dead time constant somewhere
Destroy(gameObject, 10f);
}
}
private void OnEnable()
{
Assert.IsNotNull(enemySet);
enemySet.Add(this);
}
private void OnDisable()
{
enemySet.Remove(this);
}
private void Retarget()
{
if (heroSet.IsEmpty)
{
// No heroes to target.
// TODO(zeph): switch to a special behavior?
target = null;
return;
}
// TODO(zeph): target based on threat, once threat exists
var k = Random.Range(0, heroSet.Count);
target = heroSet[k].gameObject;
}
private void SetBehavior(BehaviorState behavior)
{
_behavior = behavior;
_behaviorTime = 0;
}
private float SquareDistanceToTarget()
{
return Vector3.Magnitude(transform.position - target.transform.position);
}
public void Fear(float dur)
{
// If the enemy is already feared for a longer duration, don't
// shorten it.
if (_behavior == BehaviorState.Feared && _fear - _behaviorTime >= dur)
{
return;
}
_fear = dur;
SetBehavior(BehaviorState.Feared);
}
private static float SpaceSpeed(long spd, float dt)
{
// For now, treat SPD as units of ten thousandths of a unit per second.
return (spd / 10000) * dt;
}
private static float SpaceRange(long rng)
{
// Treat RNG as units of ten thousandths of a sqrt-meter.
return rng / 10000;
}
}
}

3
Assets/Scripts/Enemy.cs.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0ce366659158473783c8d53d2f3fc5f5
timeCreated: 1690856221

3
Assets/Scripts/Events.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5741392326404cb387003f002d90acee
timeCreated: 1690857552

View File

@@ -0,0 +1,17 @@
using UnityEngine;
using UnityEngine.Events;
using Wave;
namespace Events
{
[CreateAssetMenu(menuName = "Events/Spawn Wave Event")]
public class SpawnWaveEventSO : ScriptableObject
{
public event UnityAction<SpawnWaveSO> OnEventRaised;
public void RaiseEvent(SpawnWaveSO spawnWave)
{
OnEventRaised?.Invoke(spawnWave);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 908e283bf3a54c859a0771fd8aed7bce
timeCreated: 1690857571

View File

@@ -1,16 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
[CreateAssetMenu(fileName = "HeroParty", menuName = "Hero Party")]
public class HeroPartySO : ScriptableObject
{
[SerializeField]
private List<HeroUnit> unitList = new List<HeroUnit>();
public ReadOnlyCollection<HeroUnit> UnitList => unitList.AsReadOnly();
public void Add(HeroUnit unit) { unitList.Add(unit); }
public void Remove(HeroUnit unit) { unitList.Remove(unit); }
public int Count => unitList.Count;
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f0603cf6e7f1d884e89c3eb6a478a96c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.CompilerServices;
using RuntimeSet;
using UnityEngine;
using UnityEngine.Assertions;
[assembly: InternalsVisibleTo("TestsPlaymode")]
/// <summary>
@@ -16,21 +16,17 @@ public class HeroUnit : MonoBehaviour
[SerializeField] private long level;
[SerializeField] private long xp;
[SerializeField] private HeroAttributesSO attrs;
[SerializeField] private HeroPartySO party;
[SerializeField] private HeroUnitRuntimeSetSO _party;
internal HeroUnitRuntimeSetSO party => _party;
private void OnEnable()
{
// NOTE(zeph): Party is mandatory. If none is set, we want an exception.
party.Add(this);
Assert.IsNotNull(_party);
_party.Add(this);
}
private void OnDisable()
{
party.Remove(this);
}
internal HeroPartySO getParty()
{
return party;
_party.Remove(this);
}
}

3
Assets/Scripts/Level.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eb1638a1c58a4878adf9166dddc40738
timeCreated: 1690927890

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using Wave;
namespace Level
{
public class LevelDirector : MonoBehaviour
{
[SerializeField] private WaveSpawner waveSpawner;
[SerializeField] private List<SpawnWaveSO> spawnWaves;
private void Start()
{
waveSpawner.Begin(spawnWaves);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a91533ae182d470c88ce779956713e02
timeCreated: 1690927896

3
Assets/Scripts/RuntimeSet.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e9f6f30f3d8e4445a4a25d03245b2645
timeCreated: 1691632737

View File

@@ -0,0 +1,10 @@
using DefaultNamespace;
using UnityEngine;
namespace RuntimeSet
{
[CreateAssetMenu(fileName = "EnemyRuntimeSet",menuName = "Runtime Set/Enemy")]
public class EnemyRuntimeSetSO : RuntimeSetSO<Enemy>
{
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5f1e329a7f6343f88553db21ffb55693
timeCreated: 1690858329

View File

@@ -0,0 +1,9 @@
using UnityEngine;
namespace RuntimeSet
{
[CreateAssetMenu(fileName = "EnemyRuntimeSet",menuName = "Runtime Set/Hero Unit")]
public class HeroUnitRuntimeSetSO : RuntimeSetSO<HeroUnit>
{
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0ec1a0df7a5949a2959596c722680f76
timeCreated: 1691632762

View File

@@ -0,0 +1,43 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RuntimeSet
{
public abstract class RuntimeSetSO<T> : ScriptableObject, IEnumerable<T>
{
[HideInInspector] [SerializeField] private List<T> items = new();
protected IReadOnlyCollection<T> Items => items;
public bool IsEmpty => items.Count == 0;
public int Count => items.Count;
public void Add(T item)
{
if (!items.Contains(item))
{
items.Add(item);
}
}
public void Remove(T item)
{
if (items.Contains(item))
{
items.Remove(item);
}
}
public IEnumerator<T> GetEnumerator()
{
return items.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public T this[int index] { get { return items[index]; } }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 942f0916a83b433891dd4c6a9bbb50fd
timeCreated: 1690858304

3
Assets/Scripts/Wave.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6515ffdab88e4d23b8f09dace4a2157a
timeCreated: 1690921607

View File

@@ -0,0 +1,9 @@
namespace Wave
{
public enum SpawnDistribution
{
Uniform,
Random,
DiskRandom
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2a4df8269a27463eaf87da9ae1283dcb
timeCreated: 1690925288

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DefaultNamespace;
using UnityEngine;
using UnityEngine.Assertions;
namespace Wave
{
[CreateAssetMenu(fileName = "SpawnPack", menuName = "Spawn/Pack", order = 0)]
public class SpawnPackSO : ScriptableObject
{
[SerializeField] private List<Enemy> possibleEnemies;
[SerializeField] [Min(0)] private int minCount;
[SerializeField] [Min(0)] private int maxCount;
public ReadOnlyCollection<Enemy> EnemiesToSpawn()
{
Assert.IsTrue(possibleEnemies.Count > 0);
var count = Random.Range(minCount, maxCount);
var enemiesToSpawn = new List<Enemy>();
for (var i = 0; i < count; i++)
{
var enemyIndex = Random.Range(0, possibleEnemies.Count);
enemiesToSpawn.Add(possibleEnemies[enemyIndex]);
}
return enemiesToSpawn.AsReadOnly();
}
}
}

3
Assets/Scripts/Wave/SpawnPackSO.cs.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 52673fed940f4a67b5a08641a55feff6
timeCreated: 1690938542

View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
namespace Wave
{
[CreateAssetMenu(fileName = "SpawnWave", menuName = "Spawn/Wave", order = 0)]
public class SpawnWaveSO : ScriptableObject
{
[SerializeField] private List<SpawnPackSO> packs;
[SerializeField] private SpawnDistribution distribution;
[SerializeField] [Min(10)] private float radius;
[SerializeField] [Min(0)] private float packRadius;
[SerializeField] [Min(0)] private float timeBetweenSpawns;
[SerializeField] [Min(0)] private float timeBetweenPacks;
[SerializeField] [Min(0)] private float timeToComplete;
public IReadOnlyCollection<SpawnPackSO> Packs => packs;
public SpawnDistribution Distribution => distribution;
public float Radius => radius;
public float PackRadius => packRadius;
public float TimeBetweenSpawns => timeBetweenSpawns;
public float TimeBetweenPacks => timeBetweenPacks;
public float TimeToComplete => timeToComplete;
}
}

3
Assets/Scripts/Wave/SpawnWaveSO.cs.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 17a69c35e3e64b6d9f655533478f9772
timeCreated: 1690856578

View File

@@ -0,0 +1,121 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DefaultNamespace;
using Events;
using RuntimeSet;
using UnityEngine;
using UnityEngine.Assertions;
using Random = UnityEngine.Random;
namespace Wave
{
public class WaveSpawner : MonoBehaviour
{
[SerializeField] private SpawnWaveEventSO startNewSpawnWaveEventChannel;
[SerializeField] private SpawnWaveEventSO endSpawnWaveEventChannel;
[SerializeField] private EnemyRuntimeSetSO enemyRuntimeSet;
[SerializeField] private Transform spawnCenter;
[SerializeField] private float minimumSpawnRadius;
[SerializeField] [Min(0)] private float timeBetweenClearedWaves;
[SerializeField] [Min(0)] private float timeBeforeFirstWave;
private float _timeSinceLastSpawnWaveStarted;
private Coroutine _handleSpawnWaves;
private bool HasWaveBeenCleared => enemyRuntimeSet.IsEmpty;
public void Begin(IEnumerable<SpawnWaveSO> spawnWaves)
{
Assert.IsNull(_handleSpawnWaves);
_handleSpawnWaves = StartCoroutine(CO_HandleSpawnWaves(spawnWaves));
}
public void End()
{
StopCoroutine(_handleSpawnWaves);
}
private IEnumerator CO_HandleSpawnWaves(IEnumerable<SpawnWaveSO> spawnWaves)
{
yield return new WaitForSeconds(timeBeforeFirstWave);
foreach (var spawnWave in spawnWaves)
{
startNewSpawnWaveEventChannel.RaiseEvent(spawnWave);
yield return SpawnWave(spawnWave);
_timeSinceLastSpawnWaveStarted = 0.0f;
yield return new WaitUntil(() => _timeSinceLastSpawnWaveStarted >= spawnWave.TimeToComplete || HasWaveBeenCleared);
endSpawnWaveEventChannel.RaiseEvent(spawnWave);
if (HasWaveBeenCleared)
{
yield return new WaitForSeconds(timeBetweenClearedWaves);
}
}
}
private IEnumerator SpawnWave(SpawnWaveSO spawnWave)
{
var enemyPacksToSpawn = spawnWave.Packs.Select(pack => pack.EnemiesToSpawn()).ToList().AsReadOnly();
for (var packN = 0; packN < enemyPacksToSpawn.Count; packN++)
{
var waveCompletionPercentage = (float)packN / (float)enemyPacksToSpawn.Count;
var enemyPackSpawnOffset = SampleSpawnOffset(spawnWave.Distribution, spawnWave.Radius, waveCompletionPercentage);
enemyPackSpawnOffset += enemyPackSpawnOffset.normalized * (minimumSpawnRadius + spawnWave.PackRadius);
var enemyPackSpawnPosition = spawnCenter.position + enemyPackSpawnOffset;
var enemyPackToSpawn = enemyPacksToSpawn[packN];
for (var enemyN = 0; enemyN < enemyPackToSpawn.Count; enemyN++)
{
var packCompletionPercentage = (float)enemyN / (float)enemyPackToSpawn.Count;
var enemySpawnOffset = SampleSpawnOffset(SpawnDistribution.DiskRandom, spawnWave.PackRadius, packCompletionPercentage);
var enemySpawnPosition = enemyPackSpawnPosition + enemySpawnOffset;
var spawnedEnemy = Instantiate(enemyPackToSpawn[enemyN], enemySpawnPosition, Quaternion.identity);
enemyRuntimeSet.Add(spawnedEnemy);
if (spawnWave.TimeBetweenSpawns > 0.0f)
{
yield return new WaitForSeconds(spawnWave.TimeBetweenSpawns);
}
}
if (spawnWave.TimeBetweenPacks > 0.0f)
{
yield return new WaitForSeconds(spawnWave.TimeBetweenPacks);
}
}
}
private static Vector3 SampleSpawnOffset(SpawnDistribution distribution, float radius, float completionPercentage)
{
// TODO (Michael): Both the pack and enemy position samplers need to be a bit smarter. I think in most scenarios the pack circle just needs to not overlap with other pack circles.
// The enemy spawns probably need something like a poission disk sampler so that monsters dont overlap. The enemy spawn radius at the pack's position should also probably scale with the size of the pack.
var angle = completionPercentage * 2 * MathF.PI;
var unitCirclePosition = Random.insideUnitCircle;
var swizzledUnitCirclePosition = new Vector3(unitCirclePosition.x, 0, unitCirclePosition.y);
return distribution switch
{
SpawnDistribution.Uniform => new Vector3(Mathf.Cos(angle), 0, Mathf.Sin(angle)) * radius,
SpawnDistribution.Random => swizzledUnitCirclePosition.normalized * radius,
SpawnDistribution.DiskRandom => swizzledUnitCirclePosition * radius,
_ => throw new ArgumentOutOfRangeException(nameof(distribution), distribution, null)
};
}
private void Update()
{
_timeSinceLastSpawnWaveStarted += Time.deltaTime;
}
}
}

3
Assets/Scripts/Wave/WaveSpawner.cs.meta generated Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bb718e52728142e4a8db081fd6a36a70
timeCreated: 1690856916

179
Assets/TestEnemy Variant.prefab generated Normal file
View File

@@ -0,0 +1,179 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8302155952709515973
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7488072351778741751}
- component: {fileID: 3366913879355185749}
- component: {fileID: 1785543729989221829}
- component: {fileID: 1100616685365383236}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7488072351778741751
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302155952709515973}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4279102732078913915}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3366913879355185749
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302155952709515973}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1785543729989221829
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302155952709515973}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!136 &1100616685365383236
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302155952709515973}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &8470021174966258656
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6229410894397123332, guid: 200dea255585b154f8222e550c23b55e, type: 3}
propertyPath: m_Name
value: TestEnemy Variant
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 6791948486170648146, guid: 200dea255585b154f8222e550c23b55e, type: 3}
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
insertIndex: -1
addedObject: {fileID: 7488072351778741751}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 200dea255585b154f8222e550c23b55e, type: 3}
--- !u!4 &4279102732078913915 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5686324643192967835, guid: 200dea255585b154f8222e550c23b55e, type: 3}
m_PrefabInstance: {fileID: 8470021174966258656}
m_PrefabAsset: {fileID: 0}

7
Assets/TestEnemy Variant.prefab.meta generated Normal file
View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9dff131d77697b242ae2e2b68aa7e1db
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

152
Assets/TestEnemy.prefab generated Normal file
View File

@@ -0,0 +1,152 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6229410894397123332
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5686324643192967835}
- component: {fileID: 7321161463868935016}
m_Layer: 0
m_Name: TestEnemy
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5686324643192967835
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6229410894397123332}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 572175646573100614}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7321161463868935016
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6229410894397123332}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ce366659158473783c8d53d2f3fc5f5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &6791948486170648146
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 572175646573100614}
- component: {fileID: 2871351465463266601}
- component: {fileID: 4344212730668217775}
- component: {fileID: 9190027053535473730}
m_Layer: 0
m_Name: Model
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &572175646573100614
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791948486170648146}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5686324643192967835}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2871351465463266601
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791948486170648146}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &4344212730668217775
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791948486170648146}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!135 &9190027053535473730
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6791948486170648146}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}

7
Assets/TestEnemy.prefab.meta generated Normal file
View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 200dea255585b154f8222e550c23b55e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEditor;
using UnityEngine;
@@ -14,11 +13,10 @@ public class HeroPartyTest
Assert.IsNotNull(prefab);
var instance = Object.Instantiate(prefab);
var hero = instance.GetComponent<HeroUnit>();
var party = hero.getParty();
yield return null;
Assert.AreEqual(1, party.Count);
Assert.AreEqual(1, hero.party.Count);
Object.Destroy(instance);
yield return null;
Assert.IsEmpty(party.UnitList);
Assert.IsEmpty(hero.party);
}
}