コード例 #1
0
    IEnumerator ListenForReturn()
    {
        float countdown = 3;
        float time      = 0f;

        listening = true;

        while (listening)
        {
            var exit = Input.GetAxis("Submit");
            if (exit != 0)
            {
                HelperTools.ToggleOn(textCG);
                countdown          = Mathf.Ceil(3f - 2f * (Time.time - time));
                CountdownText.text = "" + countdown;
                if (countdown <= 0)
                {
                    HelperTools.ToggleOff(textCG);
                    yield return(ReturnToTheLab());
                }
            }
            else
            {
                HelperTools.ToggleOff(textCG);
                time      = Time.time;
                countdown = 3;
            }
            yield return(null);
        }
    }
コード例 #2
0
ファイル: OldGM.cs プロジェクト: saporter/Jascity
    public void ResetRace()
    {
        if (!Racing)
        {
            return;
        }

        RacingToggleEvent.Invoke();
        StartAreaGameObject.transform.position = originalStartAreaPosition;
        Racing                         = false;
        Finished                       = false;
        transform.position             = startPos;
        transform.rotation             = startRotation;
        Camera.main.transform.position = startCameraPos;
        Camera.main.transform.rotation = startCameraRot;
        Camera.main.orthographicSize   = startCameraSize;
        Camera.main.transform.SetParent(startCameraParent);
        RacingWarble.GetComponent <GeneBehaviorController>().enabled = false;
        RacingWarble.transform.position = startPos;
        RacingWarble.transform.SetParent(originalWarbleParent);
        RacingWarble = null;
        timer.StopTimer();
        input.ActiveWarble = null;
        currentPosition    = 0;

        if (notepadOn)
        {
            HelperTools.ToggleOn(NotepadCG);
        }
    }
コード例 #3
0
ファイル: LaunchController.cs プロジェクト: saporter/Jascity
 IEnumerator WaitForRaceEnd()
 {
     while (OldGM.Instance.Racing)
     {
         yield return(new WaitForSeconds(0.1f));
     }
     HelperTools.ToggleOn(cgRandom);
 }
コード例 #4
0
    void Update()
    {
        var input = Input.GetAxis("Submit");

        if (input != 0f)
        {
            HelperTools.ToggleOn(cg);
        }
    }
コード例 #5
0
 public void StartTimer()
 {
     TimeLeft       = StartCountdownFrom;
     AdditionalTime = 0f;
     startTime      = Time.time;
     counting       = true;
     HelperTools.ToggleOn(cg);
     StartCoroutine(Counting());
 }
コード例 #6
0
ファイル: LaunchController.cs プロジェクト: saporter/Jascity
    private void OnTriggerExit(Collider other)
    {
        if (gameManager.Racing)
        {
            return;
        }

        if (countdownCoroutine != null)
        {
            StopCoroutine(countdownCoroutine);
            countdownCoroutine = null;
        }
        keepFading = false;
        HelperTools.ToggleOn(cgRandom);
        HelperTools.ToggleOff(cgCountdown);
    }
コード例 #7
0
ファイル: LaunchController.cs プロジェクト: saporter/Jascity
    private void OnTriggerEnter(Collider other)
    {
        if (gameManager.Racing)
        {
            return;
        }


        HelperTools.ToggleOff(cgRandom);
        HelperTools.ToggleOn(cgCountdown);

        if (countdownCoroutine == null)
        {
            countdownCoroutine = StartCoroutine(Countdown(other.gameObject));
        }
    }