Komplett mit Audio, Fehler beim Start der Spielszenen: standardHealth und standardEnergy werden nicht wie gewollt übermittelt
This commit is contained in:
@@ -9,7 +9,7 @@ public class CreditsScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public float scrollSpeed;
|
||||
private float maxScrollSpeed = 300f;
|
||||
private float maxScrollSpeed = 400f;
|
||||
[SerializeField] public float maxYPosition;
|
||||
[SerializeField] public float minYPosition;
|
||||
[SerializeField] GameObject minYPo;
|
||||
@@ -23,7 +23,7 @@ public class CreditsScript : MonoBehaviour
|
||||
scrollSpeed = 200f;
|
||||
textfeld = this.text;
|
||||
|
||||
maxYPosition = 3200;
|
||||
maxYPosition = 8000;
|
||||
minYPosition = 0;
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
|
||||
@@ -67,11 +67,38 @@ public class CreditsScript : MonoBehaviour
|
||||
{
|
||||
//die Credits einfach hardcoden, dann kann ich die schneller anpassen
|
||||
//funktioniert
|
||||
|
||||
/*
|
||||
textfeld.text = "Assets" +
|
||||
"Dark UI kit by kΩsmaragd on Unity Store" +
|
||||
"Clean Vector Icons by PONETI on Unity Store" +
|
||||
"UX Flat Icons [Free] by Heathen Engineering on Unity Store" +
|
||||
"Help Me Font by GGBotNet on itch.io ";
|
||||
|
||||
|
||||
Lilia:
|
||||
- MusicManager
|
||||
- SFX Manager
|
||||
- Door
|
||||
- DoorController
|
||||
- LightController
|
||||
|
||||
- Fiefetti 3D Modell
|
||||
- Silpathisch 3D Modell
|
||||
- Haiphisch 3D Modell
|
||||
- Level Design
|
||||
- Level 3D Modell
|
||||
|
||||
|
||||
Xilver:
|
||||
- ShopScript
|
||||
- MainMenue
|
||||
- AudioManager
|
||||
- Vibrator
|
||||
- EnemyScripts (FieScript, HaiScript, SilvScript) und weitere Logik
|
||||
- HandleEnergy
|
||||
- ChangeHealth
|
||||
- LevelBehaviour
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class GameOver : MonoBehaviour
|
||||
[SerializeField] GameObject eFie;
|
||||
[SerializeField] GameObject eSilv;
|
||||
[SerializeField] GameObject eHai;
|
||||
[SerializeField] GameObject audioScript;
|
||||
|
||||
|
||||
InventoryScript inventory;
|
||||
@@ -42,6 +43,7 @@ public class GameOver : MonoBehaviour
|
||||
SilvScript silv;
|
||||
HaiScript hai;
|
||||
LevelBehavior level;
|
||||
AudioManager audio;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -52,12 +54,12 @@ public class GameOver : MonoBehaviour
|
||||
hai = eHai.GetComponent<HaiScript>();
|
||||
silv = eSilv.GetComponent<SilvScript>();
|
||||
level = levelScript.GetComponent<LevelBehavior>();
|
||||
audio = audioScript.GetComponent<AudioManager>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
timer = 10f;
|
||||
inventory.Gems = 599;
|
||||
deathPanel.SetActive(false);
|
||||
}
|
||||
|
||||
@@ -76,6 +78,7 @@ public class GameOver : MonoBehaviour
|
||||
|
||||
public void ShowDeathScreen()
|
||||
{
|
||||
audio.PlaySFX(audio.death);
|
||||
//Time.timeScale = 0;
|
||||
timerOn = true;
|
||||
timer = 10f;
|
||||
@@ -118,6 +121,7 @@ public class GameOver : MonoBehaviour
|
||||
Debug.Log(inventory.Gems);
|
||||
timerOn = false;
|
||||
timer = 10f;
|
||||
audio.PlaySFX(audio.rearrange);
|
||||
}
|
||||
|
||||
else //EINBAUEN, DASS MAN DORT GEMS KAUFEN KANN
|
||||
@@ -215,16 +219,16 @@ public class GameOver : MonoBehaviour
|
||||
public void SpeakEnemy()
|
||||
{
|
||||
|
||||
if (fie.fieKill)
|
||||
if (fie.fieKill == true)
|
||||
{
|
||||
infoText.text = "HAAHAHAHAHAAHAHAHAHAHAHAHAHA";
|
||||
}
|
||||
|
||||
if (silv.silvKill)
|
||||
if (silv.silvKill == true)
|
||||
{
|
||||
infoText.text = "Oh no, I accidently killed someone again. I'm sowy. I just wanted to hug you :(";
|
||||
}
|
||||
if (hai.haiKill)
|
||||
if (hai.haiKill == true)
|
||||
{
|
||||
infoText.text = "You sound great...";
|
||||
}
|
||||
|
||||
@@ -6,6 +6,13 @@ using UnityEngine.UIElements;
|
||||
|
||||
public class MenueScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject audioScript;
|
||||
AudioManager audio;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
audio = audioScript.GetComponent<AudioManager>();
|
||||
}
|
||||
public void ReturnHome()
|
||||
{
|
||||
SceneManager.LoadSceneAsync(0);
|
||||
@@ -15,6 +22,7 @@ public class MenueScript : MonoBehaviour
|
||||
{
|
||||
SceneManager.LoadSceneAsync(2);
|
||||
Vibrator.Vibrate();
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void Credits()
|
||||
|
||||
@@ -24,6 +24,9 @@ public class ShopScript : MonoBehaviour
|
||||
[SerializeField] InventoryScript inventory;
|
||||
[SerializeField] ChangeHealth healthScript;
|
||||
[SerializeField] HandleEnergy battery;
|
||||
[SerializeField] GameObject audioScript;
|
||||
|
||||
AudioManager audio;
|
||||
|
||||
[Header("BuyValues")]
|
||||
|
||||
@@ -63,7 +66,7 @@ public class ShopScript : MonoBehaviour
|
||||
inventory = backgroundPanel.GetComponent<InventoryScript>();
|
||||
healthScript = backgroundPanel.GetComponent<ChangeHealth>();
|
||||
battery = backgroundPanel.GetComponent<HandleEnergy>();
|
||||
|
||||
audio = audioScript.GetComponent<AudioManager>();
|
||||
|
||||
}
|
||||
void Start()
|
||||
@@ -97,18 +100,22 @@ public class ShopScript : MonoBehaviour
|
||||
shopPanel.SetActive(true);
|
||||
LeanTween.scale(shopPanel, transform.localScale * 0.5f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
Vibrator.Vibrate();
|
||||
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void CloseShop()
|
||||
{
|
||||
LeanTween.scale(shopPanel, transform.localScale * 0f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
shopPanel.SetActive(false);
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void ClosePanel()
|
||||
{
|
||||
LeanTween.scale(errorPanel, transform.localScale * 0f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
errorPanel.SetActive(false);
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void AddLife()
|
||||
@@ -126,6 +133,8 @@ public class ShopScript : MonoBehaviour
|
||||
inventory.StandardHealth++;
|
||||
|
||||
inventory.Gems -= updateCost;
|
||||
|
||||
audio.PlaySFX(audio.buy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +152,8 @@ public class ShopScript : MonoBehaviour
|
||||
inventory.StandardEnergy++;
|
||||
|
||||
inventory.Gems -= updateCost;
|
||||
|
||||
audio.PlaySFX(audio.buy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +174,7 @@ public class ShopScript : MonoBehaviour
|
||||
moneten -= gemsCost;
|
||||
Debug.Log("Ich mag Moeneten");
|
||||
inventory.Gems += 100;
|
||||
audio.PlaySFX(audio.buy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +204,8 @@ public class ShopScript : MonoBehaviour
|
||||
Debug.Log("Ich mag Moeneten");
|
||||
|
||||
inventory.Gems += 200;
|
||||
|
||||
audio.PlaySFX(audio.buy);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -214,6 +228,8 @@ public class ShopScript : MonoBehaviour
|
||||
//textfeldA.text = inventory.Energy.ToString();
|
||||
//textfeldB.text = inventory.Health.ToString();
|
||||
//textfeldC.text = moneten.ToString();
|
||||
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void ResetValues()
|
||||
@@ -224,8 +240,10 @@ public class ShopScript : MonoBehaviour
|
||||
moneten = 10f;
|
||||
|
||||
errorPanel.SetActive(true);
|
||||
errorText.text = "All values have been reset to standard.";
|
||||
errorText.text = "Values have been reset.";
|
||||
LeanTween.scale(errorPanel, transform.localScale * 0.5f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
public void ChangeActivation()
|
||||
@@ -241,6 +259,7 @@ public class ShopScript : MonoBehaviour
|
||||
errorText.text = "PaymentSystem active";
|
||||
LeanTween.scale(errorPanel, transform.localScale * 0.5f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -262,5 +281,7 @@ public class ShopScript : MonoBehaviour
|
||||
devPanel.SetActive(false);
|
||||
|
||||
ClosePanel();
|
||||
|
||||
audio.PlaySFX(audio.button);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user