Added health script

This commit is contained in:
MartinRemi 2015-11-16 15:20:07 -05:00
parent 1a0318aaa0
commit ab20f6aca9
4 changed files with 47 additions and 15 deletions

34
Assets/Health.cs Normal file
View File

@ -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;
}
}

12
Assets/Health.cs.meta Normal file
View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 28110cf2b286c534c94e41ea7e145ef0
timeCreated: 1447704727
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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:

View File

@ -1,2 +1,2 @@
m_EditorVersion: 5.2.1f1
m_EditorVersion: 5.2.0f3
m_StandardAssetsVersion: 0