shield costs 1 essence, sound played if trying with 0 essence, shield despawns in 5 sec

This commit is contained in:
joonasp
2022-04-18 11:52:14 +03:00
parent ad1a931c41
commit a997c06e99
15 changed files with 1052 additions and 823 deletions

View File

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

View File

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

View 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()
{
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: add865683e185ac43b2093091d499b6a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: