Umänderungen, Packages installiert
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
using UnityEngine;
|
||||
using UnityEngine.LowLevelPhysics;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@@ -40,9 +40,8 @@ public class MenueScript : MonoBehaviour
|
||||
|
||||
//SceneNummern:
|
||||
//0 - MainMenue
|
||||
//1 - Shop
|
||||
//2 - Credits
|
||||
//3 - Lilia
|
||||
//4 - Xilver
|
||||
//5 - Day1
|
||||
//6 - Day6
|
||||
//1 - Credits
|
||||
//2 - Day 1
|
||||
//3 - Day 2
|
||||
//4 - Day 3
|
||||
//5 - Day 6
|
||||
|
||||
@@ -3,7 +3,6 @@ using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using Unity.VisualScripting.Antlr3.Runtime;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.VirtualTexturing;
|
||||
using UnityEngine.U2D;
|
||||
|
||||
public class ShopScript : MonoBehaviour
|
||||
@@ -154,6 +153,7 @@ public class ShopScript : MonoBehaviour
|
||||
inventory.Gems -= updateCost;
|
||||
|
||||
audio.PlaySFX(audio.buy);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class DoorController : MonoBehaviour
|
||||
if (inventory.Energy > 0)
|
||||
{
|
||||
audio.PlaySFX(audio.door);
|
||||
Vibrator.Vibrate();
|
||||
//Vibrator.Vibrate();
|
||||
door.isOpen = false;
|
||||
Debug.Log("Hier kommt niemand rein");
|
||||
energy.LoseEnergy();
|
||||
|
||||
@@ -67,16 +67,32 @@ public class FieScript : MonoBehaviour
|
||||
//StateOne();
|
||||
StartStuff();
|
||||
}
|
||||
float stickAround = 0;
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
|
||||
if(fieKill == true)
|
||||
{
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Fiefetti.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
|
||||
fieKill = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HitPlayer()
|
||||
{
|
||||
healthScript.GetHit();
|
||||
audio.PlaySFX(audio.fieHit);
|
||||
|
||||
silv.silvKill = false;
|
||||
hai.haiKill = false;
|
||||
fieKill = true;
|
||||
}
|
||||
|
||||
public void StartStuff()
|
||||
@@ -157,7 +173,6 @@ public class FieScript : MonoBehaviour
|
||||
{
|
||||
float elapsed3 = 0;
|
||||
|
||||
float stickAround = 0f;
|
||||
|
||||
if (spawnLeft && doorSwitch.isOpen == true)
|
||||
{
|
||||
@@ -165,17 +180,6 @@ public class FieScript : MonoBehaviour
|
||||
Debug.Log("Fiefetti: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
|
||||
silv.silvKill = false;
|
||||
hai.haiKill = false;
|
||||
fieKill = true;
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Fiefetti.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!spawnLeft && doorSwitch2.isOpen == true)
|
||||
@@ -184,17 +188,6 @@ public class FieScript : MonoBehaviour
|
||||
Debug.Log("Fiefetti: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
|
||||
silv.silvKill = false;
|
||||
hai.haiKill = false;
|
||||
fieKill = true;
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Fiefetti.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
@@ -220,83 +213,4 @@ public class FieScript : MonoBehaviour
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
}
|
||||
|
||||
/*
|
||||
public void StateOne()
|
||||
{
|
||||
button.SetActive(false);
|
||||
|
||||
Fiefetti.transform.position = SPBack.transform.position;
|
||||
|
||||
//Hauptposition
|
||||
Debug.Log("Fiefetti: Bin hinten");
|
||||
|
||||
int random = Random.Range(1, 3);
|
||||
if (random == 1) //1 bedeutet immer left
|
||||
{
|
||||
spawn1 = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawn2 = true;
|
||||
}
|
||||
Debug.Log("random = " + random);
|
||||
|
||||
//StartCoroutine(WanderClose());
|
||||
}*/
|
||||
/*
|
||||
public void StateTwo()
|
||||
{
|
||||
if (spawn1 == true) //1 bedeutet immer left
|
||||
{
|
||||
Fiefetti.transform.position = SPLeft.transform.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
Fiefetti.transform.position = SPRight.transform.position;
|
||||
}
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
|
||||
//einen von zwei Punkten aussuchen
|
||||
Debug.Log("Fiefetti: Komme näher");
|
||||
|
||||
//StateThree();
|
||||
}*/
|
||||
/*
|
||||
public void StateThree()
|
||||
{
|
||||
if (doorSwitch.isOpen == true)
|
||||
{
|
||||
Fiefetti.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Fiefetti: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
fieKill = true;
|
||||
}
|
||||
|
||||
else if (doorSwitch2.isOpen == true)
|
||||
{
|
||||
Fiefetti.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Fiefetti: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
fieKill = true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//AudioSpielen
|
||||
fieKill = false;
|
||||
|
||||
Debug.Log("Fiefetti: Och menno");
|
||||
}
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
spawn1 = false;
|
||||
spawn2 = false;
|
||||
//StateOne();
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -67,15 +67,32 @@ public class HaiScript : MonoBehaviour
|
||||
StartStuff();
|
||||
}
|
||||
|
||||
float stickAround = 0;
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (haiKill == true)
|
||||
{
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Hai.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
|
||||
haiKill = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HitPlayer()
|
||||
{
|
||||
healthScript.GetHit();
|
||||
audio.PlaySFX(audio.haiHit);
|
||||
|
||||
fie.fieKill = false;
|
||||
silv.silvKill = false;
|
||||
haiKill = true;
|
||||
}
|
||||
|
||||
public void StartStuff()
|
||||
@@ -161,9 +178,6 @@ public class HaiScript : MonoBehaviour
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
|
||||
fie.fieKill = false;
|
||||
silv.silvKill = false;
|
||||
haiKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
|
||||
@@ -64,7 +64,7 @@ public class LevelBehavior : MonoBehaviour
|
||||
if (sceneName == "Day2")
|
||||
{
|
||||
Debug.Log("Es ist Tag 2");
|
||||
curScene = 5;
|
||||
curScene = 3;
|
||||
fie.stateTime = 5;
|
||||
silv.stateTime = 10;
|
||||
hai.stateTime = 25;
|
||||
@@ -112,16 +112,18 @@ public class LevelBehavior : MonoBehaviour
|
||||
|
||||
public void SwitchScene()
|
||||
{
|
||||
curScene++;
|
||||
|
||||
Debug.Log("Ich will jetzt in Scene " + curScene++ + " wechseln.");
|
||||
|
||||
gameOngoing = false;
|
||||
gameWon = false;
|
||||
|
||||
if (curScene < 5)
|
||||
if (curScene < 4)
|
||||
{
|
||||
Debug.Log("Ist noch nicht Tag 3");
|
||||
|
||||
SceneManager.LoadSceneAsync(curScene++);
|
||||
SceneManager.LoadSceneAsync(curScene);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
|
||||
public class SilvScript : MonoBehaviour
|
||||
@@ -66,15 +67,32 @@ public class SilvScript : MonoBehaviour
|
||||
StartStuff();
|
||||
}
|
||||
|
||||
float stickAround = 0;
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (silvKill == true)
|
||||
{
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Silv.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
|
||||
silvKill = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HitPlayer()
|
||||
{
|
||||
healthScript.GetHit();
|
||||
audio.PlaySFX(audio.silvHit);
|
||||
|
||||
fie.fieKill = false;
|
||||
hai.haiKill = false;
|
||||
silvKill = true;
|
||||
}
|
||||
|
||||
public void StartStuff()
|
||||
@@ -182,10 +200,6 @@ public class SilvScript : MonoBehaviour
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
|
||||
fie.fieKill = false;
|
||||
hai.haiKill = false;
|
||||
silvKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ public class ChangeHealth : MonoBehaviour
|
||||
//fie = eFie.GetComponent<FieScript>();
|
||||
//silv = eSilv.GetComponent<SilvScript>();
|
||||
//hai = eHai.GetComponent<HaiScript>();
|
||||
|
||||
}
|
||||
|
||||
void Start()
|
||||
|
||||
@@ -17,10 +17,10 @@ public class InventoryData
|
||||
//Gems
|
||||
public int gems;
|
||||
|
||||
public int standardHealth;
|
||||
|
||||
public int standardEnergy;
|
||||
|
||||
public int standardHealth;
|
||||
|
||||
public InventoryData(int energy, int health, int gems, int standardHealth, int standardEnergy)
|
||||
{
|
||||
this.energy = energy;
|
||||
@@ -47,10 +47,10 @@ public class InventoryScript : MonoBehaviour
|
||||
//Gems
|
||||
[SerializeField] int gems;
|
||||
|
||||
[SerializeField] int standardHealth;
|
||||
|
||||
[SerializeField] int standardEnergy;
|
||||
|
||||
[SerializeField] int standardHealth;
|
||||
|
||||
|
||||
|
||||
private void Awake()
|
||||
@@ -84,18 +84,19 @@ public class InventoryScript : MonoBehaviour
|
||||
set { gems = value; ValChanged(); }
|
||||
}
|
||||
|
||||
public int StandardHealth
|
||||
{
|
||||
get { return standardHealth; }
|
||||
set { standardHealth = value; ValChanged(); }
|
||||
}
|
||||
|
||||
public int StandardEnergy
|
||||
{
|
||||
get { return standardEnergy; }
|
||||
set { standardEnergy = value; ValChanged(); }
|
||||
}
|
||||
|
||||
public int StandardHealth
|
||||
{
|
||||
get { return standardHealth; }
|
||||
set { standardHealth = value; ValChanged(); }
|
||||
}
|
||||
|
||||
|
||||
// Achtung, ValChanged wird NICHT aufgerufen, wenn man die Werte im Inspector verändert,
|
||||
// weil das nur die Felder, nicht die Properties setzt.
|
||||
// Ändert man aber per Script die Property, wird ValChanged aufgerufen und sofort die Werte ins File gespeichert.
|
||||
@@ -117,10 +118,12 @@ public class InventoryScript : MonoBehaviour
|
||||
energy = inventoryData.energy;
|
||||
health = inventoryData.health;
|
||||
gems = inventoryData.gems;
|
||||
standardEnergy = inventoryData.standardEnergy;
|
||||
standardHealth = inventoryData.standardHealth;
|
||||
}
|
||||
private void SaveInventoryData()
|
||||
{
|
||||
inventoryData = new InventoryData(energy, health, gems, standardHealth, standardEnergy); // erstellt ein neues Objekt InventoryData aus den Werten dieses Scripts
|
||||
inventoryData = new InventoryData(energy, health, gems, standardEnergy, standardHealth); // erstellt ein neues Objekt InventoryData aus den Werten dieses Scripts
|
||||
string datastring = JsonUtility.ToJson(inventoryData); // macht einen JSON String aus diesem Objekt (dafür brauchen wir es auch nur)
|
||||
File.WriteAllText(path, datastring);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using TMPro;
|
||||
using UnityEditor.Rendering;
|
||||
using UnityEngine;
|
||||
|
||||
public class LevelScripts : MonoBehaviour
|
||||
|
||||
Reference in New Issue
Block a user