-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcozunurlukAyarla.cs
53 lines (45 loc) · 1.22 KB
/
cozunurlukAyarla.cs
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
45
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cozunurlukAyarla : MonoBehaviour
{
int x;
int y;
// Start is called before the first frame update
void Start()
{
//Ayarla();
}
void Update()
{
/*if (x != Screen.width || y != Screen.height)
{
Ayarla();
}
x = Screen.width;
y = Screen.height;*/
if (Input.GetKeyDown(KeyCode.F11))
{
if (Screen.fullScreenMode == FullScreenMode.FullScreenWindow)
{
Screen.SetResolution(768, 432, FullScreenMode.Windowed);
}
else
{
Ayarla();
}
}
}
void Ayarla()
{
Screen.SetResolution(768, 432, FullScreenMode.FullScreenWindow);
if (Screen.width/16 > Screen.height/9)
{
Screen.SetResolution(Screen.currentResolution.height/9*16, Screen.currentResolution.height, FullScreenMode.FullScreenWindow);
}
else
{
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.width/16*9, FullScreenMode.FullScreenWindow);
}
}
}