mirror of
https://github.com/Ratstail91/Keep-It-Alive.git
synced 2025-11-29 02:24:27 +11:00
Mostly finished, just needs sound, polish and hosting online
This commit is contained in:
30
Assets/Scripts/Endings/Claws.cs
Normal file
30
Assets/Scripts/Endings/Claws.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class Claws : MonoBehaviour {
|
||||
SpriteRenderer spriteRenderer;
|
||||
|
||||
void Awake() {
|
||||
spriteRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
StartCoroutine(FadeOverTime(2f));
|
||||
StartCoroutine(SwitchScenesAfter("MainMenu", 5f));
|
||||
}
|
||||
|
||||
IEnumerator FadeOverTime(float delay) {
|
||||
while (true) {
|
||||
Color color = spriteRenderer.color;
|
||||
color.a -= delay / 60f;
|
||||
spriteRenderer.color = color;
|
||||
|
||||
yield return new WaitForSeconds(delay / 60f);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator SwitchScenesAfter(string sceneName, float delay) {
|
||||
yield return new WaitForSeconds(delay);
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Endings/Claws.cs.meta
Normal file
11
Assets/Scripts/Endings/Claws.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 488f7b2b2ebd02364a2eba590676c379
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/Scripts/Endings/FireGoesOut.cs
Normal file
16
Assets/Scripts/Endings/FireGoesOut.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class FireGoesOut : MonoBehaviour {
|
||||
void Awake() {
|
||||
//TODO: play extinguished sound
|
||||
StartCoroutine(SwitchScenesAfter("MainMenu", 3f));
|
||||
}
|
||||
|
||||
IEnumerator SwitchScenesAfter(string sceneName, float delay) {
|
||||
yield return new WaitForSeconds(delay);
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Endings/FireGoesOut.cs.meta
Normal file
11
Assets/Scripts/Endings/FireGoesOut.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98201cca7edac30218501be7ca90b055
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user