You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,6 +27,13 @@ Add the following dependency to the `Packages/manifest.json` file of your Unity
21
27
}
22
28
```
23
29
30
+
#### via OpenUPM
31
+
32
+
This package is available on [OpenUPM](https://openupm.com/packages/com.pflowr.unirate/) registry, you can install it via [openupm-cli](https://github.com/openupm/openupm-cli):
33
+
```
34
+
openupm add com.pflowr.unirate
35
+
```
36
+
24
37
#### via Assets Import Package
25
38
26
39
Import the [.unitypackage](https://github.com/renanwolf/UniRate/releases/latest) from the latest release to your Unity project.
@@ -35,7 +48,7 @@ Just access the `RateManager.Instance` by code and it will be automatically crea
35
48
36
49
#### Setting Up
37
50
38
-
-`UpdateRateMode`: set to `VSyncCount` or `ApplicationTargetFrameRate` to choose how the update rate will be managed.
51
+
-`UpdateRateMode`: set to `VSyncCount` or `ApplicationTargetFrameRate` to choose how the update rate should be managed.
39
52
40
53
-`MinimumUpdateRate`: is the minimum allowed update rate that can be applied. Any request bellow this value will be ignored.
41
54
@@ -95,7 +108,7 @@ Is the number of `FixedUpdate` per second that the game executes.
95
108
96
109
## Render Interval
97
110
98
-
Is the number of `Update` that will take before the game executes a render. A value of 1 means the game will render on every update, a value of 2 on every other update, and so on.
111
+
Is the number of `Update` that takes before the game executes a render. A value of 1 means the game will render on every update, a value of 2 on every other update, and so on.
99
112
100
113
It **only works on Unity 2019.3 or newer**, since its use the new Unity `OnDemandRendering` API. For any previous version the render interval will always be 1, ignoring the requests.
101
114
@@ -107,18 +120,69 @@ There are a few components already created to manage requests in some circumstan
107
120
108
121
#### RateRequestWhileEnabledComponent
109
122
110
-
This component will keep the requests active while it is active and enabled.
123
+
This component keeps the requests active while it is active and enabled.
111
124
112
125
#### RateRequestTouchComponent
113
126
114
-
This component will keep the requests active while `Input.touchCount` is greater then zero or `Input.GetMouseButton(0, 1, 2)` is true.
127
+
This component keeps the requests active while `Input.touchCount` is greater then zero or `Input.GetMouseButton(0, 1, 2)` is true.
115
128
116
129
#### RateRequestScrollRectComponent
117
130
118
-
This component will keep the requests active while the `ScrollRect.velocity` is not zero or when it changes the normalized position.
131
+
This component keeps the requests active while the `ScrollRect.velocity` is not zero or when it changes the normalized position.
If enabled, display on the top-left corner of the screen informations about current rates and intervals.
165
+
166
+
To modify how the on screen data is displayed, change the following properties `ScreenDataVerbose`, `ScreenDataBackgroundColor`, `ScreenDataFontSize` and `ScreenDataFontColor`.
167
+
168
+
#### IsDebugBuild
169
+
170
+
On editor returns `EditorUserBuildSettings.development`, otherwise returns `Debug.isDebugBuild`.
171
+
172
+
#### LogLevel
173
+
174
+
Set to one of the following values to filter which logs should be enabled:
175
+
176
+
-`Trace`: changes to `QualitySettings.vSyncCount`, `Application.targetFrameRate`, `Time.fixedDeltaTime`, `OnDemandRendering.renderFrameInterval` and `RateRequest` creation/cancellation are logged with this level.
177
+
178
+
-`Debug`: changes to `TargetUpdateRate`, `TargetFixedUpdateRate` and `TargetRenderInterval` are logged with this level.
179
+
180
+
-`Info`: changes to `UpdateRateMode`, `MinimumUpdateRate`, `MinimumFixedUpdateRate` and `MaximumRenderInterval` are logged with this level.
181
+
182
+
-`Warning`
183
+
184
+
-`Error`
185
+
186
+
-`Off`
123
187
124
-
To enable the `RateRequestTMPInputFieldComponent` you need to add the `TMPRO` define symbol in your player settings.
188
+
The default value on editor is `Debug` if `IsDebugBuild` is true, otherwise `Info`. In runtime is `Info` if `IsDebugBuild` is true, otherwise `Warning`.
0 commit comments