This question was
closed Dec 15, 2015 at 12:36 AM by
KnightRiderGuy for the following reason:
The question is answered, right answer was accepted
Question by
KnightRiderGuy · Dec 15, 2015 at 12:22 AM ·
c#standalonequitcloseapplication.quit
Stand Alone App Does Not Quit Application
I can't figure out why the stand alone application does not quit ?
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ShutdownScreenManager : MonoBehaviour {
int sysHour = System.DateTime.Now.Hour; //gives you the current hour as an integer.
//Random Clips
public AudioClip[] goodNightVoices;
public AudioClip[] goodAfternoonVoices;
public AudioClip[] goodDayVoices;
bool GoodbyeUser = true;
// Use this for initialization
void Start () {
StartCoroutine(GreetUser2());
StartCoroutine(Q3());
}
// Update is called once per frame
void Update () {
}
IEnumerator GreetUser2()
{
if (GoodbyeUser) GreetUser2();
//GoodbyeUser = true;
//Time OF Day Notification
//Morning Time
if (sysHour >= 01 && sysHour <= 12) {
AudioClip randomClip = goodDayVoices [UnityEngine.Random.Range (0, goodDayVoices.Length)];
//Play that sound.
GetComponent<AudioSource> ().PlayOneShot (randomClip);
}
//Noon Time
if (sysHour >= 12 && sysHour <= 18) {
AudioClip randomClip = goodAfternoonVoices [UnityEngine.Random.Range (0, goodAfternoonVoices.Length)];
//Play that sound.
GetComponent<AudioSource> ().PlayOneShot (randomClip);
}
//Night Time
if (sysHour >= 18 && sysHour <= 24) {
AudioClip randomClip = goodNightVoices [UnityEngine.Random.Range (0, goodNightVoices.Length)];
//Play that sound.
GetComponent<AudioSource> ().PlayOneShot (randomClip);
}
yield return new WaitForSeconds(3.1f); // wait time
}
IEnumerator Q3()
{
yield return new WaitForSeconds(3.1f); // wait time
Sending.sendPulse5 ();
Application.Quit();
}
}
Comment
Best Answer
Answer by KnightRiderGuy · Dec 15, 2015 at 12:36 AM
I figured out what it was, the Arduino needed to be plugged in in order for the application to quit.