From 6b78b2f70181606ea36d02b462fbf8219a138a26 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 23 Apr 2018 13:50:24 +0200 Subject: [PATCH] Done some more stuff --- Assembly-CSharp.csproj | 1 + Assets/Prefabs/GameController.prefab | 29 +- Assets/Prefabs/Snare Projectile.prefab | 129 ++++ Assets/Prefabs/Snare Projectile.prefab.meta | 8 + Assets/Prefabs/Snare Tower.prefab | 6 +- Assets/Scenes/Game.unity | 20 - Assets/Scenes/Menu.unity | 526 ++++++++++++++- Assets/Scenes/Over.unity | 711 ++++++++++++++++++++ Assets/Scenes/Over.unity.meta | 7 + Assets/Scripts/EnemyStatus.cs | 13 +- Assets/Scripts/GameStatus.cs | 34 +- Assets/Scripts/HatTower.cs | 2 +- Assets/Scripts/LoadSceneOnClick.cs | 5 +- Assets/Scripts/SnareCollision.cs | 23 + Assets/Scripts/SnareCollision.cs.meta | 11 + Assets/Scripts/SnareTower.cs | 9 + Assets/Scripts/TowerPlacer.cs | 37 +- Assets/Scripts/TowerSelector.cs | 6 +- Assets/Sprites/placeholderSquare.png.meta | 2 +- ProjectSettings/EditorBuildSettings.asset | 11 +- ProjectSettings/TagManager.asset | 1 + 21 files changed, 1533 insertions(+), 58 deletions(-) create mode 100644 Assets/Prefabs/Snare Projectile.prefab create mode 100644 Assets/Prefabs/Snare Projectile.prefab.meta create mode 100644 Assets/Scenes/Over.unity create mode 100644 Assets/Scenes/Over.unity.meta create mode 100644 Assets/Scripts/SnareCollision.cs create mode 100644 Assets/Scripts/SnareCollision.cs.meta diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj index ca3d87d..533c643 100644 --- a/Assembly-CSharp.csproj +++ b/Assembly-CSharp.csproj @@ -75,6 +75,7 @@ + diff --git a/Assets/Prefabs/GameController.prefab b/Assets/Prefabs/GameController.prefab index b9bd661..bc72b0d 100644 --- a/Assets/Prefabs/GameController.prefab +++ b/Assets/Prefabs/GameController.prefab @@ -456,7 +456,7 @@ AudioSource: OutputAudioMixerGroup: {fileID: 0} m_audioClip: {fileID: 8300000, guid: d881bbfc851b179449e8de4ef83de168, type: 3} m_PlayOnAwake: 1 - m_Volume: 0.1 + m_Volume: 0.2 m_Pitch: 1 Loop: 1 Mute: 0 @@ -555,6 +555,7 @@ MonoBehaviour: - {fileID: 1353675573854854, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} - {fileID: 1116464442260662, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} - {fileID: 1790912687524718, guid: f84d521163ebde447879f581a32ca118, type: 2} + index: 0 --- !u!114 &114032699107723242 MonoBehaviour: m_ObjectHideFlags: 1 @@ -579,7 +580,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 6 + livesThreshold: 5 --- !u!114 &114135218223358326 MonoBehaviour: m_ObjectHideFlags: 1 @@ -593,7 +594,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 3 + livesThreshold: 8 --- !u!114 &114153136693258118 MonoBehaviour: m_ObjectHideFlags: 1 @@ -621,7 +622,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 7 + livesThreshold: 4 --- !u!114 &114200885624498918 MonoBehaviour: m_ObjectHideFlags: 1 @@ -635,7 +636,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 10 + livesThreshold: 1 --- !u!114 &114264903686440274 MonoBehaviour: m_ObjectHideFlags: 1 @@ -649,7 +650,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 1 + livesThreshold: 10 --- !u!114 &114321963035045996 MonoBehaviour: m_ObjectHideFlags: 1 @@ -663,8 +664,8 @@ MonoBehaviour: m_EditorClassIdentifier: money: 0 lives: 10 + towerCosts: 000000000000000000000000 moneyTextObject: {fileID: 0} - livesTextObject: {fileID: 0} --- !u!114 &114326414913970376 MonoBehaviour: m_ObjectHideFlags: 1 @@ -678,7 +679,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 4 + livesThreshold: 7 --- !u!114 &114438563625650982 MonoBehaviour: m_ObjectHideFlags: 1 @@ -692,7 +693,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 5 + livesThreshold: 6 --- !u!114 &114571896683674368 MonoBehaviour: m_ObjectHideFlags: 1 @@ -718,7 +719,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 2 + livesThreshold: 9 --- !u!114 &114894975149290724 MonoBehaviour: m_ObjectHideFlags: 1 @@ -743,7 +744,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 9 + livesThreshold: 2 --- !u!114 &114924119225117340 MonoBehaviour: m_ObjectHideFlags: 1 @@ -757,7 +758,7 @@ MonoBehaviour: m_EditorClassIdentifier: higherSprite: {fileID: 21300000, guid: 7ba187ba05264f64798e5ccc5a527de6, type: 3} lowerSprite: {fileID: 21300000, guid: baadb80603ed5304eb85af6edc502571, type: 3} - livesThreshold: 8 + livesThreshold: 3 --- !u!212 &212052167362182582 SpriteRenderer: m_ObjectHideFlags: 1 @@ -1112,8 +1113,8 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: -1577246843 + m_SortingLayer: 2 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 44c980550aedaac4793c6e1f95e084bc, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Prefabs/Snare Projectile.prefab b/Assets/Prefabs/Snare Projectile.prefab new file mode 100644 index 0000000..b2805f7 --- /dev/null +++ b/Assets/Prefabs/Snare Projectile.prefab @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 0} + m_RootGameObject: {fileID: 1527219696020318} + m_IsPrefabAsset: 1 +--- !u!1 &1527219696020318 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 6 + m_Component: + - component: {fileID: 4818425248247040} + - component: {fileID: 212666681993251584} + - component: {fileID: 114116277764334902} + - component: {fileID: 61277172879186436} + m_Layer: 0 + m_Name: Snare Projectile + m_TagString: Hit + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4818425248247040 +Transform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1527219696020318} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &61277172879186436 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1527219696020318} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 0.5, y: 0.5} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.5, y: 0.5} + m_EdgeRadius: 0 +--- !u!114 &114116277764334902 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1527219696020318} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12e817cc5c12bdd4bb95e359298b8d56, type: 3} + m_Name: + m_EditorClassIdentifier: + damage: 12 + maxRange: 10 + speed: 8 +--- !u!212 &212666681993251584 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1527219696020318} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 10754, 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_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: -1738644517 + m_SortingLayer: 1 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: d5ff12c405991e8499ef1dda13fcf028, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.5, y: 0.5} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/Prefabs/Snare Projectile.prefab.meta b/Assets/Prefabs/Snare Projectile.prefab.meta new file mode 100644 index 0000000..88cc5c3 --- /dev/null +++ b/Assets/Prefabs/Snare Projectile.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b427938956f96c4c9facb6397680650 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Snare Tower.prefab b/Assets/Prefabs/Snare Tower.prefab index 6fdeb64..391e320 100644 --- a/Assets/Prefabs/Snare Tower.prefab +++ b/Assets/Prefabs/Snare Tower.prefab @@ -38,7 +38,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1790912687524718} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 6, y: -1.5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -177,6 +177,10 @@ MonoBehaviour: m_EditorClassIdentifier: standardSprite: {fileID: 21300000, guid: 507ee0c49799ed2498ae8dad87342cd4, type: 3} alternateSprite: {fileID: 21300000, guid: c3686ecb6c931114082a4e8deac546f7, type: 3} + projectileObject: {fileID: 1527219696020318, guid: 8b427938956f96c4c9facb6397680650, + type: 2} + maxRange: 5 + maxDamage: 12 --- !u!114 &114865138164003484 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 0f92995..5e15179 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -413,26 +413,6 @@ Prefab: propertyPath: moneyTextObject value: objectReference: {fileID: 244445659} - - target: {fileID: 114321963035045996, guid: 75e554cdca74b174b8f51d9615688c48, - type: 2} - propertyPath: livesTextObject - value: - objectReference: {fileID: 0} - - target: {fileID: 114153136693258118, guid: 75e554cdca74b174b8f51d9615688c48, - type: 2} - propertyPath: bpm - value: 120 - objectReference: {fileID: 0} - - target: {fileID: 212503120060765600, guid: 75e554cdca74b174b8f51d9615688c48, - type: 2} - propertyPath: m_SortingLayerID - value: -1577246843 - objectReference: {fileID: 0} - - target: {fileID: 212503120060765600, guid: 75e554cdca74b174b8f51d9615688c48, - type: 2} - propertyPath: m_SortingLayer - value: 2 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 75e554cdca74b174b8f51d9615688c48, type: 2} m_IsPrefabAsset: 0 diff --git a/Assets/Scenes/Menu.unity b/Assets/Scenes/Menu.unity index 4071f12..36d9a2a 100644 --- a/Assets/Scenes/Menu.unity +++ b/Assets/Scenes/Menu.unity @@ -113,6 +113,48 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1001 &5899286 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalPosition.x + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalPosition.y + value: -1.5 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4390904458017506, guid: f84d521163ebde447879f581a32ca118, type: 2} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f84d521163ebde447879f581a32ca118, type: 2} + m_IsPrefabAsset: 0 --- !u!1 &40773579 GameObject: m_ObjectHideFlags: 0 @@ -190,6 +232,325 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &476055946 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 476055947} + - component: {fileID: 476055949} + - component: {fileID: 476055948} + m_Layer: 5 + m_Name: Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &476055947 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 476055946} + 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_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 2 + 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: 7.5, y: 0} + m_SizeDelta: {x: 2, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &476055948 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 476055946} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: X +--- !u!222 &476055949 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 476055946} + m_CullTransparentMesh: 0 +--- !u!1 &697568882 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 1568105291510024, guid: 75e554cdca74b174b8f51d9615688c48, + type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 697568886} + - component: {fileID: 697568885} + - component: {fileID: 697568884} + - component: {fileID: 697568883} + m_Layer: 0 + m_Name: GameController + m_TagString: GameController + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!82 &697568883 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 82404362739563692, guid: 75e554cdca74b174b8f51d9615688c48, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 697568882} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 0.1 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &697568884 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 114321963035045996, guid: 75e554cdca74b174b8f51d9615688c48, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 697568882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: def57d6e144c2bf4d9f47d39dffc1392, type: 3} + m_Name: + m_EditorClassIdentifier: + money: 0 + lives: 10 + towerCosts: 000000000000000000000000 + moneyTextObject: {fileID: 0} +--- !u!114 &697568885 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 114153136693258118, guid: 75e554cdca74b174b8f51d9615688c48, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 697568882} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03535b255b63aaa4b8f4718a4e79b51d, type: 3} + m_Name: + m_EditorClassIdentifier: + bpm: 120 + delay: 0 + songTime: 0 +--- !u!4 &697568886 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 4433814812019978, guid: 75e554cdca74b174b8f51d9615688c48, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 697568882} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &732753365 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalPosition.x + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalPosition.y + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4449562961225802, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8436f60a30d755346a1829fc1154f0a2, type: 2} + m_IsPrefabAsset: 0 +--- !u!1001 &756839715 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalPosition.x + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4473836488108546, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 68f4cf9ed4f721340aec1ee79ef4c967, type: 2} + m_IsPrefabAsset: 0 --- !u!1 &835239383 GameObject: m_ObjectHideFlags: 0 @@ -224,7 +585,7 @@ RectTransform: 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: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0.2} m_SizeDelta: {x: 7.5, y: 3.708} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &835239385 @@ -325,6 +686,156 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8a18338602768f84dbf8f60767c96f58, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &963202459 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 963202460} + - component: {fileID: 963202462} + - component: {fileID: 963202461} + m_Layer: 5 + m_Name: Text (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &963202460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963202459} + 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_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 3 + 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: 7.5, y: -1.5} + m_SizeDelta: {x: 2, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &963202461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963202459} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 0 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: C +--- !u!222 &963202462 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 963202459} + m_CullTransparentMesh: 0 +--- !u!1 &1053050556 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1053050557} + - component: {fileID: 1053050559} + - component: {fileID: 1053050558} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1053050557 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1053050556} + 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_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 1 + 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: 7.5, y: 1.5} + m_SizeDelta: {x: 2, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1053050558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1053050556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 4 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Z +--- !u!222 &1053050559 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1053050556} + m_CullTransparentMesh: 0 --- !u!1 &1080839401 GameObject: m_ObjectHideFlags: 0 @@ -371,7 +882,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 + m_ReferencePixelsPerUnit: 600 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} m_ScreenMatchMode: 0 @@ -379,7 +890,7 @@ MonoBehaviour: m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 + m_DynamicPixelsPerUnit: 600 --- !u!223 &1080839404 Canvas: m_ObjectHideFlags: 0 @@ -411,13 +922,16 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 835239384} + - {fileID: 1053050557} + - {fileID: 476055947} + - {fileID: 963202460} m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 17.75, y: 10} + m_SizeDelta: {x: 17.8, y: 10} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1181808982 GameObject: @@ -479,5 +993,5 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Over.unity b/Assets/Scenes/Over.unity new file mode 100644 index 0000000..264d7b6 --- /dev/null +++ b/Assets/Scenes/Over.unity @@ -0,0 +1,711 @@ +%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: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 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, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 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: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + 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 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &40773579 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 40773582} + - component: {fileID: 40773581} + - component: {fileID: 40773580} + 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 &40773580 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 40773579} + m_Enabled: 1 +--- !u!20 &40773581 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 40773579} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 1, g: 1, b: 1, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + 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: 1 + 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 &40773582 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 40773579} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &379823580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 379823581} + - component: {fileID: 379823583} + - component: {fileID: 379823582} + m_Layer: 5 + m_Name: Score + m_TagString: Score + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &379823581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 379823580} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 1.5, z: 1} + m_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 3 + 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: 0, y: 1} + m_SizeDelta: {x: 11, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &379823582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 379823580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: You survived X seconds. +--- !u!222 &379823583 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 379823580} + m_CullTransparentMesh: 0 +--- !u!1 &835239383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 835239384} + - component: {fileID: 835239387} + - component: {fileID: 835239386} + - component: {fileID: 835239388} + - component: {fileID: 835239385} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &835239384 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 835239383} + 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_Children: [] + m_Father: {fileID: 1080839405} + 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: -2.2, y: -2.13} + m_SizeDelta: {x: 7.5, y: 3.708} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &835239385 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 835239383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 2 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 21300000, guid: f7076241dee78324ba7929e6b570735e, + type: 3} + m_PressedSprite: {fileID: 21300000, guid: f7076241dee78324ba7929e6b570735e, type: 3} + m_DisabledSprite: {fileID: 21300000, guid: afecc653761cd7c4c834d486f9e7e689, type: 3} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 835239386} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 835239385} + m_MethodName: BroadcastMessage + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Play + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &835239386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 835239383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 21300000, guid: afecc653761cd7c4c834d486f9e7e689, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &835239387 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 835239383} + m_CullTransparentMesh: 0 +--- !u!114 &835239388 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 835239383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a18338602768f84dbf8f60767c96f58, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &854413627 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 854413628} + - component: {fileID: 854413630} + - component: {fileID: 854413629} + m_Layer: 5 + m_Name: again? + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &854413628 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 854413627} + 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_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 1 + 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: 3.71, y: -3.48} + m_SizeDelta: {x: 2.7, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &854413629 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 854413627} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: again? +--- !u!222 &854413630 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 854413627} + m_CullTransparentMesh: 0 +--- !u!1 &1080839401 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1080839405} + - component: {fileID: 1080839404} + - component: {fileID: 1080839403} + - component: {fileID: 1080839402} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1080839402 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1080839401} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1080839403 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1080839401} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 600 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 600 +--- !u!223 &1080839404 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1080839401} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1080839405 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1080839401} + 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_Children: + - {fileID: 835239384} + - {fileID: 854413628} + - {fileID: 1149357481} + - {fileID: 379823581} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 17.8, y: 10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1149357480 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1149357481} + - component: {fileID: 1149357483} + - component: {fileID: 1149357482} + m_Layer: 5 + m_Name: Game over! + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1149357481 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149357480} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 3, y: 3, z: 1} + m_Children: [] + m_Father: {fileID: 1080839405} + m_RootOrder: 2 + 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: 0, y: 3.5} + m_SizeDelta: {x: 5, y: 1} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1149357482 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149357480} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 300 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 300 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Game over! +--- !u!222 &1149357483 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1149357480} + m_CullTransparentMesh: 0 +--- !u!1 &1181808982 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1181808985} + - component: {fileID: 1181808984} + - component: {fileID: 1181808983} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1181808983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1181808982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1181808984 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1181808982} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1181808985 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1181808982} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Over.unity.meta b/Assets/Scenes/Over.unity.meta new file mode 100644 index 0000000..89d415f --- /dev/null +++ b/Assets/Scenes/Over.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b3190d5ca2b9a164488b703447670060 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/EnemyStatus.cs b/Assets/Scripts/EnemyStatus.cs index 302b42b..c03eddf 100644 --- a/Assets/Scripts/EnemyStatus.cs +++ b/Assets/Scripts/EnemyStatus.cs @@ -5,23 +5,34 @@ using UnityEngine; public class EnemyStatus : MonoBehaviour { public int livesCost = 1; - public int health = 10; public int masks = 1; + public float baseHealth = 10f; + public float healthPerSecond = 0.6f; private GameStatus gameStatus; + private SongData songData; + private float health; void Start() { gameStatus = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + songData = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + health = baseHealth + healthPerSecond * songData.songTime; } private void OnTriggerEnter2D(Collider2D collision) { KickCollision kickCollision = collision.GetComponent("KickCollision") as KickCollision; + SnareCollision snareCollision = collision.GetComponent("SnareCollision") as SnareCollision; if (kickCollision != null) { health -= kickCollision.damage; } + if (snareCollision != null) + { + health -= snareCollision.damage; + Destroy(snareCollision.gameObject); + } } void Update() diff --git a/Assets/Scripts/GameStatus.cs b/Assets/Scripts/GameStatus.cs index 5a02380..47d4b7d 100644 --- a/Assets/Scripts/GameStatus.cs +++ b/Assets/Scripts/GameStatus.cs @@ -2,23 +2,55 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; +using UnityEngine.SceneManagement; public class GameStatus : MonoBehaviour { public int money = 0; public int lives = 10; + public int[] towerCosts = new int[] { 0, 0, 0 }; + public GameObject moneyTextObject; + + private SongData songData; private Text moneyText; + private bool gameOver; void Start() { moneyText = moneyTextObject.GetComponent(); + songData = GetComponent(); } void Update() { - moneyText.text = money.ToString(); + if (moneyText != null) + { + moneyText.text = money.ToString(); + } + if (lives <= 0 && !gameOver) + { + GameOver(); + } + else if(gameOver) + { + GameObject.FindGameObjectWithTag("Score").GetComponent().text = "You survived " + songData.songTime.ToString("0.0") + " seconds."; + Destroy(gameObject); + } + } + + void GameOver() + { + gameOver = true; + DontDestroyOnLoad(gameObject); + foreach(Transform child in transform) + { + Destroy(child.gameObject); + } + Time.timeScale = 0; + GetComponent().Stop(); + SceneManager.LoadScene("Over"); } public void EnemyFinishedPath(GameObject enemy) diff --git a/Assets/Scripts/HatTower.cs b/Assets/Scripts/HatTower.cs index 6051819..94daca2 100644 --- a/Assets/Scripts/HatTower.cs +++ b/Assets/Scripts/HatTower.cs @@ -35,7 +35,7 @@ public class HatTower : MonoBehaviour { { //Calculate the power of the //power = Sqrt(Cos(pi * t)) - float power = Mathf.Pow(Mathf.Abs(Mathf.Cos(songData.songTime * Mathf.PI * songData.bpm / 30)) * ((cooldown - cooldownRemaining) / cooldown), 2); + float power = Mathf.Sqrt(Mathf.Abs(Mathf.Cos(songData.songTime * Mathf.PI * songData.bpm / 30)) * ((cooldown - cooldownRemaining) / cooldown)); //Play the sound hatSource.volume = power; hatSource.Play(); diff --git a/Assets/Scripts/LoadSceneOnClick.cs b/Assets/Scripts/LoadSceneOnClick.cs index 5447b8c..c146038 100644 --- a/Assets/Scripts/LoadSceneOnClick.cs +++ b/Assets/Scripts/LoadSceneOnClick.cs @@ -7,9 +7,6 @@ public class LoadSceneOnClick : MonoBehaviour { public void Play () { SceneManager.LoadScene("Game"); - Scene menu = SceneManager.GetSceneByName("Menu"); - Scene game = SceneManager.GetSceneByName("Game"); - SceneManager.SetActiveScene(game); - SceneManager.UnloadSceneAsync(menu); + Time.timeScale = 1; } } diff --git a/Assets/Scripts/SnareCollision.cs b/Assets/Scripts/SnareCollision.cs new file mode 100644 index 0000000..6de64d9 --- /dev/null +++ b/Assets/Scripts/SnareCollision.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SnareCollision : MonoBehaviour { + + public int damage; + public float maxRange; + public float speed; + private float distance = 0; + + private void Update() + { + if(distance >= maxRange) + { + Destroy(gameObject); + } + distance += speed * Time.deltaTime; + transform.Translate(Vector3.down * speed * Time.deltaTime); + } + + +} diff --git a/Assets/Scripts/SnareCollision.cs.meta b/Assets/Scripts/SnareCollision.cs.meta new file mode 100644 index 0000000..7a75958 --- /dev/null +++ b/Assets/Scripts/SnareCollision.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12e817cc5c12bdd4bb95e359298b8d56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SnareTower.cs b/Assets/Scripts/SnareTower.cs index 80b4e14..749c12e 100644 --- a/Assets/Scripts/SnareTower.cs +++ b/Assets/Scripts/SnareTower.cs @@ -6,6 +6,9 @@ public class SnareTower : MonoBehaviour { public Sprite standardSprite; public Sprite alternateSprite; + public GameObject projectileObject; + public float maxRange; + public float maxDamage; private AudioSource snareSource; private SongData songData; @@ -38,6 +41,12 @@ public class SnareTower : MonoBehaviour { //Play the sound snareSource.volume = power; snareSource.Play(); + //Instantiate the projectile + GameObject projectile = Instantiate(projectileObject, transform.position, transform.rotation); + SnareCollision sc = projectile.GetComponent(); + sc.maxRange = power * maxRange; + sc.damage = Mathf.CeilToInt(power * maxDamage); + projectile.transform.localScale = new Vector3(power, power, 1); //Start the cooldown cooldownRemaining = cooldown; //Change the sprite diff --git a/Assets/Scripts/TowerPlacer.cs b/Assets/Scripts/TowerPlacer.cs index 0b40d69..52526dc 100644 --- a/Assets/Scripts/TowerPlacer.cs +++ b/Assets/Scripts/TowerPlacer.cs @@ -5,11 +5,16 @@ using UnityEngine; public class TowerPlacer : MonoBehaviour { public GameObject selected = null; + + GameStatus gameStatus; + TowerSelector towerSelector; SpriteRenderer cursorSprite; SpriteRenderer towerGhost; void Start() { + gameStatus = GameObject.FindGameObjectWithTag("GameController").GetComponent(); + towerSelector = gameObject.GetComponent(); SpriteRenderer[] spriteRenderers = gameObject.GetComponentsInChildren(); foreach (SpriteRenderer spriteRenderer in spriteRenderers) { @@ -23,27 +28,49 @@ public class TowerPlacer : MonoBehaviour } void Update () { + //Check if the player has enough money to place the tower + bool hasEnoughMoney = gameStatus.money >= gameStatus.towerCosts[towerSelector.index]; //Check if there's nothing else under the cursor Collider2D collider = Physics2D.OverlapPoint(transform.position); if (collider == null || collider.tag == "Hit") { - cursorSprite.color = Color.white; - towerGhost.color = Color.white; + if (hasEnoughMoney) + { + cursorSprite.color = Color.white; + } + else + { + cursorSprite.color = Color.yellow; + } + towerGhost.color = new Color(towerGhost.color.r, towerGhost.color.g, towerGhost.color.b, 1); } else { cursorSprite.color = Color.red; - towerGhost.color = new Color(1, 1, 1, 0); + towerGhost.color = new Color(towerGhost.color.r, towerGhost.color.g, towerGhost.color.b, 0); } if (Input.GetMouseButtonDown(0)) { - //Check if something is selected - if (selected == null) return; + //Check if the player has enough money + if (!hasEnoughMoney) return; //Ensure there is nothing below if (collider != null && collider.tag != "Hit") return; //Place the item Vector3 position = new Vector3(transform.position.x, transform.position.y, 0); Instantiate(selected, position, transform.rotation); + //Deduct the money + gameStatus.money -= gameStatus.towerCosts[towerSelector.index]; + //Increase the costs + if(gameStatus.towerCosts[towerSelector.index] == 0) + { + //TODO: quick hack + gameStatus.towerCosts = new int[] { 1, 1, 1 }; + } + else + { + gameStatus.towerCosts[towerSelector.index] *= 2; + } + } } } diff --git a/Assets/Scripts/TowerSelector.cs b/Assets/Scripts/TowerSelector.cs index a116c22..b69dce0 100644 --- a/Assets/Scripts/TowerSelector.cs +++ b/Assets/Scripts/TowerSelector.cs @@ -5,12 +5,12 @@ using UnityEngine; public class TowerSelector : MonoBehaviour { public GameObject[] towerList; + public int index; - private int index; private TowerPlacer towerPlacer; private SpriteRenderer towerGhost; - void Start () { + void Start () { index = 0; towerPlacer = gameObject.GetComponent(); SpriteRenderer[] spriteRenderers = gameObject.GetComponentsInChildren(); @@ -25,7 +25,7 @@ public class TowerSelector : MonoBehaviour { } void Update () { - if (Input.GetAxis("Mouse ScrollWheel") > 0) + if (Input.GetAxis("Mouse ScrollWheel") > 0) { //Go to the next tower index++; diff --git a/Assets/Sprites/placeholderSquare.png.meta b/Assets/Sprites/placeholderSquare.png.meta index b6ee8ad..b404050 100644 --- a/Assets/Sprites/placeholderSquare.png.meta +++ b/Assets/Sprites/placeholderSquare.png.meta @@ -45,7 +45,7 @@ TextureImporter: spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 64 + spritePixelsToUnits: 32 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 0 alphaUsage: 1 diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 82ab0f5..521d3c4 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -5,7 +5,16 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: + - enabled: 0 + path: + guid: 00000000000000000000000000000000 - enabled: 1 - path: Assets/Scenes/SampleScene.unity + path: Assets/Scenes/Menu.unity + guid: 9729010b44bf87041aaee0bc130b9c44 + - enabled: 1 + path: Assets/Scenes/Game.unity guid: 2cda990e2423bbf4892e6590ba056729 + - enabled: 1 + path: Assets/Scenes/Over.unity + guid: b3190d5ca2b9a164488b703447670060 m_configObjects: {} diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 7b0fd32..e2b537f 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -7,6 +7,7 @@ TagManager: - Enemy - Tower - Hit + - Score layers: - Default - TransparentFX