From ab20f6aca933481a7eee554b92f9fd5410979fe4 Mon Sep 17 00:00:00 2001 From: MartinRemi Date: Mon, 16 Nov 2015 15:20:07 -0500 Subject: [PATCH] Added health script --- Assets/Health.cs | 34 +++++++++++++++++++++++++++ Assets/Health.cs.meta | 12 ++++++++++ ProjectSettings/ProjectSettings.asset | 14 ----------- ProjectSettings/ProjectVersion.txt | 2 +- 4 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 Assets/Health.cs create mode 100644 Assets/Health.cs.meta diff --git a/Assets/Health.cs b/Assets/Health.cs new file mode 100644 index 0000000..f977773 --- /dev/null +++ b/Assets/Health.cs @@ -0,0 +1,34 @@ +using UnityEngine; +using System.Collections; + +public class Health : MonoBehaviour { + + public int maxHP; + private int hp; + + // Use this for initialization + void Start () { + hp = maxHP; + } + + public int removeHP(int amount) + { + hp -= amount; + if (hp < 0) + hp = 0; + return hp; + } + + public int addHP(int amount) + { + hp += amount; + if (hp > maxHP) + hp = maxHP; + return hp; + } + + public int getHP() + { + return hp; + } +} diff --git a/Assets/Health.cs.meta b/Assets/Health.cs.meta new file mode 100644 index 0000000..2538a74 --- /dev/null +++ b/Assets/Health.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 28110cf2b286c534c94e41ea7e145ef0 +timeCreated: 1447704727 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 24b2ed9..f3abab5 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -8,7 +8,6 @@ PlayerSettings: defaultScreenOrientation: 4 targetDevice: 2 targetResolution: 0 - useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany productName: Laboratoire_2_Equipe_2 @@ -29,7 +28,6 @@ PlayerSettings: androidShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 - iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToLandscapeRight: 1 @@ -137,15 +135,6 @@ 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} @@ -235,8 +224,6 @@ PlayerSettings: ps4SdkOverride: ps4BGMPath: ps4ShareFilePath: - ps4ShareOverlayImagePath: - ps4PrivacyGuardImagePath: ps4NPtitleDatPath: ps4RemotePlayKeyAssignment: -1 ps4RemotePlayKeyMappingDir: @@ -258,7 +245,6 @@ PlayerSettings: ps4attribMoveSupport: 0 ps4attrib3DSupport: 0 ps4attribShareSupport: 0 - ps4IncludedModules: [] monoEnv: psp2Splashimage: {fileID: 0} psp2NPTrophyPackPath: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 8a062e6..e040c5c 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 5.2.1f1 +m_EditorVersion: 5.2.0f3 m_StandardAssetsVersion: 0