shield costs 1 essence, sound played if trying with 0 essence, shield despawns in 5 sec
This commit is contained in:
@@ -25,7 +25,7 @@ public class EssenceNodeController : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
nodeMaterial = GetComponent<Renderer>().material;
|
||||
//playerInfo = PlayerInfo.Instance;
|
||||
playerInfo = PlayerInfo.Instance;
|
||||
playerInventory = GameObject.Find("Inventory").GetComponent<Inventory>();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,22 +23,29 @@ public class PlayerInfo : MonoBehaviour
|
||||
leftHandHeld = null;
|
||||
}
|
||||
|
||||
public void AddHealth(int value)
|
||||
public bool AddHealth(int value)
|
||||
{
|
||||
health += value;
|
||||
if (health <= 0)
|
||||
{
|
||||
Debug.Log("NO HEALTH REMAINING");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AddEssenceBasic(int value)
|
||||
public bool AddEssenceBasic(int value)
|
||||
{
|
||||
if (essence_basic + value < 0)
|
||||
{
|
||||
Debug.Log("NOT ENOUGH ESSENCE");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
essence_basic += value;
|
||||
return true;
|
||||
}
|
||||
else essence_basic += value;
|
||||
}
|
||||
|
||||
public void AddLeftHand(GameObject obj)
|
||||
|
||||
18
Assets/Project Files/Scripts/JoonasP/ShieldController.cs
Normal file
18
Assets/Project Files/Scripts/JoonasP/ShieldController.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ShieldController : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: add865683e185ac43b2093091d499b6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user