STUFF!
This commit is contained in:
parent
ca80f88c55
commit
1f7f4adcda
|
@ -43,3 +43,4 @@ MonoBehaviour:
|
||||||
- {fileID: 8300000, guid: e24c2fccb4285ab4eacc6da16f5c62eb, type: 3}
|
- {fileID: 8300000, guid: e24c2fccb4285ab4eacc6da16f5c62eb, type: 3}
|
||||||
- {fileID: 8300000, guid: fd92966d4cde3244d9a711094cb947f6, type: 3}
|
- {fileID: 8300000, guid: fd92966d4cde3244d9a711094cb947f6, type: 3}
|
||||||
- {fileID: 8300000, guid: 07e7ba37a1d069e4cba742b110efe302, type: 3}
|
- {fileID: 8300000, guid: 07e7ba37a1d069e4cba742b110efe302, type: 3}
|
||||||
|
- {fileID: 8300000, guid: 30174d02743df2be1af37078afc1592e, type: 3}
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,23 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 30174d02743df2be1af37078afc1592e
|
||||||
|
AudioImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 7
|
||||||
|
defaultSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
loadType: 0
|
||||||
|
sampleRateSetting: 0
|
||||||
|
sampleRateOverride: 44100
|
||||||
|
compressionFormat: 1
|
||||||
|
quality: 1
|
||||||
|
conversionMode: 0
|
||||||
|
preloadAudioData: 0
|
||||||
|
platformSettingOverrides: {}
|
||||||
|
forceToMono: 0
|
||||||
|
normalize: 1
|
||||||
|
loadInBackground: 0
|
||||||
|
ambisonic: 0
|
||||||
|
3D: 1
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,7 @@ using UnityEngine.SceneManagement;
|
||||||
public class GameOverMainMenuReturnerButtonScriptForLoadingTheMainMenuSceneOnceAPlayerHasDiedAndHasThenPressedTheMainMenuButtonOnTheGameOverScreen : MonoBehaviour
|
public class GameOverMainMenuReturnerButtonScriptForLoadingTheMainMenuSceneOnceAPlayerHasDiedAndHasThenPressedTheMainMenuButtonOnTheGameOverScreen : MonoBehaviour
|
||||||
{
|
{
|
||||||
public void r() {
|
public void r() {
|
||||||
|
AudioManager.StopAllAudio();
|
||||||
SceneManager.LoadScene(0);
|
SceneManager.LoadScene(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,15 @@ public class GameManager : MonoBehaviour
|
||||||
|
|
||||||
public int Revives { get; private set; }
|
public int Revives { get; private set; }
|
||||||
|
|
||||||
|
public GameObject ReviveParticleSystem;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
if (Instance == null)
|
if (Instance == null)
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
Revives = 0;
|
Revives = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -36,15 +38,24 @@ public class GameManager : MonoBehaviour
|
||||||
public void playerDied(GameObject who)
|
public void playerDied(GameObject who)
|
||||||
{
|
{
|
||||||
if (Revives == 0)
|
if (Revives == 0)
|
||||||
|
{
|
||||||
|
AudioManager.StopAllAudio();
|
||||||
|
AudioManager.PlaySound("Game_Over_Jingle", Vector3.zero);
|
||||||
SceneManager.LoadScene(3);
|
SceneManager.LoadScene(3);
|
||||||
else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Revives--;
|
Revives--;
|
||||||
Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 5f);
|
Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 3f);
|
||||||
|
|
||||||
foreach (Collider2D c in d) {
|
Debug.Log(d);
|
||||||
if (c.gameObject.CompareTag("Enemy")) {
|
|
||||||
c.gameObject.GetComponent<HealthComponent>().TakeDamage(9999999999);
|
foreach (Collider2D c in d)
|
||||||
}
|
{
|
||||||
|
if (c.gameObject.CompareTag("Enemy"))
|
||||||
|
{
|
||||||
|
c.gameObject.GetComponent<HealthComponent>().TakeDamage(69420);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var g = who.GetComponent<HealthComponent>();
|
var g = who.GetComponent<HealthComponent>();
|
||||||
|
@ -52,6 +63,12 @@ public class GameManager : MonoBehaviour
|
||||||
g.setMaxHealth(g.getMaxHealth(), true);
|
g.setMaxHealth(g.getMaxHealth(), true);
|
||||||
|
|
||||||
// REVIVE SOUND HERE
|
// REVIVE SOUND HERE
|
||||||
|
AudioManager.PlaySound("Revive_SFX", who.transform.position);
|
||||||
|
RumbleManager.StartRumble(0, 0.3f, 0.1f, 3f);
|
||||||
|
RumbleManager.StartRumble(1, 0.3f, 0.1f, 3f);
|
||||||
|
|
||||||
|
ReviveParticleSystem.transform.position = who.transform.position;
|
||||||
|
ReviveParticleSystem.GetComponent<ParticleSystem>().Play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,9 @@ public class HealthBar : MonoBehaviour
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Color healthLeftColor, unusedHealth;
|
private Color healthLeftColor, unusedHealth;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool disableOnDeath = true;
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
if (healthBarImg != null)
|
if (healthBarImg != null)
|
||||||
|
@ -28,7 +31,7 @@ public class HealthBar : MonoBehaviour
|
||||||
{
|
{
|
||||||
float percent = newHealth / attachedHealth.getMaxHealth();
|
float percent = newHealth / attachedHealth.getMaxHealth();
|
||||||
healthBarImg.fillAmount = percent;
|
healthBarImg.fillAmount = percent;
|
||||||
if (percent <= 0)
|
if (disableOnDeath && percent <= 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < transform.childCount; i++)
|
for (int i = 0; i < transform.childCount; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,15 +4,17 @@ using UnityEngine;
|
||||||
|
|
||||||
public class IngameMusic : MonoBehaviour
|
public class IngameMusic : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
float volume = 0.4f;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
AudioManager.PlaySound("Intro_Flatline", new Vector3(0f, 0f, 0f), false, false).volume = 1f;
|
AudioManager.PlaySound("Intro_Flatline", new Vector3(0f, 0f, 0f), false, false).volume = volume;
|
||||||
|
|
||||||
Invoke("PlayMusic", 3);
|
Invoke("PlayMusic", 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayMusic()
|
void PlayMusic()
|
||||||
{
|
{
|
||||||
AudioManager.PlaySound("Ingame_Theme", new Vector3(0f, 0f, 0f), false, false, true, true).volume = 1f;
|
AudioManager.PlaySound("Ingame_Theme", new Vector3(0f, 0f, 0f), false, false, true, true).volume = volume;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,8 @@ EditorBuildSettings:
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/GameScene.unity
|
path: Assets/Scenes/GameScene.unity
|
||||||
guid: 0400e5e5779425c40ba3164b1e0b5b59
|
guid: 0400e5e5779425c40ba3164b1e0b5b59
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/Scenes/GamOvSnence.unity
|
||||||
|
guid: 485a4a01988ea88d08f76e749dcbd6c0
|
||||||
m_configObjects:
|
m_configObjects:
|
||||||
com.unity.input.settings: {fileID: 11400000, guid: de04e34f85a966e4da851d9b3d804fa1, type: 2}
|
com.unity.input.settings: {fileID: 11400000, guid: de04e34f85a966e4da851d9b3d804fa1, type: 2}
|
||||||
|
|
Loading…
Reference in New Issue