playerinfo script and duplicate scene for testing
This commit is contained in:
35
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs
Normal file
35
Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerInfo : MonoBehaviour
|
||||
{
|
||||
private int health;
|
||||
|
||||
private int essence_basic;
|
||||
//Add elemental essences?
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
health = 5;
|
||||
essence_basic = 0;
|
||||
}
|
||||
|
||||
public void AddHealth(int value)
|
||||
{
|
||||
health += value;
|
||||
if (health <= 0)
|
||||
{
|
||||
Debug.Log("NO HEALTH REMAINING");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEssenceBasic(int value)
|
||||
{
|
||||
if (essence_basic + value < 0)
|
||||
{
|
||||
Debug.LogError("NOT ENOUGH ESSENCE");
|
||||
}
|
||||
else essence_basic += value;
|
||||
}
|
||||
}
|
||||
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: 08f72f5d017837743b67d344a6a7ed52
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user