Example #1
0
    private IEnumerator CheckLosingRoutine()
    {
        while (true)
        {
            if (ascended)
            {
                ascendTrigger.Fire();
                StopCoroutine(RandomEventRoutine());
                StopCoroutine(aging);
                StopCoroutine(random);
                StopCoroutine(dateincrementor);
                yield return(new WaitForSeconds(4));

                StopAllCoroutines();
                gameSpawner.destroyGame();
                Debug.Log("You Lose, because you killed yourself");
            }

            if (playerAge.Value() < 0 || playerAge.Value() > 1200)
            {
                StopCoroutine(RandomEventRoutine());
                StopCoroutine(aging);
                StopCoroutine(random);
                StopCoroutine(dateincrementor);
                yield return(new WaitForSeconds(4));

                StopAllCoroutines();
                gameSpawner.destroyGame();
                Debug.Log("You Lose");
            }

            yield return(new WaitForSeconds(tickPeriod.Value() / 30));
        }
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (!EditorApplication.isPlaying)
        {
            return;
        }

        SimpleEvent simpleEvent = (SimpleEvent)target;

        if (GUILayout.Button("Fire!"))
        {
            simpleEvent.Fire();
            Debug.LogWarning("Simple Event!");
        }
    }