From b4cc1dc6ceb21ed2ddde90af41a9e4c858309f16 Mon Sep 17 00:00:00 2001 From: JoelLapointe86 Date: Tue, 1 Dec 2015 21:04:07 -0500 Subject: [PATCH] Trousse est maintenant fonctionnel elle rend 3 pv --- Assets/Prefabs/Enemy.prefab | 6 +++++- Assets/Prefabs/bomb.prefab | 29 ++++++++++----------------- Assets/Scenes/MasterScene.unity | 1 - Assets/Scripts/Bomb.cs | 4 +--- Assets/Scripts/CollisionCheck.cs | 14 +++++++++++++ Assets/Scripts/HealthPickup.cs | 5 +++-- Assets/Scripts/LayBombs.cs | 1 + ProjectSettings/ProjectSettings.asset | 14 +++++++++++++ ProjectSettings/TagManager.asset | 2 +- 9 files changed, 50 insertions(+), 26 deletions(-) diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab index cc99638..ceb6ac9 100644 --- a/Assets/Prefabs/Enemy.prefab +++ b/Assets/Prefabs/Enemy.prefab @@ -14,7 +14,7 @@ GameObject: - 114: {fileID: 11431192} - 95: {fileID: 9512508} - 114: {fileID: 11482776} - m_Layer: 0 + m_Layer: 9 m_Name: Enemy m_TagString: Enemy m_Icon: {fileID: 0} @@ -152,6 +152,10 @@ Prefab: propertyPath: maxHP value: 2 objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_Layer + value: 9 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 183722} diff --git a/Assets/Prefabs/bomb.prefab b/Assets/Prefabs/bomb.prefab index 27c116d..b2602b5 100644 --- a/Assets/Prefabs/bomb.prefab +++ b/Assets/Prefabs/bomb.prefab @@ -10,7 +10,6 @@ GameObject: - 4: {fileID: 412680} - 50: {fileID: 5021002} - 114: {fileID: 11417938} - - 61: {fileID: 6160456} - 58: {fileID: 5858278} - 212: {fileID: 21297412} m_Layer: 0 @@ -60,20 +59,7 @@ CircleCollider2D: m_UsedByEffector: 0 m_Offset: {x: 0, y: 0} serializedVersion: 2 - m_Radius: 4 ---- !u!61 &6160456 -BoxCollider2D: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 172872} - m_Enabled: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_Offset: {x: 0, y: 0} - serializedVersion: 2 - m_Size: {x: 3.66000009, y: 4.5999999} + m_Radius: 2.25 --- !u!114 &11417938 MonoBehaviour: m_ObjectHideFlags: 1 @@ -85,8 +71,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b50c00a886c5b1a4196e8364e365416a, type: 3} m_Name: m_EditorClassIdentifier: - bombRadius: 10 - bombForce: 100 + bombRadius: .5 fuseTime: 1.5 explosion: {fileID: 100000, guid: 340a9e7d5164c9c4fba1dc34dc50b866, type: 2} --- !u!212 &21297412 @@ -128,7 +113,15 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 0} propertyPath: m_Radius - value: 4 + value: 2.25 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: bombRadius + value: .5 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} diff --git a/Assets/Scenes/MasterScene.unity b/Assets/Scenes/MasterScene.unity index 580f9e1..4a4193b 100644 --- a/Assets/Scenes/MasterScene.unity +++ b/Assets/Scenes/MasterScene.unity @@ -924,7 +924,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: audioPickup: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} - health: {fileID: 1113329686} --- !u!61 &1736051096 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Bomb.cs b/Assets/Scripts/Bomb.cs index 8cb4014..d87c65f 100644 --- a/Assets/Scripts/Bomb.cs +++ b/Assets/Scripts/Bomb.cs @@ -3,9 +3,7 @@ using System.Collections; public class Bomb : MonoBehaviour { - public float bombRadius = 10f; // Radius within which enemies are killed. - public float bombForce = 100f; // Force that enemies are thrown from the blast. - + public float bombRadius = 0.5f; // Radius within which enemies are killed. public float fuseTime = 1.5f; public GameObject explosion; // Prefab of explosion effect. diff --git a/Assets/Scripts/CollisionCheck.cs b/Assets/Scripts/CollisionCheck.cs index baa5842..d95497d 100644 --- a/Assets/Scripts/CollisionCheck.cs +++ b/Assets/Scripts/CollisionCheck.cs @@ -4,6 +4,7 @@ using UnityEngine.UI; public class CollisionCheck : MonoBehaviour { + //[HideInInspector] public Text health; @@ -19,11 +20,24 @@ public class CollisionCheck : MonoBehaviour { health.text = "Health: " + gameObject.GetComponent().removeHP(1); } + + if(gameObject.GetComponent().getHP() == 0) { gameObject.GetComponent().Death(); } } + void OnTriggerEnter2D(Collider2D col) + { + if(col.tag == "Player") + { + + health.text = "Health: " + gameObject.GetComponent().addHP(3); + + } + + } + } diff --git a/Assets/Scripts/HealthPickup.cs b/Assets/Scripts/HealthPickup.cs index d762bf5..5c06929 100644 --- a/Assets/Scripts/HealthPickup.cs +++ b/Assets/Scripts/HealthPickup.cs @@ -9,17 +9,18 @@ public class HealthPickup : MonoBehaviour public AudioClip audioPickup; public Text health; + void OnTriggerEnter2D(Collider2D other) { if(other.tag == "Player") { AudioSource.PlayClipAtPoint(audioPickup, transform.position); + health.text = "Health: " + other.gameObject.GetComponent().addHP(3); + // Destroy the crate. Destroy(gameObject); - //heal player - health.text = "Health: " + gameObject.GetComponent().addHP(3); } diff --git a/Assets/Scripts/LayBombs.cs b/Assets/Scripts/LayBombs.cs index bfbfdfa..da41689 100644 --- a/Assets/Scripts/LayBombs.cs +++ b/Assets/Scripts/LayBombs.cs @@ -5,6 +5,7 @@ public class LayBombs : MonoBehaviour { [HideInInspector] public bool bombLaid = false; // si une bombe a été lancé + [HideInInspector] public int bombCount = 0; // nombre bomb que le joueur possede public GameObject bomb; // Prefab of the bomb. diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index f3abab5..24b2ed9 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -8,6 +8,7 @@ PlayerSettings: defaultScreenOrientation: 4 targetDevice: 2 targetResolution: 0 + useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany productName: Laboratoire_2_Equipe_2 @@ -28,6 +29,7 @@ PlayerSettings: androidShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 + iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -135,6 +137,15 @@ PlayerSettings: iOSLaunchScreenFillPct: 100 iOSLaunchScreenSize: 100 iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSDeviceRequirements: [] AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -224,6 +235,8 @@ PlayerSettings: ps4SdkOverride: ps4BGMPath: ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -245,6 +258,7 @@ PlayerSettings: ps4attribMoveSupport: 0 ps4attrib3DSupport: 0 ps4attribShareSupport: 0 + ps4IncludedModules: [] monoEnv: psp2Splashimage: {fileID: 0} psp2NPTrophyPackPath: diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 9a51b1b..c78d565 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -16,7 +16,7 @@ TagManager: - - - Ground - - + - Enemies - - -