shield costs 1 essence, sound played if trying with 0 essence, shield despawns in 5 sec
This commit is contained in:
@@ -14,6 +14,8 @@ public class ActionGestureInteraction : MonoBehaviour
|
||||
|
||||
private bool holdingWand;
|
||||
|
||||
public AudioSource noEssenceAudio;
|
||||
|
||||
void Start()
|
||||
{
|
||||
player = gameObject;
|
||||
@@ -48,9 +50,17 @@ public class ActionGestureInteraction : MonoBehaviour
|
||||
if (holdingWand)
|
||||
{
|
||||
Debug.LogWarning("WAND VERTICAL");
|
||||
Vector3 spawnPoint = transform.position + playerCamera.transform.forward;
|
||||
spawnPoint = new Vector3(spawnPoint.x, spawnPoint.y + 1, spawnPoint.z);
|
||||
Instantiate(objects[1], spawnPoint, Quaternion.Euler(-90,playerCamera.transform.eulerAngles.y-180,180));
|
||||
if (PlayerInfo.Instance.AddEssenceBasic(-1))
|
||||
{
|
||||
Vector3 spawnPoint = transform.position + playerCamera.transform.forward;
|
||||
spawnPoint = new Vector3(spawnPoint.x, spawnPoint.y + 1, spawnPoint.z);
|
||||
GameObject shield = Instantiate(objects[1], spawnPoint, Quaternion.Euler(-90, playerCamera.transform.eulerAngles.y - 180, 180));
|
||||
Destroy(shield, 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
noEssenceAudio.Play();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user