Enemy Logik erstellt Weitere Kommentare: Ich werde herausfinden, wer Coroutinen erfunden hat und diese Person auf dieselbe Art knechten, wie ich es in den letzten 5 Stunden wurde. WaitForSeconds(5) aber alles 4000 Mal in 3 Sekunden durchlaufen, mein Arsch.
This commit is contained in:
@@ -19,7 +19,7 @@ public class DevScript : MonoBehaviour
|
||||
|
||||
//private KeyCode secretCode = KeyCode.G;
|
||||
|
||||
Vector3 ort = new Vector3();
|
||||
//Vector3 ort = new Vector3();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
@@ -26,17 +26,20 @@ public class GameOver : MonoBehaviour
|
||||
[Header("ScriptPile")]
|
||||
|
||||
[SerializeField] GameObject scriptPile;
|
||||
[SerializeField] GameObject eFie;
|
||||
|
||||
|
||||
InventoryScript inventory;
|
||||
ChangeHealth healthScript;
|
||||
HandleEnergy battery;
|
||||
FieScript fie;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
inventory = scriptPile.GetComponent<InventoryScript>();
|
||||
healthScript = scriptPile.GetComponent<ChangeHealth>();
|
||||
battery = scriptPile.GetComponent<HandleEnergy>();
|
||||
fie = eFie.GetComponent<FieScript>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
@@ -62,10 +65,12 @@ public class GameOver : MonoBehaviour
|
||||
|
||||
public void ShowDeathScreen()
|
||||
{
|
||||
fie.StopAllCoroutines();
|
||||
//Time.timeScale = 0;
|
||||
timerOn = true;
|
||||
timer = 10f;
|
||||
deathPanel.SetActive(true);
|
||||
LeanTween.scale(deathPanel, transform.localScale * 0.5f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
SpeakEnemy();
|
||||
costText.text = cost.ToString(); //ZUM DEBUGGEN
|
||||
CheckDeathTime();
|
||||
@@ -107,11 +112,13 @@ public class GameOver : MonoBehaviour
|
||||
inventory.Energy += battery.addEnergyValue;
|
||||
}
|
||||
|
||||
LeanTween.scale(deathPanel, transform.localScale * 0f, duration * Time.deltaTime).setDelay(.1f).setEase(LeanTweenType.easeOutBounce);
|
||||
deathPanel.SetActive(false);
|
||||
//Time.timeScale = 1;
|
||||
|
||||
//Logik: bei Retry, soll der Player nochmal neue Energie bekommen
|
||||
|
||||
|
||||
fie.StartStuff();
|
||||
}
|
||||
|
||||
public void CheckDeathTime()
|
||||
@@ -136,17 +143,25 @@ public class GameOver : MonoBehaviour
|
||||
public void CalculateCost()
|
||||
{
|
||||
cost = healthScript.deathCounter * 100;
|
||||
|
||||
if (cost == 300)
|
||||
{
|
||||
infoText.text = "You must really like being here.";
|
||||
}
|
||||
|
||||
if (cost >= 1000)
|
||||
{
|
||||
cost = 900;
|
||||
infoText.text = "But you refused.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool fieKill;
|
||||
public bool silvKill;
|
||||
public bool haiKill;
|
||||
public void SpeakEnemy()
|
||||
{
|
||||
|
||||
|
||||
if (fieKill)
|
||||
if (fie.fieKill)
|
||||
{
|
||||
infoText.text = "HAAHAHAHAHAAHAHAHAHAHAHAHAHA";
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ public class ShopScript : MonoBehaviour
|
||||
|
||||
[Header("Scripte")]
|
||||
|
||||
InventoryScript inventory;
|
||||
ChangeHealth healthScript;
|
||||
HandleEnergy battery;
|
||||
[SerializeField] InventoryScript inventory;
|
||||
[SerializeField] ChangeHealth healthScript;
|
||||
[SerializeField] HandleEnergy battery;
|
||||
|
||||
[Header("BuyValues")]
|
||||
|
||||
|
||||
9
Assets/Scripts/Button Functions/Tester.cs
Normal file
9
Assets/Scripts/Button Functions/Tester.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Tester : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
Vibrator.Vibrate();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Button Functions/Tester.cs.meta
Normal file
2
Assets/Scripts/Button Functions/Tester.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a33b90cbb5eaa341a2a0a790cc41e77
|
||||
@@ -10,7 +10,7 @@ public class TweenScript : MonoBehaviour
|
||||
|
||||
//private KeyCode secretCode = KeyCode.G;
|
||||
|
||||
Vector3 ort = new Vector3();
|
||||
//Vector3 ort = new Vector3();
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
48
Assets/Scripts/Button Functions/Vibrator.cs
Normal file
48
Assets/Scripts/Button Functions/Vibrator.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public static class Vibrator
|
||||
{
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
|
||||
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
|
||||
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");
|
||||
|
||||
#else
|
||||
public static AndroidJavaClass unityPlayer;
|
||||
public static AndroidJavaObject currentActivity;
|
||||
public static AndroidJavaObject vibrator;
|
||||
|
||||
#endif
|
||||
|
||||
public static void Vibrate(long milliseconds = 250)
|
||||
{
|
||||
if (IsAndroid())
|
||||
{
|
||||
vibrator.Call("vibrate", milliseconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
Handheld.Vibrate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Cancel()
|
||||
{
|
||||
if (IsAndroid())
|
||||
{
|
||||
vibrator.Call("cancel");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsAndroid()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Button Functions/Vibrator.cs.meta
Normal file
2
Assets/Scripts/Button Functions/Vibrator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b80c76f630d82047a40f8febee4add3
|
||||
Reference in New Issue
Block a user