示例#1
0
    void Start()
    {
        Time.timeScale = 1;
        GameObject stayAliveObject = GameObject.FindWithTag("GameController");

        stayAlive = stayAliveObject.GetComponent <StayAlive>();

        score          = 0;
        scoreText.text = "Score: " + score;
        StartCoroutine(AddScore());
    }
示例#2
0
    private IEnumerator StayAlive()
    {
        yield return(new WaitForSeconds(stayAliveTimer));

        StayAlive message = new StayAlive();

        message.packetType = (int)GameClientPackets.StayAlive;
        string json = JsonUtility.ToJson(message);

        ws.Send(json);
        StartCoroutine(StayAlive());
    }
示例#3
0
    void Start()
    {
        GameObject stayAliveObject = GameObject.FindWithTag("GameController");

        stayAlive = stayAliveObject.GetComponent <StayAlive>();

        pauseText.text = "";
        pauseImage.SetActive(false);
        loadingImage.SetActive(false);
        loadingText.text = "";

        AudioListener.pause = false;
    }