示例#1
0
文件: Restarter.cs 项目: yinlei/iss
    void LateUpdate()
    {
        if (!GameController.Instance.IsServer)
        {
            return;
        }

        if (Input.GetKey(Config.Instance.keyboardButtonReset) || Config.Instance.UseWii && wiiController.WiiMote.getButtonState(Config.Instance.wiiButtonReset) == ButtonState.TOGGLE_DOWN)
        {
            restart();

            if (!Config.Instance.IsStandalone)
            {
                observer.SendRestartGame();
            }

            restartFrame = Time.frameCount;
        }

        // Das muss wirklich zwei mal gemacht werden, sonst gibt's Chaos...
        // TODO: fix.
        if (Time.frameCount == restartFrame + 2)
        {
            restartFrame = 0;
            restart();

            if (!Config.Instance.IsStandalone)
            {
                observer.SendRestartGame();
            }
        }

        /* Das Crasht zur Zeit. Animation nicht Vorhanden. Müll aus vergangenen Zeiten?
         * if (Input.GetKeyDown(KeyCode.Z))
         * {
         * Logger.Log("!");
         * GameObject.Find("Model").animation.Play("Take 001");
         * }*/
    }