Komplett Lauffähig + Vibration + Boni + Enemie "Jumpscares" - Audio
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Timers;
|
||||
using UnityEngine;
|
||||
|
||||
public class FieScript : MonoBehaviour
|
||||
@@ -12,15 +13,15 @@ public class FieScript : MonoBehaviour
|
||||
[SerializeField] GameObject SPRight;
|
||||
[SerializeField] GameObject SPDeath;
|
||||
|
||||
bool spawn1 = false;
|
||||
bool spawn2 = false;
|
||||
public bool spawnLeft = false;
|
||||
public bool spawn2 = false;
|
||||
|
||||
[Header("Character")]
|
||||
|
||||
[SerializeField] GameObject Fiefetti;
|
||||
//[SerializeField] int damageDealt = 1; //hat aktuell keinen Zweck
|
||||
|
||||
[SerializeField] public float stateTime = 10f;
|
||||
[SerializeField] public float stateTime = 5f;
|
||||
public bool fieKill;
|
||||
|
||||
[Header("Scripts")]
|
||||
@@ -28,23 +29,35 @@ public class FieScript : MonoBehaviour
|
||||
[SerializeField] GameObject scriptPile;
|
||||
[SerializeField] GameObject door1; //1 is always Left
|
||||
[SerializeField] GameObject door2;
|
||||
[SerializeField] GameObject levelScript;
|
||||
|
||||
[SerializeField] GameObject eSilv;
|
||||
[SerializeField] GameObject eHai;
|
||||
|
||||
LevelBehavior level;
|
||||
ChangeHealth healthScript;
|
||||
Door doorSwitch;
|
||||
Door doorSwitch2;
|
||||
|
||||
SilvScript silv;
|
||||
HaiScript hai;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
healthScript = scriptPile.GetComponent<ChangeHealth>();
|
||||
doorSwitch = door1.GetComponent<Door>();
|
||||
doorSwitch2 = door2.GetComponent<Door>();
|
||||
level = levelScript.GetComponent<LevelBehavior>();
|
||||
|
||||
silv = eSilv.GetComponent<SilvScript>();
|
||||
hai = eHai.GetComponent<HaiScript>();
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
button.SetActive(false); //zum vorherigen Debuggen genutzt
|
||||
spawn1 = false;
|
||||
spawn2 = false;
|
||||
spawnLeft = false;
|
||||
|
||||
|
||||
//StateOne();
|
||||
@@ -69,7 +82,7 @@ public class FieScript : MonoBehaviour
|
||||
|
||||
IEnumerator WanderAround()
|
||||
{
|
||||
|
||||
float elapsed = 0f;
|
||||
Debug.Log("Fiefetti: Wandering around");
|
||||
|
||||
button.SetActive(false);
|
||||
@@ -82,14 +95,18 @@ public class FieScript : MonoBehaviour
|
||||
int random = Random.Range(1, 3);
|
||||
if (random == 1) //1 bedeutet immer left
|
||||
{
|
||||
spawn1 = true;
|
||||
spawnLeft = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawn2 = true;
|
||||
spawnLeft = false;
|
||||
}
|
||||
Debug.Log("random = " + random);
|
||||
Debug.Log("random = " + random);
|
||||
|
||||
while (elapsed < stateTime)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
}
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderClose());
|
||||
@@ -97,20 +114,28 @@ public class FieScript : MonoBehaviour
|
||||
|
||||
IEnumerator WanderClose()
|
||||
{
|
||||
if (spawn1 == true) //1 bedeutet immer left
|
||||
float elapsed2 = 0;
|
||||
|
||||
if (spawnLeft == true) //1 bedeutet immer left
|
||||
{
|
||||
Fiefetti.transform.position = SPLeft.transform.position;
|
||||
Debug.Log("Ich stehe links.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Fiefetti.transform.position = SPRight.transform.position;
|
||||
Debug.Log("Ich stehe rechts.");
|
||||
}
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
|
||||
//einen von zwei Punkten aussuchen
|
||||
Debug.Log("Fiefetti: Komme näher");
|
||||
|
||||
while (elapsed2 < stateTime)
|
||||
{
|
||||
elapsed2 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(GetTooClose());
|
||||
@@ -118,39 +143,67 @@ public class FieScript : MonoBehaviour
|
||||
|
||||
IEnumerator GetTooClose()
|
||||
{
|
||||
float elapsed3 = 0;
|
||||
|
||||
if (doorSwitch.isOpen == true)
|
||||
float stickAround = 0f;
|
||||
|
||||
if (spawnLeft && doorSwitch.isOpen == true)
|
||||
{
|
||||
Fiefetti.transform.position = SPDeath.transform.position;
|
||||
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 (doorSwitch2.isOpen == true)
|
||||
else if (!spawnLeft && doorSwitch2.isOpen == true)
|
||||
{
|
||||
Fiefetti.transform.position = SPDeath.transform.position;
|
||||
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
|
||||
{
|
||||
//AudioSpielen
|
||||
fieKill = false;
|
||||
|
||||
level.earnedGems += level.earnGems;
|
||||
Debug.Log("Du hast bereits " + level.earnedGems + " Gems verdient.");
|
||||
Debug.Log("Fiefetti: Och menno");
|
||||
Fiefetti.transform.position = SPBack.transform.position;
|
||||
|
||||
}
|
||||
|
||||
spawn1 = false;
|
||||
spawn2 = false;
|
||||
spawnLeft = false;
|
||||
//StateOne();
|
||||
|
||||
while (elapsed3 < stateTime)
|
||||
{
|
||||
elapsed3 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
|
||||
206
Assets/Scripts/Enemy/HaiScript.cs
Normal file
206
Assets/Scripts/Enemy/HaiScript.cs
Normal file
@@ -0,0 +1,206 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class HaiScript : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] GameObject button;
|
||||
|
||||
[Header("Spawn Points")]
|
||||
|
||||
[SerializeField] GameObject SPBack;
|
||||
[SerializeField] GameObject SPLeft;
|
||||
[SerializeField] GameObject SPRight;
|
||||
[SerializeField] GameObject SPDeath;
|
||||
|
||||
bool spawnLeft = false;
|
||||
|
||||
[Header("Character")]
|
||||
|
||||
[SerializeField] GameObject Hai;
|
||||
//[SerializeField] int damageDealt = 1; //hat aktuell keinen Zweck
|
||||
|
||||
[SerializeField] public float stateTime = 10f;
|
||||
public bool haiKill;
|
||||
|
||||
[Header("Scripts")]
|
||||
|
||||
[SerializeField] GameObject scriptPile;
|
||||
[SerializeField] GameObject door1; //1 is always Left
|
||||
[SerializeField] GameObject door2;
|
||||
[SerializeField] GameObject levelScript;
|
||||
|
||||
[SerializeField] GameObject eFie;
|
||||
[SerializeField] GameObject eSilv;
|
||||
|
||||
ChangeHealth healthScript;
|
||||
Door doorSwitch;
|
||||
Door doorSwitch2;
|
||||
LevelBehavior level;
|
||||
|
||||
FieScript fie;
|
||||
SilvScript silv;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
healthScript = scriptPile.GetComponent<ChangeHealth>();
|
||||
doorSwitch = door1.GetComponent<Door>();
|
||||
doorSwitch2 = door2.GetComponent<Door>();
|
||||
level = levelScript.GetComponent<LevelBehavior>();
|
||||
|
||||
fie = eFie.GetComponent<FieScript>();
|
||||
silv = eSilv.GetComponent<SilvScript>();
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
button.SetActive(false); //zum vorherigen Debuggen genutzt
|
||||
spawnLeft = false;
|
||||
|
||||
|
||||
//StateOne();
|
||||
StartStuff();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void HitPlayer()
|
||||
{
|
||||
healthScript.GetHit();
|
||||
}
|
||||
|
||||
public void StartStuff()
|
||||
{
|
||||
Debug.Log("I´m starting stuff.");
|
||||
StartCoroutine(WanderAround());
|
||||
}
|
||||
|
||||
IEnumerator WanderAround()
|
||||
{
|
||||
float elapsed = 0;
|
||||
|
||||
Debug.Log("Hai: Wandering around");
|
||||
|
||||
button.SetActive(false);
|
||||
|
||||
Hai.transform.position = SPBack.transform.position;
|
||||
|
||||
//Hauptposition
|
||||
Debug.Log("Hai: Bin hinten");
|
||||
|
||||
int random = Random.Range(1, 3);
|
||||
if (random == 1) //1 bedeutet immer left
|
||||
{
|
||||
spawnLeft = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnLeft = false;
|
||||
}
|
||||
Debug.Log("random = " + random);
|
||||
|
||||
while (elapsed < stateTime)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderClose());
|
||||
}
|
||||
|
||||
IEnumerator WanderClose()
|
||||
{
|
||||
float elapsed2 = 0;
|
||||
|
||||
if (spawnLeft == true) //1 bedeutet immer left
|
||||
{
|
||||
Hai.transform.position = SPLeft.transform.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hai.transform.position = SPRight.transform.position;
|
||||
}
|
||||
|
||||
//einen von zwei Punkten aussuchen
|
||||
Debug.Log("Hai: Komme näher");
|
||||
|
||||
while (elapsed2 < stateTime)
|
||||
{
|
||||
elapsed2 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(GetTooClose());
|
||||
}
|
||||
|
||||
IEnumerator GetTooClose()
|
||||
{
|
||||
float elapsed3 = 0;
|
||||
float stickAround = 0f;
|
||||
|
||||
if (spawnLeft && doorSwitch.isOpen == true)
|
||||
{
|
||||
Hai.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Hai: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
|
||||
fie.fieKill = false;
|
||||
silv.silvKill = false;
|
||||
haiKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Hai.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!spawnLeft && doorSwitch2.isOpen == true)
|
||||
{
|
||||
Hai.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Hai: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
|
||||
fie.fieKill = false;
|
||||
silv.silvKill = false;
|
||||
haiKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Hai.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//AudioSpielen
|
||||
haiKill = false;
|
||||
level.earnedGems += level.earnGems;
|
||||
Debug.Log("Hai: Och menno");
|
||||
Hai.transform.position = SPBack.transform.position;
|
||||
}
|
||||
|
||||
spawnLeft = false;
|
||||
//StateOne();
|
||||
|
||||
while (elapsed3 < stateTime)
|
||||
{
|
||||
elapsed3 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Enemy/HaiScript.cs.meta
Normal file
2
Assets/Scripts/Enemy/HaiScript.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd201b6436c5bb94e8e0a18597566fd4
|
||||
@@ -1,3 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
@@ -7,52 +9,124 @@ public class LevelBehavior : MonoBehaviour
|
||||
[SerializeField] GameObject eSilv;
|
||||
[SerializeField] GameObject eHai;
|
||||
|
||||
FieScript fie;
|
||||
[SerializeField] GameObject deathPanel;
|
||||
[SerializeField] GameObject inventoryScript;
|
||||
|
||||
FieScript fie;
|
||||
SilvScript silv;
|
||||
HaiScript hai;
|
||||
GameOver end;
|
||||
InventoryScript inventory;
|
||||
|
||||
int curScene = 0;
|
||||
float timer = 0f;
|
||||
|
||||
public bool gameOngoing;
|
||||
|
||||
public int earnGems = 5;
|
||||
public int earnedGems = 0;
|
||||
public bool gameWon;
|
||||
private void Awake()
|
||||
{
|
||||
fie = eFie.GetComponent<FieScript>();
|
||||
silv = eSilv.GetComponent<SilvScript>();
|
||||
hai = eHai.GetComponent<HaiScript>();
|
||||
|
||||
end = inventoryScript.GetComponent<GameOver>();
|
||||
inventory = inventoryScript.GetComponent<InventoryScript>();
|
||||
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
gameWon = false;
|
||||
gameOngoing = true;
|
||||
|
||||
// Create a temporary reference to the current scene.
|
||||
Scene currentScene = SceneManager.GetActiveScene();
|
||||
|
||||
// Retrieve the name of this scene.
|
||||
string sceneName = currentScene.name;
|
||||
|
||||
|
||||
// Retrieve the index of the scene in the project's build settings.
|
||||
int buildIndex = currentScene.buildIndex;
|
||||
|
||||
if (sceneName == "Day1")
|
||||
{
|
||||
Debug.Log("Es ist Tag 1");
|
||||
curScene = 2;
|
||||
fie.stateTime = 7;
|
||||
silv.stateTime = 25;
|
||||
hai.stateTime = 35;
|
||||
}
|
||||
|
||||
if (sceneName == "Day2")
|
||||
{
|
||||
|
||||
Debug.Log("Es ist Tag 2");
|
||||
curScene = 5;
|
||||
fie.stateTime = 5;
|
||||
silv.stateTime = 10;
|
||||
hai.stateTime = 25;
|
||||
// Do something...
|
||||
}
|
||||
else if (sceneName == "Day6")
|
||||
else if (sceneName == "Day3")
|
||||
{
|
||||
|
||||
Debug.Log("Es ist Tag 3");
|
||||
curScene = 4;
|
||||
fie.stateTime = 3;
|
||||
silv.stateTime = 10;
|
||||
hai.stateTime = 15;
|
||||
// Do something...
|
||||
}
|
||||
|
||||
// Retrieve the index of the scene in the project's build settings.
|
||||
int buildIndex = currentScene.buildIndex;
|
||||
|
||||
//// Check the scene name as a conditional.
|
||||
//switch (buildIndex)
|
||||
//{
|
||||
// case 0:
|
||||
// // Do something...
|
||||
// break;
|
||||
// case 1:
|
||||
// // Do something...
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (gameOngoing == true)
|
||||
{
|
||||
TimeIs();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void TimeIs()
|
||||
{
|
||||
timer += Time.deltaTime;
|
||||
//Debug.Log(timer);
|
||||
|
||||
|
||||
if (timer >= 90)
|
||||
{
|
||||
end.ShowWinScreen();
|
||||
gameWon = true;
|
||||
inventory.Gems += earnedGems;
|
||||
|
||||
timer = 0;
|
||||
|
||||
gameOngoing = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SwitchScene()
|
||||
{
|
||||
Debug.Log("Ich will jetzt in Scene " + curScene++ + " wechseln.");
|
||||
|
||||
gameOngoing = false;
|
||||
gameWon = false;
|
||||
|
||||
if (curScene < 5)
|
||||
{
|
||||
Debug.Log("Ist noch nicht Tag 3");
|
||||
|
||||
SceneManager.LoadSceneAsync(curScene++);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Es war Tag 3");
|
||||
SceneManager.LoadScene(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
210
Assets/Scripts/Enemy/SilvScript.cs
Normal file
210
Assets/Scripts/Enemy/SilvScript.cs
Normal file
@@ -0,0 +1,210 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
public class SilvScript : MonoBehaviour
|
||||
{
|
||||
|
||||
[SerializeField] GameObject button;
|
||||
|
||||
[Header("Spawn Points")]
|
||||
|
||||
[SerializeField] GameObject SPBack;
|
||||
[SerializeField] GameObject SPLeft;
|
||||
[SerializeField] GameObject SPRight;
|
||||
[SerializeField] GameObject SPDeath;
|
||||
|
||||
bool spawnLeft = false;
|
||||
|
||||
[Header("Character")]
|
||||
|
||||
[SerializeField] GameObject Silv;
|
||||
//[SerializeField] int damageDealt = 1; //hat aktuell keinen Zweck
|
||||
|
||||
[SerializeField] public float stateTime = 15f;
|
||||
public bool silvKill;
|
||||
|
||||
[Header("Scripts")]
|
||||
|
||||
[SerializeField] GameObject scriptPile;
|
||||
[SerializeField] GameObject door1; //1 is always Left
|
||||
[SerializeField] GameObject door2;
|
||||
[SerializeField] GameObject levelScript;
|
||||
|
||||
[SerializeField] GameObject eFie;
|
||||
[SerializeField] GameObject eHai;
|
||||
|
||||
LevelBehavior level;
|
||||
ChangeHealth healthScript;
|
||||
Door doorSwitch;
|
||||
Door doorSwitch2;
|
||||
|
||||
FieScript fie;
|
||||
HaiScript hai;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
level = levelScript.GetComponent<LevelBehavior>();
|
||||
healthScript = scriptPile.GetComponent<ChangeHealth>();
|
||||
doorSwitch = door1.GetComponent<Door>();
|
||||
doorSwitch2 = door2.GetComponent<Door>();
|
||||
|
||||
fie = eFie.GetComponent<FieScript>();
|
||||
hai = eHai.GetComponent<HaiScript>();
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
button.SetActive(false); //zum vorherigen Debuggen genutzt
|
||||
spawnLeft = false;
|
||||
|
||||
|
||||
//StateOne();
|
||||
StartStuff();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void HitPlayer()
|
||||
{
|
||||
healthScript.GetHit();
|
||||
}
|
||||
|
||||
public void StartStuff()
|
||||
{
|
||||
Debug.Log("I´m starting stuff.");
|
||||
StartCoroutine(WanderAround());
|
||||
}
|
||||
|
||||
IEnumerator WanderAround()
|
||||
{
|
||||
float elapsed = 0;
|
||||
|
||||
Debug.Log("Silv: Wandering around");
|
||||
|
||||
button.SetActive(false);
|
||||
|
||||
Silv.transform.position = SPBack.transform.position;
|
||||
|
||||
//Hauptposition
|
||||
Debug.Log("Silv: Bin hinten");
|
||||
|
||||
int random = Random.Range(1, 3);
|
||||
if (random == 1) //1 bedeutet immer left
|
||||
{
|
||||
spawnLeft = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawnLeft = false;
|
||||
}
|
||||
Debug.Log("random = " + random);
|
||||
|
||||
while (elapsed < stateTime)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderClose());
|
||||
}
|
||||
|
||||
IEnumerator WanderClose()
|
||||
{
|
||||
|
||||
float elapsed2 = 0;
|
||||
|
||||
if (spawnLeft == true) //1 bedeutet immer left
|
||||
{
|
||||
Silv.transform.position = SPLeft.transform.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
Silv.transform.position = SPRight.transform.position;
|
||||
}
|
||||
|
||||
//einen von zwei Punkten aussuchen
|
||||
Debug.Log("Silv: Komme näher");
|
||||
|
||||
while (elapsed2 < stateTime)
|
||||
{
|
||||
elapsed2 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(GetTooClose());
|
||||
}
|
||||
|
||||
IEnumerator GetTooClose()
|
||||
{
|
||||
float elapsed3 = 0;
|
||||
|
||||
float stickAround = 0f;
|
||||
|
||||
if (spawnLeft && doorSwitch.isOpen == true)
|
||||
{
|
||||
Silv.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Silv: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
|
||||
fie.fieKill = false;
|
||||
hai.haiKill = false;
|
||||
silvKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Silv.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!spawnLeft && doorSwitch2.isOpen == true)
|
||||
{
|
||||
Silv.transform.position = SPDeath.transform.position;
|
||||
Debug.Log("Silv: Hab dich!");
|
||||
//reingehen
|
||||
HitPlayer();
|
||||
//StateOne();
|
||||
|
||||
fie.fieKill = false;
|
||||
hai.haiKill = false;
|
||||
silvKill = true;
|
||||
|
||||
stickAround += Time.deltaTime;
|
||||
if (stickAround >= 2f)
|
||||
{
|
||||
Silv.transform.position = SPBack.transform.position;
|
||||
stickAround = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//AudioSpielen
|
||||
silvKill = false;
|
||||
level.earnedGems += level.earnGems;
|
||||
Debug.Log("Silv: Och menno");
|
||||
Silv.transform.position = SPBack.transform.position;
|
||||
}
|
||||
|
||||
spawnLeft = false;
|
||||
//StateOne();
|
||||
|
||||
while (elapsed3 < stateTime)
|
||||
{
|
||||
elapsed3 += Time.deltaTime;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(stateTime);
|
||||
|
||||
StartCoroutine(WanderAround());
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Enemy/SilvScript.cs.meta
Normal file
2
Assets/Scripts/Enemy/SilvScript.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b3779046044f5944a44d2efba268051
|
||||
Reference in New Issue
Block a user