Created
March 11, 2016 22:37
-
-
Save mikelovesrobots/f04e78f1d1eacbc6fc09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System; | |
using System.Collections; | |
public class CheatActivator : MonoBehaviour { | |
private DateTime ClickedAt; | |
private const int MIN_SECONDS = 5; | |
private const string CHEAT_SCENE = "Cheats"; | |
public void OnPress(bool isDown) { | |
if (isDown) { | |
ClickedAt = DateTime.Now; | |
} else { | |
var timeDiff = DateTime.Now - ClickedAt; | |
if (timeDiff.TotalSeconds >= MIN_SECONDS) { | |
SceneTransitioner.Instance.TransitionTo(CHEAT_SCENE); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment