branch from homebase, icebolt collision issues
This commit is contained in:
70
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs
Normal file
70
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerInfo : MonoBehaviour
|
||||
{
|
||||
private int health;
|
||||
|
||||
private int essence_basic;
|
||||
|
||||
private GameObject rightHandHeld;
|
||||
private GameObject leftHandHeld;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
health = 5;
|
||||
essence_basic = 0;
|
||||
rightHandHeld = null;
|
||||
leftHandHeld = null;
|
||||
}
|
||||
|
||||
public void AddHealth(int value)
|
||||
{
|
||||
health += value;
|
||||
if (health <= 0)
|
||||
{
|
||||
Debug.Log("NO HEALTH REAMINING");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEssenceBasic(int value)
|
||||
{
|
||||
if (essence_basic + value < 0)
|
||||
{
|
||||
Debug.Log("NOT ENOUGH ESSENCE");
|
||||
}
|
||||
else essence_basic += value;
|
||||
}
|
||||
|
||||
public void AddLeftHand(GameObject obj)
|
||||
{
|
||||
leftHandHeld = obj;
|
||||
}
|
||||
|
||||
public void AddRightHand(GameObject obj)
|
||||
{
|
||||
rightHandHeld = obj;
|
||||
}
|
||||
|
||||
public void RemoveLeftHand()
|
||||
{
|
||||
leftHandHeld = null;
|
||||
}
|
||||
|
||||
public void RemoveRightHand()
|
||||
{
|
||||
rightHandHeld = null;
|
||||
}
|
||||
|
||||
public GameObject GetLeftHand()
|
||||
{
|
||||
return leftHandHeld;
|
||||
}
|
||||
|
||||
public GameObject GetRightHand()
|
||||
{
|
||||
return rightHandHeld;
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs.meta
Normal file
11
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51150922d2ca8cc44b6fc27d9365a8d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user