Пример #1
0
    void Awake()
    {
        if (Initialization != null && Initialization != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            Initialization = this;
        }

        DontDestroyOnLoad(this);

#if UNITY_EDITOR || (!UNITY_IPHONE || !UNITY_ANDROID)
        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = 60;
#elif UNITY_IPHONE || UNITY_ANDROID && !UNITY_EDITOR
        QualitySettings.vSyncCount = 0;
#endif
        if (GameSpeed == 0)
        {
            GameSpeed = 1;
        }
        TimeEngine.gameSpeed = GameSpeed;

        if (useCameraSizeHandler)
        {
            camSizeHandler = new CameraSizeHandler();
            camSizeHandler.SetCameraFieldOfView(Camera.main);
        }
    }
Пример #2
0
    void Start()
    {
        if (Initialization != null && Initialization != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            Initialization = this;
        }

        DontDestroyOnLoad(this);

#if UNITY_EDITOR || (!UNITY_IPHONE || !UNITY_ANDROID)
        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = 30;
        Time.timeScale = 1f;
#elif UNITY_IPHONE || UNITY_ANDROID && !UNITY_EDITOR
        QualitySettings.vSyncCount = 1;
        Time.timeScale             = 1f;
#endif

        if (useCameraSizeHandler)
        {
            camSizeHandler = new CameraSizeHandler();
            camSizeHandler.SetCameraFieldOfView(Camera.main);
        }
    }