Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,96 @@ trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
Assets/
├── Scenes/
│ └── DarkEnding.unity
├── Scripts/
│ ├── DarkEndingManager.cs
│ ├── GateTap.cs
│ └── FakeCrash.cs
├── Audio/
│ ├── whisper.mp3
│ ├── heartbeat.mp3
│ └── glitch.mp3
└── UI/
└── DarkText.prefab
using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class DarkEndingManager : MonoBehaviour
{
public Image blackScreen;
public Text endingText;
public AudioSource audioSource;
public AudioClip whisper;
public AudioClip heartbeat;

void Start()
{
StartCoroutine(StartEnding());
}

IEnumerator StartEnding()
{
audioSource.clip = heartbeat;
audioSource.loop = true;
audioSource.Play();

yield return new WaitForSeconds(2f);

audioSource.PlayOneShot(whisper);
yield return FadeToBlack();

endingText.text = "The gate was never inside the building...";
yield return new WaitForSeconds(2f);

endingText.text = "It was inside you.";
yield return new WaitForSeconds(2f);

endingText.text = "YOU ARE STILL HERE";
}

IEnumerator FadeToBlack()
{
for (float i = 0; i <= 1; i += Time.deltaTime / 3)
{
blackScreen.color = new Color(0,0,0,i);
yield return null;
}
}
}using UnityEngine;

public class GateTap : MonoBehaviour
{
int taps = 0;
public int requiredTaps = 15;

public void TapGate()
{
taps++;
Handheld.Vibrate();

if (taps >= requiredTaps)
{
UnityEngine.SceneManagement.SceneManager
.LoadScene("DarkEnding");
}
}
}using UnityEngine;
using System.Collections;

public class FakeCrash : MonoBehaviour
{
void Start()
{
StartCoroutine(CrashEffect());
}

IEnumerator CrashEffect()
{
Time.timeScale = 0f;
yield return new WaitForSecondsRealtime(3f);
Time.timeScale = 1f;
}
}PlayerPrefs.SetInt("DarkEndingSeen", 1);