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

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

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:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: c99047a61fb87224a853c5e5bd2e8b06
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -90,19 +90,19 @@ Material:
- _HorizonCloudSize: 4.91
- _HorizonCloudStartPosition: -0.1
- _HorizonCloudStep: 25
- _HorizonExponent: 3.6162338
- _HorizonExponent: 3.5049064
- _HorizonStep: 500
- _HorizonThickness: 1
- _MoonGlow: 0
- _MoonLightIntensity: 0.000002310815
- _MoonLightIntensity: 0.00000018459268
- _MoonSize: 0
- _MoonSoftEdge: 0
- _OverheadCloudAltitude: 1000
- _OverheadCloudAnimationSpeed: 50
- _OverheadCloudFlowDirectionX: 1
- _OverheadCloudFlowDirectionZ: 1
- _OverheadCloudRemapMax: 1.1742301
- _OverheadCloudRemapMin: 0.1797546
- _OverheadCloudRemapMax: 1.1221364
- _OverheadCloudRemapMin: 0.14734921
- _OverheadCloudSize: 10
- _OverheadCloudStep: 2
- _StarsDensity0: 0.4
@ -121,25 +121,25 @@ Material:
- _StarsTwinkle1: 6
- _StarsTwinkle2: 2
- _SunGlow: 0.45
- _SunLightIntensity: 0.33437574
- _SunLightIntensity: 0.27927652
- _SunSize: 0.1
- _SunSoftEdge: 0.5
m_Colors:
- _DetailOverlayTintColor: {r: 0, g: 0, b: 0, a: 0}
- _FogColor: {r: 0, g: 0, b: 0, a: 0}
- _GroundColor: {r: 0.4207744, g: 0.40276432, b: 0.43764892, a: 1}
- _GroundColor: {r: 0.4156625, g: 0.3964904, b: 0.43362582, a: 1}
- _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1}
- _HorizonColor: {r: 0.9009051, g: 0.86649483, b: 0.76898205, a: 1}
- _HorizonColor: {r: 0.9031393, g: 0.85970676, b: 0.7559662, a: 1}
- _MoonColor: {r: 1, g: 1, b: 1, a: 0}
- _MoonDirection: {r: 1, g: 1, b: 1, a: 0}
- _MoonLightColor: {r: 0, g: 0, b: 0, a: 0}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.9793058}
- _SkyColor: {r: 0.22507675, g: 0.40525243, b: 0.64697796, a: 1}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.9720057}
- _SkyColor: {r: 0.21562512, g: 0.38082168, b: 0.61885357, a: 1}
- _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1}
- _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1}
- _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1}
- _SunColor: {r: 0.9720668, g: 0.92597556, b: 0.849925, a: 1}
- _SunDirection: {r: 0, g: -0.40529454, b: 0.9141862, a: 0}
- _SunColor: {r: 0.9731126, g: 0.9287469, b: 0.8555435, a: 1}
- _SunDirection: {r: 0, g: -0.3361922, b: 0.9417934, a: 0}
- _SunLightColor: {r: 1, g: 0.9929226, b: 0.9009434, a: 1}
m_BuildTextureStacks: []
--- !u!114 &11400000

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,17 +27,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: -2430253072367125096, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: -3060729322124398683, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: -4517534967829155026, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: 6653415060070705161, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: -4940288674371839809, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: 5795199688330459156, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

View File

@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: 1175007390464812036, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 5230418480753423839, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 86684429434073738, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 1154069719257359876, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: 8645063956259432296, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 527483421379118287, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

View File

@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: -548112332708788945, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: -2176569442210198836, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 409657408211097386, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: 7640766898490954091, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: 5101013413748717113, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: -2833636078624372882, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}