adding basic wave tracking and enemy spawning - needs some more work done
This commit is contained in:
8
Assets/Prefabs/Enemies.meta
Normal file
8
Assets/Prefabs/Enemies.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cefb5a60c2cc5224bba59fb87bf9554d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
64
Assets/Prefabs/Enemies/test_enemy_1.prefab
Normal file
64
Assets/Prefabs/Enemies/test_enemy_1.prefab
Normal file
@@ -0,0 +1,64 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7151223122468485113
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7151223122468485111}
|
||||
- component: {fileID: 7151223122468485110}
|
||||
- component: {fileID: 7151223122468485108}
|
||||
m_Layer: 0
|
||||
m_Name: test_enemy_1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7151223122468485111
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.6516533, y: 0.17, z: 0.85}
|
||||
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!114 &7151223122468485110
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: de3c419c34f77c346be26a8da3df1b8c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
baseScore: 0
|
||||
patterns: 0100000002000000
|
||||
CurrentPattern: 0
|
||||
scoreMultiplier: 0.5
|
||||
--- !u!65 &7151223122468485108
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
7
Assets/Prefabs/Enemies/test_enemy_1.prefab.meta
Normal file
7
Assets/Prefabs/Enemies/test_enemy_1.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f720b0ddae4a2c54ab009ecd39b0bd15
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
64
Assets/Prefabs/Enemies/test_enemy_2.prefab
Normal file
64
Assets/Prefabs/Enemies/test_enemy_2.prefab
Normal file
@@ -0,0 +1,64 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7151223122468485113
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7151223122468485111}
|
||||
- component: {fileID: 7151223122468485110}
|
||||
- component: {fileID: 7151223122468485108}
|
||||
m_Layer: 0
|
||||
m_Name: test_enemy_2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &7151223122468485111
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.6516533, y: 0.17, z: 0.85}
|
||||
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!114 &7151223122468485110
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: de3c419c34f77c346be26a8da3df1b8c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
baseScore: 0
|
||||
patterns: 02000000
|
||||
CurrentPattern: 0
|
||||
scoreMultiplier: 0.1
|
||||
--- !u!65 &7151223122468485108
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7151223122468485113}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
7
Assets/Prefabs/Enemies/test_enemy_2.prefab.meta
Normal file
7
Assets/Prefabs/Enemies/test_enemy_2.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1b988fb025cb6247a35f93647369354
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -508,6 +508,7 @@ MonoBehaviour:
|
||||
playerHealthLabel: {fileID: 1307309473}
|
||||
gameOverLabel: {fileID: 733797117}
|
||||
scoreLabel: {fileID: 71873946}
|
||||
waveLabel: {fileID: 1089069509}
|
||||
restartButton: {fileID: 145060169}
|
||||
--- !u!4 &286668900
|
||||
Transform:
|
||||
@@ -873,6 +874,37 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: c6b0d13b6229fd44d8fb78d64fddbb88, type: 3}
|
||||
--- !u!1 &867645525
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 867645526}
|
||||
m_Layer: 0
|
||||
m_Name: enemy_holder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &867645526
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 867645525}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 363.55103, y: 437.60477, z: 46.816406}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 13
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &897246687
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1104,6 +1136,7 @@ RectTransform:
|
||||
- {fileID: 733797116}
|
||||
- {fileID: 145060168}
|
||||
- {fileID: 71873945}
|
||||
- {fileID: 1089069507}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -5958,6 +5991,141 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
player: {fileID: 1153618773}
|
||||
--- !u!1 &1089069506
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1089069507}
|
||||
- component: {fileID: 1089069508}
|
||||
- component: {fileID: 1089069509}
|
||||
m_Layer: 5
|
||||
m_Name: Wave
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1089069507
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1089069506}
|
||||
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: 920563117}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -102}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &1089069508
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1089069506}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1089069509
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1089069506}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Wave
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!1 &1153618772
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6488,68 +6656,6 @@ MonoBehaviour:
|
||||
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_DeselectOnBackgroundClick: 1
|
||||
m_PointerBehavior: 0
|
||||
--- !u!1 &2006521495
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2006521497}
|
||||
- component: {fileID: 2006521496}
|
||||
- component: {fileID: 2006521498}
|
||||
m_Layer: 0
|
||||
m_Name: gfdhfgchgfjh
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2006521496
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006521495}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: de3c419c34f77c346be26a8da3df1b8c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
baseScore: 0
|
||||
patterns: 0100000002000000
|
||||
CurrentPattern: 0
|
||||
scoreMultiplier: 0.5
|
||||
--- !u!4 &2006521497
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006521495}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 1.6516533, y: 0.17, z: 0.85}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 12
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!65 &2006521498
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006521495}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2036477788
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6583,12 +6689,34 @@ MonoBehaviour:
|
||||
wave: 0
|
||||
enemiesConsumed: 0
|
||||
settings: {fileID: 0}
|
||||
userInterfaceManager: {fileID: 0}
|
||||
userInterfaceManager: {fileID: 286668899}
|
||||
musicManager: {fileID: 0}
|
||||
player: {fileID: 0}
|
||||
player: {fileID: 1153618773}
|
||||
pickups: []
|
||||
pickupDelay: 0
|
||||
scoreMultiplier: 1.2
|
||||
waves:
|
||||
- enemies:
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- enemies:
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- enemies:
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: f720b0ddae4a2c54ab009ecd39b0bd15, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
- {fileID: 7151223122468485110, guid: d1b988fb025cb6247a35f93647369354, type: 3}
|
||||
enemyHolder: {fileID: 867645525}
|
||||
--- !u!4 &2036477790
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6621,7 +6749,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6172981237138491607, guid: 0678182139845e7448149b383c283783, type: 3}
|
||||
propertyPath: m_RootOrder
|
||||
value: 13
|
||||
value: 12
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6172981237138491607, guid: 0678182139845e7448149b383c283783, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
|
||||
@@ -123,6 +123,141 @@ NavMeshSettings:
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &71873944
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 71873945}
|
||||
- component: {fileID: 71873947}
|
||||
- component: {fileID: 71873946}
|
||||
m_Layer: 5
|
||||
m_Name: Score
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &71873945
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 71873944}
|
||||
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: 920563117}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -51}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &71873946
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 71873944}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Score
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &71873947
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 71873944}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &85715037
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -372,6 +507,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
playerHealthLabel: {fileID: 1307309473}
|
||||
gameOverLabel: {fileID: 733797117}
|
||||
scoreLabel: {fileID: 71873946}
|
||||
restartButton: {fileID: 145060169}
|
||||
--- !u!4 &286668900
|
||||
Transform:
|
||||
@@ -967,6 +1103,7 @@ RectTransform:
|
||||
- {fileID: 1307309472}
|
||||
- {fileID: 733797116}
|
||||
- {fileID: 145060168}
|
||||
- {fileID: 71873945}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 7
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -6118,11 +6255,11 @@ RectTransform:
|
||||
m_Father: {fileID: 920563117}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -388, y: 251}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &1307309473
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6361,6 +6498,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 2006521497}
|
||||
- component: {fileID: 2006521496}
|
||||
- component: {fileID: 2006521498}
|
||||
m_Layer: 0
|
||||
m_Name: gfdhfgchgfjh
|
||||
m_TagString: Untagged
|
||||
@@ -6383,6 +6521,7 @@ MonoBehaviour:
|
||||
baseScore: 0
|
||||
patterns: 0100000002000000
|
||||
CurrentPattern: 0
|
||||
scoreMultiplier: 0.5
|
||||
--- !u!4 &2006521497
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6398,6 +6537,19 @@ Transform:
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 12
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!65 &2006521498
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006521495}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 1
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2036477788
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -6436,7 +6588,7 @@ MonoBehaviour:
|
||||
player: {fileID: 0}
|
||||
pickups: []
|
||||
pickupDelay: 0
|
||||
scoreMultiplier: 0
|
||||
scoreMultiplier: 1.2
|
||||
--- !u!4 &2036477790
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
[System.Serializable]
|
||||
public class Wave
|
||||
{
|
||||
public List<Enemy> enemies;
|
||||
}
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
[Header("Stats")]
|
||||
@@ -19,10 +26,17 @@ public class GameManager : MonoBehaviour
|
||||
public float pickupDelay;
|
||||
public float scoreMultiplier;
|
||||
|
||||
public List<Wave> waves;
|
||||
public GameObject enemyHolder;
|
||||
private Wave currentWave;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
|
||||
|
||||
StartWave();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -31,13 +45,48 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
public void StartWave()
|
||||
{
|
||||
Wave current = waves[wave];
|
||||
if (current != null)
|
||||
{
|
||||
// remove old enemies
|
||||
foreach(Transform child in enemyHolder.transform)
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
enemiesConsumed = 0;
|
||||
|
||||
// spawn the enemies
|
||||
currentWave = current;
|
||||
|
||||
for (int i = 0; i < currentWave.enemies.Count; i++)
|
||||
{
|
||||
// spawn enemies in random positions
|
||||
// TODO: do we really want to do this?
|
||||
float spawnZ = Random.Range(Camera.main.ScreenToWorldPoint(new Vector2(0, 0)).z, Camera.main.ScreenToWorldPoint(new Vector2(0, Screen.height)).z);
|
||||
float spawnX = Random.Range(Camera.main.ScreenToWorldPoint(new Vector2(0, 0)).x, Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, 0)).x);
|
||||
|
||||
Vector3 spawnPos = new Vector3(spawnX, player.gameObject.transform.position.y, spawnZ);
|
||||
|
||||
Instantiate(currentWave.enemies[i].gameObject, spawnPos, Quaternion.identity, enemyHolder.transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void EnemyConsumed(float multiplier = 0)
|
||||
{
|
||||
enemiesConsumed++;
|
||||
|
||||
float incMutliplier = (multiplier > 0) ? multiplier : scoreMultiplier;
|
||||
IncrementScore(10, multiplier);
|
||||
|
||||
score += Mathf.FloorToInt(50 * incMutliplier); // TODO: how do we want this to work exactly?
|
||||
if (enemiesConsumed == currentWave.enemies.Count)
|
||||
{
|
||||
// wave over... start next wave
|
||||
wave++;
|
||||
StartWave();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayerDed()
|
||||
@@ -50,9 +99,10 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
public void IncrementScore(int val)
|
||||
public void IncrementScore(int val, float multiplier = 0)
|
||||
{
|
||||
|
||||
float incMutliplier = (multiplier > 0) ? multiplier : scoreMultiplier;
|
||||
score += Mathf.FloorToInt(50 * incMutliplier); // TODO: how do we want this to work exactly?
|
||||
}
|
||||
|
||||
public void RestartGame()
|
||||
|
||||
@@ -9,6 +9,7 @@ public class UIManager : MonoBehaviour
|
||||
public TextMeshProUGUI playerHealthLabel;
|
||||
public TextMeshProUGUI gameOverLabel;
|
||||
public TextMeshProUGUI scoreLabel;
|
||||
public TextMeshProUGUI waveLabel;
|
||||
|
||||
public Button restartButton;
|
||||
private GameManager gameManager;
|
||||
@@ -27,6 +28,8 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
scoreLabel.text = "Score: " + Mathf.Round(gameManager.score).ToString();
|
||||
|
||||
waveLabel.text = "Wave: " + (gameManager.wave + 1).ToString();
|
||||
|
||||
if (gameManager.player.health <= 0)
|
||||
{
|
||||
gameOverLabel.gameObject.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user