SwitchResolution.cs
778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine.UI;
public class SwitchResolution : MonoBehaviour {
public static bool showbox = false;
//Mostra e esconde a box de resolucao do player
public void switchResbox(){
showbox = !showbox;
gameObject.SetActive(showbox);
}
public void resChange(int i){
switch(i){
case 1:
Screen.SetResolution(640, 480, false);
Debug.Log ("640");
break;
case 2:
Screen.SetResolution(800, 600, false);
Debug.Log ("800");
break;
case 3:
Screen.SetResolution(1024, 768, false);
Debug.Log ("1024");
break;
default:
Screen.SetResolution(640, 480, false);
Debug.Log ("unknown res");
break;
}
}
}