Beispiel #1
0
    void Start()
    {
        Init_Json();
#if UNITY_EDITOR
        GameObject gameobject = GameObject.Find("Init");
        debug = gameobject.GetComponent <Debug_Manager>();

        Screen.SetResolution(debug.Width, debug.Height, false, 60);
        Debug.Log("UNITY_EDITOR");
#else
        Screen.SetResolution(settings.Width, settings.Height, settings.FullScreen, settings.FrameRate);
        Debug.Log("UNITY_STANDALONE_WIN");
#endif
    }
Beispiel #2
0
    void Start()
    {
        path     = Application.dataPath + "/" + "Settings.json";
        json     = File.ReadAllText(path);
        settings = JsonUtility.FromJson <Settings>(json);
        JsonUtility.FromJsonOverwrite(json, settings);
        Width  = settings.Width;
        Height = settings.Height;

        BackGround = Image.GetComponent <RectTransform>();

#if UNITY_EDITOR
        GameObject gameobject = GameObject.Find("Init");
        debug = gameobject.GetComponent <Debug_Manager>();

        BackGround.sizeDelta = new Vector2(debug.Width, debug.Height);
        Debug.Log("UNITY_EDITOR");
#else
        BackGround.sizeDelta = new Vector2(Width, Height);
        Debug.Log("UNITY_STANDALONE_WIN");
#endif
    }