-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnigmaSettings.cs
More file actions
102 lines (83 loc) · 2.24 KB
/
UnigmaSettings.cs
File metadata and controls
102 lines (83 loc) · 2.24 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public static class UnigmaSettings
{
private static bool RTXEnabled = false; //User choice.
private static bool RayTracingOn = false; //User choice.
public enum QualityPreset
{
High,
Mid,
Low
}
public static QualityPreset QualityPresets;
public static bool SetRaytracing()
{
if (SystemInfo.supportsRayTracing)
{
RTXEnabled = true;
RayTracingOn = true;
return true;
}
RayTracingOn = true;
return false;
}
public static bool GetIsRTXEnabled()
{
if (SystemInfo.supportsRayTracing && RTXEnabled && GetIsRayTracingEnabled())
{
return true;
}
return false;
}
public static bool GetIsRayTracingEnabled()
{
if (SystemInfo.supportsComputeShaders && RayTracingOn)
{
return true;
}
return false;
}
public static string CurrentPreset()
{
Debug.Log("The current string being processed: " + Enum.GetName(typeof(QualityPreset), QualityPresets));
return Enum.GetName(typeof(QualityPreset), QualityPresets);
}
public static void Initialize()
{
DeviceInfo();
ScreenResolution();
FrameRateLock();
}
static void DeviceInfo()
{
}
static void FrameRateLock()
{
//Application.targetFrameRate = 30;
}
static void ScreenResolution()
{
/*
if (EditorApplication.isPlaying)
{
if (Screen.width == 640)
QualityPresets = QualityPreset.Low;
if (Screen.width == 1024)
QualityPresets = QualityPreset.Mid;
if (Screen.width == 2048)
QualityPresets = QualityPreset.High;
}
//If in a build.
if (QualityPresets == QualityPreset.Low)
Screen.SetResolution(640, 640, true);
if (QualityPresets == QualityPreset.Mid)
Screen.SetResolution(1024, 1024, true);
if (QualityPresets == QualityPreset.High)
Screen.SetResolution(2048, 2048, true);
*/
}
}