├── .editorconfig ├── .gitattributes ├── .gitignore ├── AillieoTech.ruleset ├── Assets ├── EasyTimeSlicing.meta ├── EasyTimeSlicing │ ├── Scripts.meta │ └── Scripts │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── AillieoUtils.EasyTimeSlicing.Editor.asmdef │ │ └── AillieoUtils.EasyTimeSlicing.Editor.asmdef.meta │ │ ├── Runtime.meta │ │ └── Runtime │ │ ├── AillieoUtils.EasyTimeSlicing.asmdef │ │ ├── AillieoUtils.EasyTimeSlicing.asmdef.meta │ │ ├── SliceableTask.cs │ │ ├── SliceableTask.cs.meta │ │ ├── SliceableTaskQueue.cs │ │ ├── SliceableTaskQueue.cs.meta │ │ ├── TimeSlicingScheduler.cs │ │ ├── TimeSlicingScheduler.cs.meta │ │ ├── TimeSlicingUtils.cs │ │ └── TimeSlicingUtils.cs.meta ├── Sample.meta ├── Sample │ ├── Scenes.meta │ ├── Scenes │ │ ├── SampleScene.unity │ │ └── SampleScene.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── AillieoUtils.EasyTimeSlicing.Sample.asmdef │ │ ├── AillieoUtils.EasyTimeSlicing.Sample.asmdef.meta │ │ ├── TaskCreateHelper.cs │ │ ├── TaskCreateHelper.cs.meta │ │ ├── TestCaseBasic.cs │ │ ├── TestCaseBasic.cs.meta │ │ ├── TestCaseCancelTask.cs │ │ ├── TestCaseCancelTask.cs.meta │ │ ├── TestCaseInstantiate.cs │ │ ├── TestCaseInstantiate.cs.meta │ │ ├── TestCaseTaskQueue.cs │ │ └── TestCaseTaskQueue.cs.meta ├── package.json └── package.json.meta ├── Directory.Build.props ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset ├── README.md ├── ScreenShots ├── pic_1_1_10.png ├── pic_1_1_3.png ├── pic_1_2_10.png ├── pic_1_2_3.png ├── pic_1_3_10.png ├── pic_1_3_3.png └── pic_2_2.gif └── stylecop.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # see http://editorconfig.org/ for docs on this file 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | end_of_line = lf ; help with sharing files across os's (i.e. network share or through local vm) 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | # trailing whitespace is significant in markdown (bad choice, bad!) 14 | [*.{md,markdown}] 15 | trim_trailing_whitespace = false 16 | 17 | # keep these and the VS stuff below in sync with .hgeol's CRLF extensions 18 | [*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}] 19 | end_of_line = crlf 20 | # this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited. 21 | # the settings are meant to closely match what VS does to minimize unnecessary diffs. this duplicates settings in * 22 | # but let's be explicit here to be safe (in case someone wants to copy-paste this out to another .editorconfig). 23 | [*.{vcxproj,vcxproj.filters,csproj}] 24 | indent_style = space 25 | indent_size = 2 26 | end_of_line = crlf 27 | charset = utf-8-bom 28 | trim_trailing_whitespace = true 29 | insert_final_newline = false 30 | [*.{sln,sln.template}] 31 | indent_style = tab 32 | indent_size = 4 33 | end_of_line = crlf 34 | charset = utf-8 35 | trim_trailing_whitespace = true 36 | insert_final_newline = false 37 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | # Text files 3 | *.cs diff=csharp text 4 | *.txt text 5 | *.mat text 6 | *.shader text 7 | *.meta text 8 | *.md5 text 9 | *.compute text 10 | *.md text 11 | *.prefab text 12 | */ProjectSettings/*.asset text 13 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | /Temp/ 5 | /Library/ 6 | 7 | [Oo]bj/ 8 | [Ll]ogs/ 9 | 10 | # ===================================== # 11 | # Visual Studio / MonoDevelop generated # 12 | # ===================================== # 13 | /*/ExportedObj/ 14 | /*/obj/ 15 | *.svd 16 | *.userprefs 17 | /*.csproj 18 | *.pidb 19 | *.suo 20 | /*.sln 21 | *.user 22 | *.unityproj 23 | *.booproj 24 | .vs/ 25 | 26 | # ============ # 27 | # OS generated # 28 | # ============ # 29 | .DS_Store 30 | .DS_Store? 31 | ._* 32 | .Spotlight-V100 33 | .Trashes 34 | ehthumbs.db 35 | Thumbs.db 36 | 37 | # ===== # 38 | # Rider # 39 | # ===== # 40 | .idea/ -------------------------------------------------------------------------------- /AillieoTech.ruleset: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91b52b2a224211b459dffea9048db8c2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ff3b1fd9d430bb4ea16d480440418c4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6715db0cc1d0808448a5e88d8a3b7f60 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Editor/AillieoUtils.EasyTimeSlicing.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AillieoUtils.EasyTimeSlicing.Editor", 3 | "references": [ 4 | "AillieoUtils.EasyTimeSlicing" 5 | ], 6 | "includePlatforms": [ 7 | "Editor" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Editor/AillieoUtils.EasyTimeSlicing.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebbedf2e6d1b1b940ad296a148a351ab 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a9aa31b772654449b66c3355d5257f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/AillieoUtils.EasyTimeSlicing.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AillieoUtils.EasyTimeSlicing" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/AillieoUtils.EasyTimeSlicing.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bb48bc12aad3654eb75d7d80c62435b 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/SliceableTask.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) AillieoTech. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace AillieoUtils.EasyTimeSlicing 8 | { 9 | using System; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using System.Diagnostics; 13 | using UnityEngine; 14 | 15 | /// 16 | /// Status of a . 17 | /// 18 | public enum TaskStatus 19 | { 20 | /// 21 | /// Status that a is not managed by the scheduler, which means it has been removed or is going to be added. 22 | /// 23 | Detached, 24 | 25 | /// 26 | /// Status that a is in the queue and will be executed when time budget is available. 27 | /// 28 | Queued, 29 | 30 | /// 31 | /// Status that a is being executed at the moment. 32 | /// 33 | Executing, 34 | 35 | /// 36 | /// Status that a has been executed. 37 | /// 38 | Finished, 39 | 40 | /// 41 | /// Status that a is going to be removed from the queue. 42 | /// 43 | PendingRemove, 44 | } 45 | 46 | /// 47 | /// A contains one or more tasks. 48 | /// Once started, a certain amount of tasks will be executed each frame, 49 | /// and try not to exceed the specified time budget . 50 | /// 51 | public sealed class SliceableTask 52 | { 53 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 54 | internal StackTrace creatingStackTrace; 55 | #endif 56 | 57 | private readonly ClosedStateMachineFunc func; 58 | 59 | private float timeBudgetPerFrameValue; 60 | 61 | private SliceableTask(float timeBudgetPerFrame, ClosedStateMachineFunc funcToExecute, int skipFrames) 62 | { 63 | if (timeBudgetPerFrame < 0) 64 | { 65 | throw new ArgumentException($"{nameof(timeBudgetPerFrame)} less than 0"); 66 | } 67 | 68 | if (Application.targetFrameRate > 0 && timeBudgetPerFrame >= TimeSlicingUtils.frameInterval) 69 | { 70 | UnityEngine.Debug.LogWarning($"{nameof(timeBudgetPerFrame)} is {timeBudgetPerFrame} while expected time for frame {TimeSlicingUtils.frameInterval}"); 71 | } 72 | 73 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 74 | this.creatingStackTrace = new StackTrace(skipFrames, true); 75 | #endif 76 | 77 | this.timeBudgetPerFrame = timeBudgetPerFrame; 78 | this.func = funcToExecute; 79 | TimeSlicingScheduler.Instance.Add(this); 80 | } 81 | 82 | /// 83 | /// An can stand for a series of tasks and modify the state each time it is called, and it should return true when all tasks are finished. 84 | /// The function should be stateless, and the state should be manually maintained somewhere else. 85 | /// 86 | /// The state for this function. 87 | /// All the tasks are finished. 88 | public delegate bool OpenStateMachineFunc(ref int state); 89 | 90 | /// 91 | /// A can stand for a series of tasks and is repeatedly called to execute them, and return true when all tasks are finished. 92 | /// The function should manage its state inside. 93 | /// 94 | /// All the tasks are finished. 95 | public delegate bool ClosedStateMachineFunc(); 96 | 97 | /// 98 | /// An can stand for a series of tasks and is managed by an . 99 | /// 100 | /// A to iterate over all tasks. 101 | public delegate IEnumerator EnumFunc(); 102 | 103 | /// 104 | /// Gets a value indicating current status of the . 105 | /// 106 | public TaskStatus status { get; internal set; } = TaskStatus.Detached; 107 | 108 | /// 109 | /// Gets or sets the value indicating the time budget per frame for task execution. 110 | /// 111 | public float timeBudgetPerFrame 112 | { 113 | get => this.timeBudgetPerFrameValue; 114 | 115 | set 116 | { 117 | if (Application.targetFrameRate > 0 && value >= TimeSlicingUtils.frameInterval) 118 | { 119 | UnityEngine.Debug.LogWarning($"{nameof(this.timeBudgetPerFrame)} is {value} while expected time for frame {TimeSlicingUtils.frameInterval}"); 120 | } 121 | 122 | this.timeBudgetPerFrameValue = value; 123 | } 124 | } 125 | 126 | /// 127 | /// Start a with an . 128 | /// 129 | /// The value for . 130 | /// The initial state of the . 131 | /// The state machine function contains tasks. 132 | /// The instance create. 133 | public static SliceableTask Start(float timeBudgetPerFrame, int initialState, OpenStateMachineFunc func) 134 | { 135 | if (func == null) 136 | { 137 | throw new ArgumentNullException(nameof(func)); 138 | } 139 | 140 | var state = initialState; 141 | 142 | bool funcToExecute() 143 | { 144 | return func(ref state); 145 | } 146 | 147 | return new SliceableTask(timeBudgetPerFrame, funcToExecute, 2); 148 | } 149 | 150 | /// 151 | /// Start a with a . 152 | /// 153 | /// The value for . 154 | /// The state machine function contains tasks. 155 | /// The instance create. 156 | public static SliceableTask Start(float timeBudgetPerFrame, ClosedStateMachineFunc func) 157 | { 158 | if (func == null) 159 | { 160 | throw new ArgumentNullException(nameof(func)); 161 | } 162 | 163 | return new SliceableTask(timeBudgetPerFrame, func, 2); 164 | } 165 | 166 | /// 167 | /// Start a with a series of s. 168 | /// 169 | /// The value for . 170 | /// The actions to execute. 171 | /// The instance create. 172 | public static SliceableTask Start(float timeBudgetPerFrame, IEnumerable actions) 173 | { 174 | IEnumerator e = actions.GetEnumerator(); 175 | 176 | bool funcToExecute() 177 | { 178 | while (e.MoveNext()) 179 | { 180 | e.Current?.Invoke(); 181 | return false; 182 | } 183 | 184 | return true; 185 | } 186 | 187 | return new SliceableTask(timeBudgetPerFrame, funcToExecute, 2); 188 | } 189 | 190 | /// 191 | /// Start a with a series of s. 192 | /// 193 | /// The value for . 194 | /// The actions to execute. 195 | /// The instance create. 196 | public static SliceableTask Start(float timeBudgetPerFrame, params Action[] actions) 197 | { 198 | if (actions == null) 199 | { 200 | throw new ArgumentNullException(nameof(actions)); 201 | } 202 | 203 | var actionCount = actions.Length; 204 | 205 | if (actionCount == 0) 206 | { 207 | throw new ArgumentException("no actions provided", nameof(actions)); 208 | } 209 | 210 | var index = 0; 211 | 212 | bool funcToExecute() 213 | { 214 | if (index < actionCount) 215 | { 216 | actions[index]?.Invoke(); 217 | if (index == actionCount - 1) 218 | { 219 | return true; 220 | } 221 | else 222 | { 223 | index++; 224 | return false; 225 | } 226 | } 227 | 228 | throw new IndexOutOfRangeException($"i = {index} while action count = {actionCount}"); 229 | } 230 | 231 | return new SliceableTask(timeBudgetPerFrame, funcToExecute, 2); 232 | } 233 | 234 | /// 235 | /// Start a with an . 236 | /// 237 | /// The value for . 238 | /// The function that manages a series of tasks. 239 | /// The instance create. 240 | public static SliceableTask Start(float timeBudgetPerFrame, EnumFunc func) 241 | { 242 | if (func == null) 243 | { 244 | throw new ArgumentNullException(nameof(func)); 245 | } 246 | 247 | IEnumerator e = func(); 248 | bool funcToExecute() 249 | { 250 | if (e.MoveNext()) 251 | { 252 | return false; 253 | } 254 | 255 | return true; 256 | } 257 | 258 | return new SliceableTask(timeBudgetPerFrame, funcToExecute, 2); 259 | } 260 | 261 | /// 262 | /// Cancel a instance. 263 | /// 264 | public void Cancel() 265 | { 266 | if (this.status == TaskStatus.Executing || this.status == TaskStatus.Queued) 267 | { 268 | TimeSlicingScheduler.Instance.Remove(this); 269 | } 270 | } 271 | 272 | internal bool Execute() 273 | { 274 | return this.func(); 275 | } 276 | } 277 | } 278 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/SliceableTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f3e2a2446d4bfd4abb113bb4809608d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/SliceableTaskQueue.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) AillieoTech. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace AillieoUtils.EasyTimeSlicing 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | 12 | /// 13 | /// Represents a queue of tasks that can be scheduled and executed in slices. 14 | /// 15 | public class SliceableTaskQueue 16 | { 17 | private readonly SliceableTask sliceableTask; 18 | 19 | private Queue queueLow; 20 | private Queue queueMedium; 21 | private Queue queueHigh; 22 | 23 | private SliceableTaskQueue(float timeBudgetPerFrame) 24 | { 25 | this.sliceableTask = SliceableTask.Start(timeBudgetPerFrame, this.ProcessTask); 26 | } 27 | 28 | /// 29 | /// Represents the priority levels for enqueuing tasks. 30 | /// 31 | public enum Priority 32 | { 33 | /// 34 | /// Low priority level. 35 | /// 36 | Low, 37 | 38 | /// 39 | /// Medium priority level. 40 | /// 41 | Medium, 42 | 43 | /// 44 | /// High priority level. 45 | /// 46 | High, 47 | } 48 | 49 | /// 50 | /// Gets or sets the value indicating the time budget per frame for task execution. 51 | /// 52 | public float timeBudgetPerFrame 53 | { 54 | get => this.sliceableTask.timeBudgetPerFrame; 55 | set => this.sliceableTask.timeBudgetPerFrame = value; 56 | } 57 | 58 | /// 59 | /// Gets a value indicating whether the task queue is currently scheduling and executing tasks. 60 | /// 61 | public bool scheduling { get => this.sliceableTask.status == TaskStatus.Executing || this.sliceableTask.status == TaskStatus.Queued; } 62 | 63 | /// 64 | /// Gets the number of pending tasks in the task queue. 65 | /// 66 | public int pendingTasks { get => this.GetPendingTasks(Priority.High) + this.GetPendingTasks(Priority.Medium) + this.GetPendingTasks(Priority.Low); } 67 | 68 | /// 69 | /// Creates a new instance of the class with the specified time budget per frame.. 70 | /// 71 | /// The time budget per frame for task execution. 72 | /// A new instance of the class. 73 | public static SliceableTaskQueue Create(float timeBudgetPerFrame) 74 | { 75 | return new SliceableTaskQueue(timeBudgetPerFrame); 76 | } 77 | 78 | /// 79 | /// Enqueues a task with the specified priority. 80 | /// 81 | /// The task to enqueue. 82 | /// The priority of the task. The default is . 83 | public void Enqueue(Action action, Priority priority = Priority.Medium) 84 | { 85 | Queue queue = this.GetQueue(priority, true); 86 | queue.Enqueue(action); 87 | if (!this.scheduling) 88 | { 89 | this.sliceableTask.status = TaskStatus.Detached; 90 | this.Resume(); 91 | } 92 | } 93 | 94 | /// 95 | /// Enqueues a task with the specified priority and returns a handle for the task. 96 | /// 97 | /// The task to enqueue. 98 | /// The priority of the task. The default is . 99 | /// A handle for the enqueued task. 100 | public Handle EnqueueWithHandle(Action action, Priority priority = Priority.Medium) 101 | { 102 | var handle = new Handle(); 103 | void wrapped() 104 | { 105 | if (handle.status == TaskStatus.Queued) 106 | { 107 | try 108 | { 109 | action(); 110 | } 111 | finally 112 | { 113 | handle.status = TaskStatus.Finished; 114 | } 115 | } 116 | } 117 | 118 | this.Enqueue(wrapped, priority); 119 | return handle; 120 | } 121 | 122 | /// 123 | /// Pauses the task queue, suspending task scheduling and execution. 124 | /// 125 | public void Pause() 126 | { 127 | if (this.scheduling) 128 | { 129 | TimeSlicingScheduler.Instance.Remove(this.sliceableTask); 130 | } 131 | } 132 | 133 | /// 134 | /// Resumes the task queue, allowing task scheduling and execution. 135 | /// 136 | public void Resume() 137 | { 138 | if (!this.scheduling) 139 | { 140 | TimeSlicingScheduler.Instance.Add(this.sliceableTask); 141 | } 142 | } 143 | 144 | /// 145 | /// Clears all the tasks in the task queue. 146 | /// 147 | public void ClearAll() 148 | { 149 | if (this.queueLow != null) 150 | { 151 | this.queueLow.Clear(); 152 | } 153 | 154 | if (this.queueMedium != null) 155 | { 156 | this.queueMedium.Clear(); 157 | } 158 | 159 | if (this.queueHigh != null) 160 | { 161 | this.queueHigh.Clear(); 162 | } 163 | } 164 | 165 | /// 166 | /// Gets the number of pending tasks with the specifiedpriority in the task queue. 167 | /// 168 | /// The priority level. 169 | /// The number of pending tasks with the specified priority. 170 | public int GetPendingTasks(Priority priority) 171 | { 172 | var queue = this.GetQueue(priority, false); 173 | if (queue == null) 174 | { 175 | return 0; 176 | } 177 | 178 | return queue.Count; 179 | } 180 | 181 | private Queue GetQueue(Priority priority, bool createIfNotExist) 182 | { 183 | switch (priority) 184 | { 185 | case Priority.Low: 186 | if (this.queueLow == null && createIfNotExist) 187 | { 188 | this.queueLow = new Queue(); 189 | } 190 | 191 | return this.queueLow; 192 | case Priority.Medium: 193 | if (this.queueMedium == null && createIfNotExist) 194 | { 195 | this.queueMedium = new Queue(); 196 | } 197 | 198 | return this.queueMedium; 199 | case Priority.High: 200 | if (this.queueHigh == null && createIfNotExist) 201 | { 202 | this.queueHigh = new Queue(); 203 | } 204 | 205 | return this.queueHigh; 206 | } 207 | 208 | throw new IndexOutOfRangeException(nameof(priority)); 209 | } 210 | 211 | private bool ProcessTask() 212 | { 213 | if (this.queueHigh != null && this.queueHigh.Count > 0) 214 | { 215 | try 216 | { 217 | this.queueHigh.Dequeue()?.Invoke(); 218 | } 219 | catch (Exception e) 220 | { 221 | UnityEngine.Debug.LogException(e); 222 | } 223 | 224 | if (this.queueHigh.Count > 0) 225 | { 226 | return false; 227 | } 228 | } 229 | 230 | if (this.queueMedium != null && this.queueMedium.Count > 0) 231 | { 232 | try 233 | { 234 | this.queueMedium.Dequeue()?.Invoke(); 235 | } 236 | catch (Exception e) 237 | { 238 | UnityEngine.Debug.LogException(e); 239 | } 240 | 241 | if (this.queueMedium.Count > 0) 242 | { 243 | return false; 244 | } 245 | } 246 | 247 | if (this.queueLow != null && this.queueLow.Count > 0) 248 | { 249 | try 250 | { 251 | this.queueLow.Dequeue()?.Invoke(); 252 | } 253 | catch (Exception e) 254 | { 255 | UnityEngine.Debug.LogException(e); 256 | } 257 | 258 | if (this.queueLow.Count > 0) 259 | { 260 | return false; 261 | } 262 | } 263 | 264 | return true; 265 | } 266 | 267 | /// 268 | /// Represents a handle for a task in the task queue. 269 | /// 270 | public class Handle 271 | { 272 | /// 273 | /// Gets the status of the task. 274 | /// 275 | public TaskStatus status { get; internal set; } = TaskStatus.Queued; 276 | 277 | /// 278 | /// Cancels the task, detaching it from the task queue. 279 | /// 280 | public void Cancel() 281 | { 282 | if (this.status == TaskStatus.Queued) 283 | { 284 | this.status = TaskStatus.Detached; 285 | } 286 | } 287 | } 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/SliceableTaskQueue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b94bb7f748d4d8e40befbb7d1dec8050 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/TimeSlicingScheduler.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) AillieoTech. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace AillieoUtils.EasyTimeSlicing 8 | { 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Linq; 12 | using UnityEngine; 13 | using UnityEngine.Assertions; 14 | 15 | [DefaultExecutionOrder(-100)] 16 | internal class TimeSlicingScheduler : MonoBehaviour 17 | { 18 | private static TimeSlicingScheduler instance; 19 | 20 | private readonly List managedTasks = new List(); 21 | 22 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 23 | // 检查是否有重复的 24 | private readonly HashSet validationSet = new HashSet(); 25 | #endif 26 | 27 | internal static TimeSlicingScheduler Instance 28 | { 29 | get 30 | { 31 | CreateInstance(); 32 | return instance; 33 | } 34 | } 35 | 36 | internal void Add(SliceableTask task) 37 | { 38 | if (task == null) 39 | { 40 | throw new ArgumentNullException(nameof(task)); 41 | } 42 | 43 | if (task.status == TaskStatus.PendingRemove) 44 | { 45 | task.status = TaskStatus.Queued; 46 | } 47 | else if (task.status == TaskStatus.Detached) 48 | { 49 | this.managedTasks.Add(task); 50 | task.status = TaskStatus.Queued; 51 | } 52 | else 53 | { 54 | throw new InvalidOperationException($"Unexpected state {task.status}"); 55 | } 56 | } 57 | 58 | internal void Remove(SliceableTask task) 59 | { 60 | if (task.status == TaskStatus.Executing || task.status == TaskStatus.Queued) 61 | { 62 | task.status = TaskStatus.PendingRemove; 63 | } 64 | } 65 | 66 | // [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] 67 | private static void CreateInstance() 68 | { 69 | if (instance == null) 70 | { 71 | var go = new GameObject($"[{nameof(TimeSlicingScheduler)}]"); 72 | instance = go.AddComponent(); 73 | DontDestroyOnLoad(go); 74 | } 75 | } 76 | 77 | private void Awake() 78 | { 79 | if (instance != null && instance != this) 80 | { 81 | Destroy(this); 82 | } 83 | } 84 | 85 | private void Update() 86 | { 87 | var taskToRemove = 0; 88 | var taskCount = this.managedTasks.Count; 89 | for (var i = 0; i < taskCount; ++i) 90 | { 91 | SliceableTask task = this.managedTasks[i]; 92 | if (task == null) 93 | { 94 | taskToRemove++; 95 | continue; 96 | } 97 | 98 | if (task.status == TaskStatus.PendingRemove) 99 | { 100 | task.status = TaskStatus.Detached; 101 | this.managedTasks[i] = null; 102 | taskToRemove++; 103 | continue; 104 | } 105 | 106 | Assert.AreEqual(task.status, TaskStatus.Queued); 107 | 108 | var beginTime = Time.realtimeSinceStartup; 109 | var executionTime = task.timeBudgetPerFrame; 110 | while (true) 111 | { 112 | var finished = false; 113 | task.status = TaskStatus.Executing; 114 | try 115 | { 116 | finished = task.Execute(); 117 | } 118 | catch (Exception e) 119 | { 120 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 121 | Debug.LogError($"{e}\n......Registered: \n{task.creatingStackTrace}"); 122 | #else 123 | UnityEngine.Debug.LogException(e); 124 | #endif 125 | } 126 | 127 | if (task.status == TaskStatus.PendingRemove) 128 | { 129 | task.status = TaskStatus.Detached; 130 | this.managedTasks[i] = null; 131 | taskToRemove++; 132 | break; 133 | } 134 | 135 | Assert.AreEqual(task.status, TaskStatus.Executing); 136 | task.status = TaskStatus.Queued; 137 | 138 | if (finished) 139 | { 140 | task.status = TaskStatus.Finished; 141 | this.managedTasks[i] = null; 142 | taskToRemove++; 143 | break; 144 | } 145 | else if (Time.realtimeSinceStartup - beginTime >= executionTime) 146 | { 147 | break; 148 | } 149 | } 150 | } 151 | 152 | if (taskToRemove > 8 || taskToRemove >= (taskCount >> 2)) 153 | { 154 | this.managedTasks.RemoveAll(o => o == null); 155 | } 156 | 157 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 158 | // 检查是否有重复的 159 | this.validationSet.Clear(); 160 | this.validationSet.UnionWith(this.managedTasks); 161 | Assert.AreEqual(this.managedTasks.Count(o => o != null), this.validationSet.Count(o => o != null)); 162 | #endif 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/TimeSlicingScheduler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2719d6af9ce272540b3a3c95e9755a84 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/TimeSlicingUtils.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // 3 | // Copyright (c) AillieoTech. All rights reserved. 4 | // 5 | // ----------------------------------------------------------------------- 6 | 7 | namespace AillieoUtils.EasyTimeSlicing 8 | { 9 | using System; 10 | using UnityEngine; 11 | using UnityEngine.Assertions; 12 | 13 | /// 14 | /// Provides utility methods for time-sliced execution of tasks. 15 | /// 16 | public static class TimeSlicingUtils 17 | { 18 | private static int cachedFrameRate = int.MinValue; 19 | private static float cachedFrameInterval; 20 | 21 | /// 22 | /// Gets the time interval between frames based on . 23 | /// 24 | public static float frameInterval 25 | { 26 | get 27 | { 28 | if (Application.targetFrameRate != cachedFrameRate) 29 | { 30 | cachedFrameRate = Application.targetFrameRate; 31 | cachedFrameInterval = 1.0f / cachedFrameRate; 32 | } 33 | 34 | return cachedFrameInterval; 35 | } 36 | } 37 | 38 | /// 39 | /// Gets time elapsed since the start of the current frame. 40 | /// 41 | public static float timeSinceFrameStart 42 | { 43 | get { return Time.realtimeSinceStartup - Time.unscaledTime; } 44 | } 45 | 46 | /// 47 | /// Gets the estimated remaining time available in the current frame for executing a task. 48 | /// 49 | public static float timeBudgetEstimated 50 | { 51 | get 52 | { 53 | return frameInterval - timeSinceFrameStart; 54 | } 55 | } 56 | 57 | /// 58 | /// Try to execute an within the given expected execution time. 59 | /// 60 | /// The to execute. 61 | /// The expected execution time in seconds. 62 | /// Whether the execution was executed. 63 | public static bool TryExecute(Action action, float expectedExecutionTime) 64 | { 65 | Assert.IsNotNull(action); 66 | 67 | if (CheckExecuteTime(expectedExecutionTime)) 68 | { 69 | action.Invoke(); 70 | return true; 71 | } 72 | 73 | return false; 74 | } 75 | 76 | /// 77 | /// Try to execute an within the given expected execution time. 78 | /// 79 | /// The type of data to pass to the . 80 | /// The to execute. 81 | /// The data to pass to the . 82 | /// The expected execution time in seconds. 83 | /// Whether the execution was executed. 84 | public static bool TryExecute(Action action, T data, float expectedExecutionTime) 85 | { 86 | Assert.IsNotNull(action); 87 | 88 | if (CheckExecuteTime(expectedExecutionTime)) 89 | { 90 | action.Invoke(data); 91 | return true; 92 | } 93 | 94 | return false; 95 | } 96 | 97 | /// 98 | /// Try to execute a within the given expected execution time. 99 | /// 100 | /// The return type of the . 101 | /// The to execute. 102 | /// The expected execution time in seconds. 103 | /// The result of the . 104 | /// Whether the execution was executed. 105 | public static bool TryExecute(Func func, float expectedExecutionTime, out TResult result) 106 | { 107 | Assert.IsNotNull(func); 108 | 109 | if (CheckExecuteTime(expectedExecutionTime)) 110 | { 111 | result = func.Invoke(); 112 | return true; 113 | } 114 | 115 | result = default; 116 | return false; 117 | } 118 | 119 | /// 120 | /// Try to execute a within the given expected execution time. 121 | /// 122 | /// The type of data to pass to the . 123 | /// The return type of the . 124 | /// The to execute. 125 | /// The data to pass to the . 126 | /// The expected execution time in seconds. 127 | /// The result of the . 128 | /// Whether the execution was executed. 129 | public static bool TryExecute(Func func, T data, float expectedExecutionTime, out TResult result) 130 | { 131 | Assert.IsNotNull(func); 132 | 133 | if (CheckExecuteTime(expectedExecutionTime)) 134 | { 135 | result = func.Invoke(data); 136 | return true; 137 | } 138 | 139 | result = default; 140 | return false; 141 | } 142 | 143 | private static bool CheckExecuteTime(float expectedExecutionTime) 144 | { 145 | if (expectedExecutionTime < 0) 146 | { 147 | throw new ArgumentException("Value should greater than 0", nameof(expectedExecutionTime)); 148 | } 149 | 150 | if (expectedExecutionTime >= frameInterval) 151 | { 152 | var message = $"Too much time requested, the task will never execute: expectedExecutionTime={expectedExecutionTime} while frameInterval={frameInterval}."; 153 | #if DEVELOPMENT_BUILD || UNITY_EDITOR 154 | UnityEngine.Debug.LogError(message); 155 | #else 156 | UnityEngine.Debug.LogWarning(message); 157 | #endif 158 | } 159 | 160 | if (expectedExecutionTime > timeBudgetEstimated) 161 | { 162 | return false; 163 | } 164 | 165 | return true; 166 | } 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /Assets/EasyTimeSlicing/Scripts/Runtime/TimeSlicingUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e355e3e1c77334d46a294fbc0f8f873b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sample.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c581178e2a5c7b94fbf56ea5a1272ace 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sample/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0735c62d9f59e8e48a23bb4d383d1f60 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sample/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_UseShadowmask: 1 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &519420028 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 519420032} 133 | - component: {fileID: 519420031} 134 | - component: {fileID: 519420029} 135 | m_Layer: 0 136 | m_Name: Main Camera 137 | m_TagString: MainCamera 138 | m_Icon: {fileID: 0} 139 | m_NavMeshLayer: 0 140 | m_StaticEditorFlags: 0 141 | m_IsActive: 1 142 | --- !u!81 &519420029 143 | AudioListener: 144 | m_ObjectHideFlags: 0 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 519420028} 149 | m_Enabled: 1 150 | --- !u!20 &519420031 151 | Camera: 152 | m_ObjectHideFlags: 0 153 | m_CorrespondingSourceObject: {fileID: 0} 154 | m_PrefabInstance: {fileID: 0} 155 | m_PrefabAsset: {fileID: 0} 156 | m_GameObject: {fileID: 519420028} 157 | m_Enabled: 1 158 | serializedVersion: 2 159 | m_ClearFlags: 2 160 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 161 | m_projectionMatrixMode: 1 162 | m_GateFitMode: 2 163 | m_FOVAxisMode: 0 164 | m_SensorSize: {x: 36, y: 24} 165 | m_LensShift: {x: 0, y: 0} 166 | m_FocalLength: 50 167 | m_NormalizedViewPortRect: 168 | serializedVersion: 2 169 | x: 0 170 | y: 0 171 | width: 1 172 | height: 1 173 | near clip plane: 0.3 174 | far clip plane: 1000 175 | field of view: 60 176 | orthographic: 1 177 | orthographic size: 5 178 | m_Depth: -1 179 | m_CullingMask: 180 | serializedVersion: 2 181 | m_Bits: 4294967295 182 | m_RenderingPath: -1 183 | m_TargetTexture: {fileID: 0} 184 | m_TargetDisplay: 0 185 | m_TargetEye: 0 186 | m_HDR: 1 187 | m_AllowMSAA: 0 188 | m_AllowDynamicResolution: 0 189 | m_ForceIntoRT: 0 190 | m_OcclusionCulling: 0 191 | m_StereoConvergence: 10 192 | m_StereoSeparation: 0.022 193 | --- !u!4 &519420032 194 | Transform: 195 | m_ObjectHideFlags: 0 196 | m_CorrespondingSourceObject: {fileID: 0} 197 | m_PrefabInstance: {fileID: 0} 198 | m_PrefabAsset: {fileID: 0} 199 | m_GameObject: {fileID: 519420028} 200 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 201 | m_LocalPosition: {x: 0, y: 0, z: -10} 202 | m_LocalScale: {x: 1, y: 1, z: 1} 203 | m_Children: [] 204 | m_Father: {fileID: 0} 205 | m_RootOrder: 0 206 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 207 | --- !u!1 &649765777 208 | GameObject: 209 | m_ObjectHideFlags: 0 210 | m_CorrespondingSourceObject: {fileID: 0} 211 | m_PrefabInstance: {fileID: 0} 212 | m_PrefabAsset: {fileID: 0} 213 | serializedVersion: 6 214 | m_Component: 215 | - component: {fileID: 649765779} 216 | - component: {fileID: 649765778} 217 | m_Layer: 0 218 | m_Name: TestCaseBasic 219 | m_TagString: Untagged 220 | m_Icon: {fileID: 0} 221 | m_NavMeshLayer: 0 222 | m_StaticEditorFlags: 0 223 | m_IsActive: 1 224 | --- !u!114 &649765778 225 | MonoBehaviour: 226 | m_ObjectHideFlags: 0 227 | m_CorrespondingSourceObject: {fileID: 0} 228 | m_PrefabInstance: {fileID: 0} 229 | m_PrefabAsset: {fileID: 0} 230 | m_GameObject: {fileID: 649765777} 231 | m_Enabled: 1 232 | m_EditorHideFlags: 0 233 | m_Script: {fileID: 11500000, guid: 5d26b4f2cc90d094ea184e87a7f76d5a, type: 3} 234 | m_Name: 235 | m_EditorClassIdentifier: 236 | --- !u!4 &649765779 237 | Transform: 238 | m_ObjectHideFlags: 0 239 | m_CorrespondingSourceObject: {fileID: 0} 240 | m_PrefabInstance: {fileID: 0} 241 | m_PrefabAsset: {fileID: 0} 242 | m_GameObject: {fileID: 649765777} 243 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 244 | m_LocalPosition: {x: 0, y: 0, z: 0} 245 | m_LocalScale: {x: 1, y: 1, z: 1} 246 | m_Children: [] 247 | m_Father: {fileID: 0} 248 | m_RootOrder: 1 249 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 250 | --- !u!1 &924647650 251 | GameObject: 252 | m_ObjectHideFlags: 0 253 | m_CorrespondingSourceObject: {fileID: 0} 254 | m_PrefabInstance: {fileID: 0} 255 | m_PrefabAsset: {fileID: 0} 256 | serializedVersion: 6 257 | m_Component: 258 | - component: {fileID: 924647652} 259 | - component: {fileID: 924647651} 260 | m_Layer: 0 261 | m_Name: TestCaseTaskQueue 262 | m_TagString: Untagged 263 | m_Icon: {fileID: 0} 264 | m_NavMeshLayer: 0 265 | m_StaticEditorFlags: 0 266 | m_IsActive: 1 267 | --- !u!114 &924647651 268 | MonoBehaviour: 269 | m_ObjectHideFlags: 0 270 | m_CorrespondingSourceObject: {fileID: 0} 271 | m_PrefabInstance: {fileID: 0} 272 | m_PrefabAsset: {fileID: 0} 273 | m_GameObject: {fileID: 924647650} 274 | m_Enabled: 1 275 | m_EditorHideFlags: 0 276 | m_Script: {fileID: 11500000, guid: c01c9a0dd0a8c0844bd0021c7fc15d53, type: 3} 277 | m_Name: 278 | m_EditorClassIdentifier: 279 | --- !u!4 &924647652 280 | Transform: 281 | m_ObjectHideFlags: 0 282 | m_CorrespondingSourceObject: {fileID: 0} 283 | m_PrefabInstance: {fileID: 0} 284 | m_PrefabAsset: {fileID: 0} 285 | m_GameObject: {fileID: 924647650} 286 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 287 | m_LocalPosition: {x: 0, y: 0, z: 0} 288 | m_LocalScale: {x: 1, y: 1, z: 1} 289 | m_Children: [] 290 | m_Father: {fileID: 0} 291 | m_RootOrder: 4 292 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 293 | --- !u!1 &1324126230 294 | GameObject: 295 | m_ObjectHideFlags: 0 296 | m_CorrespondingSourceObject: {fileID: 0} 297 | m_PrefabInstance: {fileID: 0} 298 | m_PrefabAsset: {fileID: 0} 299 | serializedVersion: 6 300 | m_Component: 301 | - component: {fileID: 1324126232} 302 | - component: {fileID: 1324126231} 303 | m_Layer: 0 304 | m_Name: TestCaseCancelTask 305 | m_TagString: Untagged 306 | m_Icon: {fileID: 0} 307 | m_NavMeshLayer: 0 308 | m_StaticEditorFlags: 0 309 | m_IsActive: 1 310 | --- !u!114 &1324126231 311 | MonoBehaviour: 312 | m_ObjectHideFlags: 0 313 | m_CorrespondingSourceObject: {fileID: 0} 314 | m_PrefabInstance: {fileID: 0} 315 | m_PrefabAsset: {fileID: 0} 316 | m_GameObject: {fileID: 1324126230} 317 | m_Enabled: 1 318 | m_EditorHideFlags: 0 319 | m_Script: {fileID: 11500000, guid: 0b08a540cf529c94eb2ca239f1302475, type: 3} 320 | m_Name: 321 | m_EditorClassIdentifier: 322 | --- !u!4 &1324126232 323 | Transform: 324 | m_ObjectHideFlags: 0 325 | m_CorrespondingSourceObject: {fileID: 0} 326 | m_PrefabInstance: {fileID: 0} 327 | m_PrefabAsset: {fileID: 0} 328 | m_GameObject: {fileID: 1324126230} 329 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 330 | m_LocalPosition: {x: 0, y: 0, z: 0} 331 | m_LocalScale: {x: 1, y: 1, z: 1} 332 | m_Children: [] 333 | m_Father: {fileID: 0} 334 | m_RootOrder: 2 335 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 336 | --- !u!1 &1992083350 337 | GameObject: 338 | m_ObjectHideFlags: 0 339 | m_CorrespondingSourceObject: {fileID: 0} 340 | m_PrefabInstance: {fileID: 0} 341 | m_PrefabAsset: {fileID: 0} 342 | serializedVersion: 6 343 | m_Component: 344 | - component: {fileID: 1992083352} 345 | - component: {fileID: 1992083351} 346 | m_Layer: 0 347 | m_Name: TestCaseInstantiate 348 | m_TagString: Untagged 349 | m_Icon: {fileID: 0} 350 | m_NavMeshLayer: 0 351 | m_StaticEditorFlags: 0 352 | m_IsActive: 1 353 | --- !u!114 &1992083351 354 | MonoBehaviour: 355 | m_ObjectHideFlags: 0 356 | m_CorrespondingSourceObject: {fileID: 0} 357 | m_PrefabInstance: {fileID: 0} 358 | m_PrefabAsset: {fileID: 0} 359 | m_GameObject: {fileID: 1992083350} 360 | m_Enabled: 1 361 | m_EditorHideFlags: 0 362 | m_Script: {fileID: 11500000, guid: 0eb0c924f0e73034296f94b0ea29bc11, type: 3} 363 | m_Name: 364 | m_EditorClassIdentifier: 365 | prefab: {fileID: 0} 366 | range: 8 367 | offset: {x: 3, y: 3} 368 | executionTime: 0.001 369 | --- !u!4 &1992083352 370 | Transform: 371 | m_ObjectHideFlags: 0 372 | m_CorrespondingSourceObject: {fileID: 0} 373 | m_PrefabInstance: {fileID: 0} 374 | m_PrefabAsset: {fileID: 0} 375 | m_GameObject: {fileID: 1992083350} 376 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 377 | m_LocalPosition: {x: 0, y: 0, z: 0} 378 | m_LocalScale: {x: 1, y: 1, z: 1} 379 | m_Children: [] 380 | m_Father: {fileID: 0} 381 | m_RootOrder: 3 382 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 383 | -------------------------------------------------------------------------------- /Assets/Sample/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b2c8fd08a474094bb34f5ff75ab0b18 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccd3c87dcb72def49aec68163f5504b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/AillieoUtils.EasyTimeSlicing.Sample.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AillieoUtils.EasyTimeSlicing.Sample", 3 | "rootNamespace": "", 4 | "references": [ 5 | "AillieoUtils.EasyTimeSlicing" 6 | ], 7 | "includePlatforms": [], 8 | "excludePlatforms": [], 9 | "allowUnsafeCode": false, 10 | "overrideReferences": false, 11 | "precompiledReferences": [], 12 | "autoReferenced": true, 13 | "defineConstraints": [], 14 | "versionDefines": [], 15 | "noEngineReferences": false 16 | } -------------------------------------------------------------------------------- /Assets/Sample/Scripts/AillieoUtils.EasyTimeSlicing.Sample.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94b6bb9efb80218478907dd8e4326a55 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TaskCreateHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using UnityEngine; 6 | using Action = System.Action; 7 | 8 | namespace AillieoUtils.EasyTimeSlicing.Sample 9 | { 10 | public static class TaskCreateHelper 11 | { 12 | public static Action CreateRandomTask(int index) 13 | { 14 | return () => ExecuteRandomTask(index); 15 | } 16 | 17 | public static void ExecuteRandomTask(int index) 18 | { 19 | float begin = Time.realtimeSinceStartup; 20 | Task.Delay(Random.Range(1, 6)).Wait(); 21 | float end = Time.realtimeSinceStartup; 22 | UnityEngine.Debug.Log($"In frame {Time.frameCount}: task {index} cost time {end - begin} s"); 23 | } 24 | 25 | public static Action CreateRandomTask(string info) 26 | { 27 | return () => ExecuteRandomTask(info); 28 | } 29 | 30 | public static void ExecuteRandomTask(string info) 31 | { 32 | float begin = Time.realtimeSinceStartup; 33 | Task.Delay(Random.Range(1, 6)).Wait(); 34 | float end = Time.realtimeSinceStartup; 35 | UnityEngine.Debug.Log($"In frame {Time.frameCount}: task {info} cost time {end - begin} s"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TaskCreateHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ccd76bf25955fd46a64a7f2d97abb90 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseBasic.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using static AillieoUtils.EasyTimeSlicing.SliceableTask; 6 | 7 | namespace AillieoUtils.EasyTimeSlicing.Sample 8 | { 9 | public class TestCaseBasic : MonoBehaviour 10 | { 11 | private void Start() 12 | { 13 | TestActionArray(); 14 | TestActionEnumerable(); 15 | TestStateMachineFunc(); 16 | TestEnumFunc(); 17 | } 18 | 19 | [ContextMenu(nameof(TestActionArray))] 20 | private void TestActionArray() 21 | { 22 | var actions = Enumerable.Range(1, 10).Select(TaskCreateHelper.CreateRandomTask).ToArray(); 23 | SliceableTask task = SliceableTask.Start(0.01f, actions); 24 | } 25 | 26 | [ContextMenu(nameof(TestActionEnumerable))] 27 | private void TestActionEnumerable() 28 | { 29 | var actions = Enumerable.Range(1, 10).Select(TaskCreateHelper.CreateRandomTask); 30 | SliceableTask task = SliceableTask.Start(0.01f, actions); 31 | } 32 | 33 | [ContextMenu(nameof(TestStateMachineFunc))] 34 | private void TestStateMachineFunc() 35 | { 36 | OpenStateMachineFunc func = (ref int state) => 37 | { 38 | TaskCreateHelper.ExecuteRandomTask(state); 39 | return state++ == 10; 40 | }; 41 | SliceableTask task = SliceableTask.Start(0.01f, 1, func); 42 | } 43 | 44 | [ContextMenu(nameof(TestEnumFunc))] 45 | private void TestEnumFunc() 46 | { 47 | SliceableTask task = SliceableTask.Start(0.01f, EnumFunc); 48 | } 49 | 50 | private IEnumerator EnumFunc() 51 | { 52 | for (int state = 1; state <= 10; state++) 53 | { 54 | TaskCreateHelper.ExecuteRandomTask(state); 55 | yield return null; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseBasic.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d26b4f2cc90d094ea184e87a7f76d5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseCancelTask.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | namespace AillieoUtils.EasyTimeSlicing.Sample 7 | { 8 | public class TestCaseCancelTask : MonoBehaviour 9 | { 10 | private SliceableTask task = default; 11 | 12 | private void Start() 13 | { 14 | StartTask(); 15 | } 16 | 17 | [ContextMenu(nameof(StartTask))] 18 | private void StartTask() 19 | { 20 | if (task == null) 21 | { 22 | var actions = Enumerable.Range(1, 1000).Select(TaskCreateHelper.CreateRandomTask); 23 | task = SliceableTask.Start(0.01f, actions); 24 | } 25 | } 26 | 27 | [ContextMenu(nameof(CancelTask))] 28 | private void CancelTask() 29 | { 30 | if (task != null) 31 | { 32 | task.Cancel(); 33 | task = null; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseCancelTask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b08a540cf529c94eb2ca239f1302475 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseInstantiate.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace AillieoUtils.EasyTimeSlicing.Sample 6 | { 7 | public class TestCaseInstantiate : MonoBehaviour 8 | { 9 | [SerializeField] 10 | private GameObject prefab; 11 | [SerializeField] 12 | private int range = 8; 13 | [SerializeField] 14 | private Vector2 offset = new Vector2(3f, 3f); 15 | [SerializeField] 16 | private float executionTime = 0.001f; 17 | 18 | private void Start() 19 | { 20 | RunInstantiateTask(); 21 | } 22 | 23 | [ContextMenu(nameof(RunInstantiateTask))] 24 | private void RunInstantiateTask() 25 | { 26 | if (prefab == null) 27 | { 28 | UnityEngine.Debug.LogError("prefab null"); 29 | return; 30 | } 31 | 32 | SliceableTask.Start(executionTime, InstantiateItem2); 33 | } 34 | 35 | [ContextMenu(nameof(RunInstantiateInCoroutine))] 36 | private void RunInstantiateInCoroutine() 37 | { 38 | if (prefab == null) 39 | { 40 | UnityEngine.Debug.LogError("prefab null"); 41 | return; 42 | } 43 | 44 | StartCoroutine(InstantiateItem1()); 45 | } 46 | 47 | private IEnumerator InstantiateItem1() 48 | { 49 | int index = 0; 50 | int total = range * range; 51 | 52 | while (index < total) 53 | { 54 | if (index < 0 || index >= total) 55 | { 56 | break; 57 | } 58 | 59 | Vector2 basePos = -offset * Vector2.one * 0.5f * range; 60 | int x = index / range; 61 | int y = index % range; 62 | 63 | GameObject go = Instantiate(prefab, this.transform); 64 | go.transform.localPosition = new Vector3(basePos.x + offset.x * x, 0, basePos.y + offset.y * y); 65 | 66 | index++; 67 | 68 | yield return new WaitForSeconds(executionTime); 69 | } 70 | } 71 | 72 | private IEnumerator InstantiateItem2() 73 | { 74 | int index = 0; 75 | int total = range * range; 76 | 77 | while (index < total) 78 | { 79 | if (index < 0 || index >= total) 80 | { 81 | yield break; 82 | } 83 | 84 | Vector2 basePos = -offset * Vector2.one * 0.5f * range; 85 | int x = index / range; 86 | int y = index % range; 87 | 88 | GameObject go = Instantiate(prefab, this.transform); 89 | go.transform.localPosition = new Vector3(basePos.x + offset.x * x, 0, basePos.y + offset.y * y); 90 | 91 | index++; 92 | 93 | yield return null; 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseInstantiate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eb0c924f0e73034296f94b0ea29bc11 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseTaskQueue.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | 6 | namespace AillieoUtils.EasyTimeSlicing.Sample 7 | { 8 | public class TestCaseTaskQueue : MonoBehaviour 9 | { 10 | private SliceableTaskQueue queue; 11 | private int index; 12 | 13 | private void Start() 14 | { 15 | queue = SliceableTaskQueue.Create(0.003f); 16 | index = 1; 17 | } 18 | 19 | //private void Update() 20 | //{ 21 | // if (Time.frameCount % 5 == 0) 22 | // { 23 | // queue.Enqueue(TaskCreateHelper.CreateRandomTask(index++)); 24 | // } 25 | //} 26 | 27 | [ContextMenu(nameof(AddTasksHighPriority60))] 28 | private void AddTasksHighPriority60() 29 | { 30 | Enumerable.Range(1, 60) 31 | .Select(i => TaskCreateHelper.CreateRandomTask($"{index++} High")) 32 | .ToList() 33 | .ForEach(t => queue.Enqueue(t, SliceableTaskQueue.Priority.High)); 34 | } 35 | 36 | [ContextMenu(nameof(AddTasksMediumPriority60))] 37 | private void AddTasksMediumPriority60() 38 | { 39 | Enumerable.Range(1, 60) 40 | .Select(i => TaskCreateHelper.CreateRandomTask($"{index++} Medium")) 41 | .ToList() 42 | .ForEach(t => queue.Enqueue(t, SliceableTaskQueue.Priority.Medium)); 43 | } 44 | 45 | [ContextMenu(nameof(AddTasksLowPriority60))] 46 | private void AddTasksLowPriority60() 47 | { 48 | Enumerable.Range(1, 60) 49 | .Select(i => TaskCreateHelper.CreateRandomTask($"{index++} Low")) 50 | .ToList() 51 | .ForEach(t => queue.Enqueue(t, SliceableTaskQueue.Priority.Low)); 52 | } 53 | 54 | [ContextMenu(nameof(AddTasks60RemoveOdd))] 55 | private void AddTasks60RemoveOdd() 56 | { 57 | Enumerable.Range(1, 60) 58 | .Select(i => new { idx = i, task = TaskCreateHelper.CreateRandomTask(index++) }) 59 | .ToList() 60 | .Select(o => new { idx = o.idx, handle = queue.EnqueueWithHandle(o.task) }) 61 | .Where(o => (o.idx & 1) != 0) 62 | .ToList() 63 | .ForEach(o => o.handle.Cancel()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Assets/Sample/Scripts/TestCaseTaskQueue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c01c9a0dd0a8c0844bd0021c7fc15d53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.aillieo.easy-time-slicing", 3 | "displayName": "AillieoUtils EasyTimeSlicing", 4 | "description": "AillieoUtils EasyTimeSlicing", 5 | "version": "1.0.0", 6 | "unity": "2019.4", 7 | "license": "MIT", 8 | "dependencies": { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d2673a4f28117a4086f779ed82bf78c 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | $(MSBuildThisFileDirectory)AillieoTech.ruleset 5 | 6 | $(NoWarn);0649 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | stylecop.json 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Aillieo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.animation": "5.2.0", 4 | "com.unity.2d.pixel-perfect": "4.0.1", 5 | "com.unity.2d.psdimporter": "4.3.0", 6 | "com.unity.2d.sprite": "1.0.0", 7 | "com.unity.2d.spriteshape": "5.3.0", 8 | "com.unity.2d.tilemap": "1.0.0", 9 | "com.unity.collab-proxy": "1.17.2", 10 | "com.unity.ide.rider": "3.0.15", 11 | "com.unity.ide.visualstudio": "2.0.16", 12 | "com.unity.ide.vscode": "1.2.5", 13 | "com.unity.test-framework": "1.1.33", 14 | "com.unity.textmeshpro": "3.0.6", 15 | "com.unity.timeline": "1.4.8", 16 | "com.unity.ugui": "1.0.0", 17 | "com.unity.modules.ai": "1.0.0", 18 | "com.unity.modules.androidjni": "1.0.0", 19 | "com.unity.modules.animation": "1.0.0", 20 | "com.unity.modules.assetbundle": "1.0.0", 21 | "com.unity.modules.audio": "1.0.0", 22 | "com.unity.modules.cloth": "1.0.0", 23 | "com.unity.modules.director": "1.0.0", 24 | "com.unity.modules.imageconversion": "1.0.0", 25 | "com.unity.modules.imgui": "1.0.0", 26 | "com.unity.modules.jsonserialize": "1.0.0", 27 | "com.unity.modules.particlesystem": "1.0.0", 28 | "com.unity.modules.physics": "1.0.0", 29 | "com.unity.modules.physics2d": "1.0.0", 30 | "com.unity.modules.screencapture": "1.0.0", 31 | "com.unity.modules.terrain": "1.0.0", 32 | "com.unity.modules.terrainphysics": "1.0.0", 33 | "com.unity.modules.tilemap": "1.0.0", 34 | "com.unity.modules.ui": "1.0.0", 35 | "com.unity.modules.uielements": "1.0.0", 36 | "com.unity.modules.umbra": "1.0.0", 37 | "com.unity.modules.unityanalytics": "1.0.0", 38 | "com.unity.modules.unitywebrequest": "1.0.0", 39 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 40 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 41 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 42 | "com.unity.modules.unitywebrequestwww": "1.0.0", 43 | "com.unity.modules.vehicles": "1.0.0", 44 | "com.unity.modules.video": "1.0.0", 45 | "com.unity.modules.vr": "1.0.0", 46 | "com.unity.modules.wind": "1.0.0", 47 | "com.unity.modules.xr": "1.0.0" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.animation": { 4 | "version": "5.2.0", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.2d.common": "4.2.0", 9 | "com.unity.mathematics": "1.1.0", 10 | "com.unity.2d.sprite": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.uielements": "1.0.0" 13 | }, 14 | "url": "https://packages.unity.com" 15 | }, 16 | "com.unity.2d.common": { 17 | "version": "4.2.0", 18 | "depth": 1, 19 | "source": "registry", 20 | "dependencies": { 21 | "com.unity.2d.sprite": "1.0.0", 22 | "com.unity.modules.uielements": "1.0.0" 23 | }, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.2d.path": { 27 | "version": "4.0.2", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": {}, 31 | "url": "https://packages.unity.com" 32 | }, 33 | "com.unity.2d.pixel-perfect": { 34 | "version": "4.0.1", 35 | "depth": 0, 36 | "source": "registry", 37 | "dependencies": {}, 38 | "url": "https://packages.unity.com" 39 | }, 40 | "com.unity.2d.psdimporter": { 41 | "version": "4.3.0", 42 | "depth": 0, 43 | "source": "registry", 44 | "dependencies": { 45 | "com.unity.2d.common": "4.2.0", 46 | "com.unity.2d.animation": "5.2.0", 47 | "com.unity.2d.sprite": "1.0.0" 48 | }, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.2d.sprite": { 52 | "version": "1.0.0", 53 | "depth": 0, 54 | "source": "builtin", 55 | "dependencies": {} 56 | }, 57 | "com.unity.2d.spriteshape": { 58 | "version": "5.3.0", 59 | "depth": 0, 60 | "source": "registry", 61 | "dependencies": { 62 | "com.unity.mathematics": "1.1.0", 63 | "com.unity.2d.common": "4.2.0", 64 | "com.unity.2d.path": "4.0.2", 65 | "com.unity.modules.physics2d": "1.0.0" 66 | }, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "com.unity.2d.tilemap": { 70 | "version": "1.0.0", 71 | "depth": 0, 72 | "source": "builtin", 73 | "dependencies": {} 74 | }, 75 | "com.unity.collab-proxy": { 76 | "version": "1.17.2", 77 | "depth": 0, 78 | "source": "registry", 79 | "dependencies": { 80 | "com.unity.services.core": "1.0.1" 81 | }, 82 | "url": "https://packages.unity.com" 83 | }, 84 | "com.unity.ext.nunit": { 85 | "version": "1.0.6", 86 | "depth": 1, 87 | "source": "registry", 88 | "dependencies": {}, 89 | "url": "https://packages.unity.com" 90 | }, 91 | "com.unity.ide.rider": { 92 | "version": "3.0.15", 93 | "depth": 0, 94 | "source": "registry", 95 | "dependencies": { 96 | "com.unity.ext.nunit": "1.0.6" 97 | }, 98 | "url": "https://packages.unity.com" 99 | }, 100 | "com.unity.ide.visualstudio": { 101 | "version": "2.0.16", 102 | "depth": 0, 103 | "source": "registry", 104 | "dependencies": { 105 | "com.unity.test-framework": "1.1.9" 106 | }, 107 | "url": "https://packages.unity.com" 108 | }, 109 | "com.unity.ide.vscode": { 110 | "version": "1.2.5", 111 | "depth": 0, 112 | "source": "registry", 113 | "dependencies": {}, 114 | "url": "https://packages.unity.com" 115 | }, 116 | "com.unity.mathematics": { 117 | "version": "1.1.0", 118 | "depth": 1, 119 | "source": "registry", 120 | "dependencies": {}, 121 | "url": "https://packages.unity.com" 122 | }, 123 | "com.unity.services.core": { 124 | "version": "1.0.1", 125 | "depth": 1, 126 | "source": "registry", 127 | "dependencies": { 128 | "com.unity.modules.unitywebrequest": "1.0.0" 129 | }, 130 | "url": "https://packages.unity.com" 131 | }, 132 | "com.unity.test-framework": { 133 | "version": "1.1.33", 134 | "depth": 0, 135 | "source": "registry", 136 | "dependencies": { 137 | "com.unity.ext.nunit": "1.0.6", 138 | "com.unity.modules.imgui": "1.0.0", 139 | "com.unity.modules.jsonserialize": "1.0.0" 140 | }, 141 | "url": "https://packages.unity.com" 142 | }, 143 | "com.unity.textmeshpro": { 144 | "version": "3.0.6", 145 | "depth": 0, 146 | "source": "registry", 147 | "dependencies": { 148 | "com.unity.ugui": "1.0.0" 149 | }, 150 | "url": "https://packages.unity.com" 151 | }, 152 | "com.unity.timeline": { 153 | "version": "1.4.8", 154 | "depth": 0, 155 | "source": "registry", 156 | "dependencies": { 157 | "com.unity.modules.director": "1.0.0", 158 | "com.unity.modules.animation": "1.0.0", 159 | "com.unity.modules.audio": "1.0.0", 160 | "com.unity.modules.particlesystem": "1.0.0" 161 | }, 162 | "url": "https://packages.unity.com" 163 | }, 164 | "com.unity.ugui": { 165 | "version": "1.0.0", 166 | "depth": 0, 167 | "source": "builtin", 168 | "dependencies": { 169 | "com.unity.modules.ui": "1.0.0", 170 | "com.unity.modules.imgui": "1.0.0" 171 | } 172 | }, 173 | "com.unity.modules.ai": { 174 | "version": "1.0.0", 175 | "depth": 0, 176 | "source": "builtin", 177 | "dependencies": {} 178 | }, 179 | "com.unity.modules.androidjni": { 180 | "version": "1.0.0", 181 | "depth": 0, 182 | "source": "builtin", 183 | "dependencies": {} 184 | }, 185 | "com.unity.modules.animation": { 186 | "version": "1.0.0", 187 | "depth": 0, 188 | "source": "builtin", 189 | "dependencies": {} 190 | }, 191 | "com.unity.modules.assetbundle": { 192 | "version": "1.0.0", 193 | "depth": 0, 194 | "source": "builtin", 195 | "dependencies": {} 196 | }, 197 | "com.unity.modules.audio": { 198 | "version": "1.0.0", 199 | "depth": 0, 200 | "source": "builtin", 201 | "dependencies": {} 202 | }, 203 | "com.unity.modules.cloth": { 204 | "version": "1.0.0", 205 | "depth": 0, 206 | "source": "builtin", 207 | "dependencies": { 208 | "com.unity.modules.physics": "1.0.0" 209 | } 210 | }, 211 | "com.unity.modules.director": { 212 | "version": "1.0.0", 213 | "depth": 0, 214 | "source": "builtin", 215 | "dependencies": { 216 | "com.unity.modules.audio": "1.0.0", 217 | "com.unity.modules.animation": "1.0.0" 218 | } 219 | }, 220 | "com.unity.modules.imageconversion": { 221 | "version": "1.0.0", 222 | "depth": 0, 223 | "source": "builtin", 224 | "dependencies": {} 225 | }, 226 | "com.unity.modules.imgui": { 227 | "version": "1.0.0", 228 | "depth": 0, 229 | "source": "builtin", 230 | "dependencies": {} 231 | }, 232 | "com.unity.modules.jsonserialize": { 233 | "version": "1.0.0", 234 | "depth": 0, 235 | "source": "builtin", 236 | "dependencies": {} 237 | }, 238 | "com.unity.modules.particlesystem": { 239 | "version": "1.0.0", 240 | "depth": 0, 241 | "source": "builtin", 242 | "dependencies": {} 243 | }, 244 | "com.unity.modules.physics": { 245 | "version": "1.0.0", 246 | "depth": 0, 247 | "source": "builtin", 248 | "dependencies": {} 249 | }, 250 | "com.unity.modules.physics2d": { 251 | "version": "1.0.0", 252 | "depth": 0, 253 | "source": "builtin", 254 | "dependencies": {} 255 | }, 256 | "com.unity.modules.screencapture": { 257 | "version": "1.0.0", 258 | "depth": 0, 259 | "source": "builtin", 260 | "dependencies": { 261 | "com.unity.modules.imageconversion": "1.0.0" 262 | } 263 | }, 264 | "com.unity.modules.subsystems": { 265 | "version": "1.0.0", 266 | "depth": 1, 267 | "source": "builtin", 268 | "dependencies": { 269 | "com.unity.modules.jsonserialize": "1.0.0" 270 | } 271 | }, 272 | "com.unity.modules.terrain": { 273 | "version": "1.0.0", 274 | "depth": 0, 275 | "source": "builtin", 276 | "dependencies": {} 277 | }, 278 | "com.unity.modules.terrainphysics": { 279 | "version": "1.0.0", 280 | "depth": 0, 281 | "source": "builtin", 282 | "dependencies": { 283 | "com.unity.modules.physics": "1.0.0", 284 | "com.unity.modules.terrain": "1.0.0" 285 | } 286 | }, 287 | "com.unity.modules.tilemap": { 288 | "version": "1.0.0", 289 | "depth": 0, 290 | "source": "builtin", 291 | "dependencies": { 292 | "com.unity.modules.physics2d": "1.0.0" 293 | } 294 | }, 295 | "com.unity.modules.ui": { 296 | "version": "1.0.0", 297 | "depth": 0, 298 | "source": "builtin", 299 | "dependencies": {} 300 | }, 301 | "com.unity.modules.uielements": { 302 | "version": "1.0.0", 303 | "depth": 0, 304 | "source": "builtin", 305 | "dependencies": { 306 | "com.unity.modules.ui": "1.0.0", 307 | "com.unity.modules.imgui": "1.0.0", 308 | "com.unity.modules.jsonserialize": "1.0.0", 309 | "com.unity.modules.uielementsnative": "1.0.0" 310 | } 311 | }, 312 | "com.unity.modules.uielementsnative": { 313 | "version": "1.0.0", 314 | "depth": 1, 315 | "source": "builtin", 316 | "dependencies": { 317 | "com.unity.modules.ui": "1.0.0", 318 | "com.unity.modules.imgui": "1.0.0", 319 | "com.unity.modules.jsonserialize": "1.0.0" 320 | } 321 | }, 322 | "com.unity.modules.umbra": { 323 | "version": "1.0.0", 324 | "depth": 0, 325 | "source": "builtin", 326 | "dependencies": {} 327 | }, 328 | "com.unity.modules.unityanalytics": { 329 | "version": "1.0.0", 330 | "depth": 0, 331 | "source": "builtin", 332 | "dependencies": { 333 | "com.unity.modules.unitywebrequest": "1.0.0", 334 | "com.unity.modules.jsonserialize": "1.0.0" 335 | } 336 | }, 337 | "com.unity.modules.unitywebrequest": { 338 | "version": "1.0.0", 339 | "depth": 0, 340 | "source": "builtin", 341 | "dependencies": {} 342 | }, 343 | "com.unity.modules.unitywebrequestassetbundle": { 344 | "version": "1.0.0", 345 | "depth": 0, 346 | "source": "builtin", 347 | "dependencies": { 348 | "com.unity.modules.assetbundle": "1.0.0", 349 | "com.unity.modules.unitywebrequest": "1.0.0" 350 | } 351 | }, 352 | "com.unity.modules.unitywebrequestaudio": { 353 | "version": "1.0.0", 354 | "depth": 0, 355 | "source": "builtin", 356 | "dependencies": { 357 | "com.unity.modules.unitywebrequest": "1.0.0", 358 | "com.unity.modules.audio": "1.0.0" 359 | } 360 | }, 361 | "com.unity.modules.unitywebrequesttexture": { 362 | "version": "1.0.0", 363 | "depth": 0, 364 | "source": "builtin", 365 | "dependencies": { 366 | "com.unity.modules.unitywebrequest": "1.0.0", 367 | "com.unity.modules.imageconversion": "1.0.0" 368 | } 369 | }, 370 | "com.unity.modules.unitywebrequestwww": { 371 | "version": "1.0.0", 372 | "depth": 0, 373 | "source": "builtin", 374 | "dependencies": { 375 | "com.unity.modules.unitywebrequest": "1.0.0", 376 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 377 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 378 | "com.unity.modules.audio": "1.0.0", 379 | "com.unity.modules.assetbundle": "1.0.0", 380 | "com.unity.modules.imageconversion": "1.0.0" 381 | } 382 | }, 383 | "com.unity.modules.vehicles": { 384 | "version": "1.0.0", 385 | "depth": 0, 386 | "source": "builtin", 387 | "dependencies": { 388 | "com.unity.modules.physics": "1.0.0" 389 | } 390 | }, 391 | "com.unity.modules.video": { 392 | "version": "1.0.0", 393 | "depth": 0, 394 | "source": "builtin", 395 | "dependencies": { 396 | "com.unity.modules.audio": "1.0.0", 397 | "com.unity.modules.ui": "1.0.0", 398 | "com.unity.modules.unitywebrequest": "1.0.0" 399 | } 400 | }, 401 | "com.unity.modules.vr": { 402 | "version": "1.0.0", 403 | "depth": 0, 404 | "source": "builtin", 405 | "dependencies": { 406 | "com.unity.modules.jsonserialize": "1.0.0", 407 | "com.unity.modules.physics": "1.0.0", 408 | "com.unity.modules.xr": "1.0.0" 409 | } 410 | }, 411 | "com.unity.modules.wind": { 412 | "version": "1.0.0", 413 | "depth": 0, 414 | "source": "builtin", 415 | "dependencies": {} 416 | }, 417 | "com.unity.modules.xr": { 418 | "version": "1.0.0", 419 | "depth": 0, 420 | "source": "builtin", 421 | "dependencies": { 422 | "com.unity.modules.physics": "1.0.0", 423 | "com.unity.modules.jsonserialize": "1.0.0", 424 | "com.unity.modules.subsystems": "1.0.0" 425 | } 426 | } 427 | } 428 | } 429 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 9 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 1 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 4 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 34 | m_PreloadedShaders: [] 35 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 36 | type: 0} 37 | m_CustomRenderPipeline: {fileID: 0} 38 | m_TransparencySortMode: 0 39 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 40 | m_DefaultRenderingPath: 1 41 | m_DefaultMobileRenderingPath: 1 42 | m_TierSettings: [] 43 | m_LightmapStripping: 0 44 | m_FogStripping: 0 45 | m_InstancingStripping: 0 46 | m_LightmapKeepPlain: 1 47 | m_LightmapKeepDirCombined: 1 48 | m_LightmapKeepDynamicPlain: 1 49 | m_LightmapKeepDynamicDirCombined: 1 50 | m_LightmapKeepShadowMask: 1 51 | m_LightmapKeepSubtractive: 1 52 | m_FogKeepLinear: 1 53 | m_FogKeepExp: 1 54 | m_FogKeepExp2: 1 55 | m_AlbedoSwatchInfos: [] 56 | m_LightsUseLinearIntensity: 0 57 | m_LightsUseColorTemperature: 0 58 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: b44e12fc3da09b8488298bdfa446121d 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: EasyTimeSlicing 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 1 58 | allowedAutorotateToPortraitUpsideDown: 1 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 1 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 1 67 | androidUseSwappy: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | fullscreenMode: 1 95 | xboxSpeechDB: 0 96 | xboxEnableHeadOrientation: 0 97 | xboxEnableGuest: 0 98 | xboxEnablePIXSampling: 0 99 | metalFramebufferOnly: 0 100 | xboxOneResolution: 0 101 | xboxOneSResolution: 0 102 | xboxOneXResolution: 3 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | xboxOneEnableTypeOptimization: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 0 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | switchNVNMaxPublicTextureIDCount: 0 115 | switchNVNMaxPublicSamplerIDCount: 0 116 | stadiaPresentMode: 0 117 | stadiaTargetFramerate: 0 118 | vulkanNumSwapchainBuffers: 3 119 | vulkanEnableSetSRGBWrite: 0 120 | vulkanEnableLateAcquireNextImage: 0 121 | m_SupportedAspectRatios: 122 | 4:3: 1 123 | 5:4: 1 124 | 16:10: 1 125 | 16:9: 1 126 | Others: 1 127 | bundleVersion: 0.1 128 | preloadedAssets: [] 129 | metroInputSource: 0 130 | wsaTransparentSwapchain: 0 131 | m_HolographicPauseOnTrackingLoss: 1 132 | xboxOneDisableKinectGpuReservation: 1 133 | xboxOneEnable7thCore: 1 134 | vrSettings: 135 | cardboard: 136 | depthFormat: 0 137 | enableTransitionView: 0 138 | daydream: 139 | depthFormat: 0 140 | useSustainedPerformanceMode: 0 141 | enableVideoLayer: 0 142 | useProtectedVideoMemory: 0 143 | minimumSupportedHeadTracking: 0 144 | maximumSupportedHeadTracking: 1 145 | hololens: 146 | depthFormat: 1 147 | depthBufferSharingEnabled: 1 148 | lumin: 149 | depthFormat: 0 150 | frameTiming: 2 151 | enableGLCache: 0 152 | glCacheMaxBlobSize: 524288 153 | glCacheMaxFileSize: 8388608 154 | oculus: 155 | sharedDepthBuffer: 1 156 | dashSupport: 1 157 | lowOverheadMode: 0 158 | protectedContext: 0 159 | v2Signing: 1 160 | enable360StereoCapture: 0 161 | isWsaHolographicRemotingEnabled: 0 162 | enableFrameTimingStats: 0 163 | useHDRDisplay: 0 164 | D3DHDRBitDepth: 0 165 | m_ColorGamuts: 00000000 166 | targetPixelDensity: 30 167 | resolutionScalingMode: 0 168 | androidSupportedAspectRatio: 1 169 | androidMaxAspectRatio: 2.1 170 | applicationIdentifier: {} 171 | buildNumber: {} 172 | AndroidBundleVersionCode: 1 173 | AndroidMinSdkVersion: 19 174 | AndroidTargetSdkVersion: 0 175 | AndroidPreferredInstallLocation: 1 176 | aotOptions: 177 | stripEngineCode: 1 178 | iPhoneStrippingLevel: 0 179 | iPhoneScriptCallOptimization: 0 180 | ForceInternetPermission: 0 181 | ForceSDCardPermission: 0 182 | CreateWallpaper: 0 183 | APKExpansionFiles: 0 184 | keepLoadedShadersAlive: 0 185 | StripUnusedMeshComponents: 1 186 | VertexChannelCompressionMask: 4054 187 | iPhoneSdkVersion: 988 188 | iOSTargetOSVersionString: 10.0 189 | tvOSSdkVersion: 0 190 | tvOSRequireExtendedGameController: 0 191 | tvOSTargetOSVersionString: 10.0 192 | uIPrerenderedIcon: 0 193 | uIRequiresPersistentWiFi: 0 194 | uIRequiresFullScreen: 1 195 | uIStatusBarHidden: 1 196 | uIExitOnSuspend: 0 197 | uIStatusBarStyle: 0 198 | appleTVSplashScreen: {fileID: 0} 199 | appleTVSplashScreen2x: {fileID: 0} 200 | tvOSSmallIconLayers: [] 201 | tvOSSmallIconLayers2x: [] 202 | tvOSLargeIconLayers: [] 203 | tvOSLargeIconLayers2x: [] 204 | tvOSTopShelfImageLayers: [] 205 | tvOSTopShelfImageLayers2x: [] 206 | tvOSTopShelfImageWideLayers: [] 207 | tvOSTopShelfImageWideLayers2x: [] 208 | iOSLaunchScreenType: 0 209 | iOSLaunchScreenPortrait: {fileID: 0} 210 | iOSLaunchScreenLandscape: {fileID: 0} 211 | iOSLaunchScreenBackgroundColor: 212 | serializedVersion: 2 213 | rgba: 0 214 | iOSLaunchScreenFillPct: 100 215 | iOSLaunchScreenSize: 100 216 | iOSLaunchScreenCustomXibPath: 217 | iOSLaunchScreeniPadType: 0 218 | iOSLaunchScreeniPadImage: {fileID: 0} 219 | iOSLaunchScreeniPadBackgroundColor: 220 | serializedVersion: 2 221 | rgba: 0 222 | iOSLaunchScreeniPadFillPct: 100 223 | iOSLaunchScreeniPadSize: 100 224 | iOSLaunchScreeniPadCustomXibPath: 225 | iOSUseLaunchScreenStoryboard: 0 226 | iOSLaunchScreenCustomStoryboardPath: 227 | iOSDeviceRequirements: [] 228 | iOSURLSchemes: [] 229 | iOSBackgroundModes: 0 230 | iOSMetalForceHardShadows: 0 231 | metalEditorSupport: 1 232 | metalAPIValidation: 1 233 | iOSRenderExtraFrameOnPause: 0 234 | iosCopyPluginsCodeInsteadOfSymlink: 0 235 | appleDeveloperTeamID: 236 | iOSManualSigningProvisioningProfileID: 237 | tvOSManualSigningProvisioningProfileID: 238 | iOSManualSigningProvisioningProfileType: 0 239 | tvOSManualSigningProvisioningProfileType: 0 240 | appleEnableAutomaticSigning: 0 241 | iOSRequireARKit: 0 242 | iOSAutomaticallyDetectAndAddCapabilities: 1 243 | appleEnableProMotion: 0 244 | clonedFromGUID: 5f34be1353de5cf4398729fda238591b 245 | templatePackageId: com.unity.template.2d@3.3.2 246 | templateDefaultScene: Assets/Scenes/SampleScene.unity 247 | AndroidTargetArchitectures: 1 248 | AndroidSplashScreenScale: 0 249 | androidSplashScreen: {fileID: 0} 250 | AndroidKeystoreName: 251 | AndroidKeyaliasName: 252 | AndroidBuildApkPerCpuArchitecture: 0 253 | AndroidTVCompatibility: 0 254 | AndroidIsGame: 1 255 | AndroidEnableTango: 0 256 | androidEnableBanner: 1 257 | androidUseLowAccuracyLocation: 0 258 | androidUseCustomKeystore: 0 259 | m_AndroidBanners: 260 | - width: 320 261 | height: 180 262 | banner: {fileID: 0} 263 | androidGamepadSupportLevel: 0 264 | AndroidValidateAppBundleSize: 1 265 | AndroidAppBundleSizeToValidate: 150 266 | m_BuildTargetIcons: [] 267 | m_BuildTargetPlatformIcons: [] 268 | m_BuildTargetBatching: [] 269 | m_BuildTargetGraphicsJobs: 270 | - m_BuildTarget: MacStandaloneSupport 271 | m_GraphicsJobs: 0 272 | - m_BuildTarget: Switch 273 | m_GraphicsJobs: 0 274 | - m_BuildTarget: MetroSupport 275 | m_GraphicsJobs: 0 276 | - m_BuildTarget: AppleTVSupport 277 | m_GraphicsJobs: 0 278 | - m_BuildTarget: BJMSupport 279 | m_GraphicsJobs: 0 280 | - m_BuildTarget: LinuxStandaloneSupport 281 | m_GraphicsJobs: 0 282 | - m_BuildTarget: PS4Player 283 | m_GraphicsJobs: 0 284 | - m_BuildTarget: iOSSupport 285 | m_GraphicsJobs: 0 286 | - m_BuildTarget: WindowsStandaloneSupport 287 | m_GraphicsJobs: 0 288 | - m_BuildTarget: XboxOnePlayer 289 | m_GraphicsJobs: 0 290 | - m_BuildTarget: LuminSupport 291 | m_GraphicsJobs: 0 292 | - m_BuildTarget: AndroidPlayer 293 | m_GraphicsJobs: 0 294 | - m_BuildTarget: WebGLSupport 295 | m_GraphicsJobs: 0 296 | m_BuildTargetGraphicsJobMode: 297 | - m_BuildTarget: PS4Player 298 | m_GraphicsJobMode: 0 299 | - m_BuildTarget: XboxOnePlayer 300 | m_GraphicsJobMode: 0 301 | m_BuildTargetGraphicsAPIs: 302 | - m_BuildTarget: AndroidPlayer 303 | m_APIs: 150000000b000000 304 | m_Automatic: 0 305 | m_BuildTargetVRSettings: [] 306 | openGLRequireES31: 0 307 | openGLRequireES31AEP: 0 308 | openGLRequireES32: 0 309 | m_TemplateCustomTags: {} 310 | mobileMTRendering: 311 | Android: 1 312 | iPhone: 1 313 | tvOS: 1 314 | m_BuildTargetGroupLightmapEncodingQuality: [] 315 | m_BuildTargetGroupLightmapSettings: [] 316 | playModeTestRunnerEnabled: 0 317 | runPlayModeTestAsEditModeTest: 0 318 | actionOnDotNetUnhandledException: 1 319 | enableInternalProfiler: 0 320 | logObjCUncaughtExceptions: 1 321 | enableCrashReportAPI: 0 322 | cameraUsageDescription: 323 | locationUsageDescription: 324 | microphoneUsageDescription: 325 | switchNetLibKey: 326 | switchSocketMemoryPoolSize: 6144 327 | switchSocketAllocatorPoolSize: 128 328 | switchSocketConcurrencyLimit: 14 329 | switchScreenResolutionBehavior: 2 330 | switchUseCPUProfiler: 0 331 | switchApplicationID: 0x01004b9000490000 332 | switchNSODependencies: 333 | switchTitleNames_0: 334 | switchTitleNames_1: 335 | switchTitleNames_2: 336 | switchTitleNames_3: 337 | switchTitleNames_4: 338 | switchTitleNames_5: 339 | switchTitleNames_6: 340 | switchTitleNames_7: 341 | switchTitleNames_8: 342 | switchTitleNames_9: 343 | switchTitleNames_10: 344 | switchTitleNames_11: 345 | switchTitleNames_12: 346 | switchTitleNames_13: 347 | switchTitleNames_14: 348 | switchPublisherNames_0: 349 | switchPublisherNames_1: 350 | switchPublisherNames_2: 351 | switchPublisherNames_3: 352 | switchPublisherNames_4: 353 | switchPublisherNames_5: 354 | switchPublisherNames_6: 355 | switchPublisherNames_7: 356 | switchPublisherNames_8: 357 | switchPublisherNames_9: 358 | switchPublisherNames_10: 359 | switchPublisherNames_11: 360 | switchPublisherNames_12: 361 | switchPublisherNames_13: 362 | switchPublisherNames_14: 363 | switchIcons_0: {fileID: 0} 364 | switchIcons_1: {fileID: 0} 365 | switchIcons_2: {fileID: 0} 366 | switchIcons_3: {fileID: 0} 367 | switchIcons_4: {fileID: 0} 368 | switchIcons_5: {fileID: 0} 369 | switchIcons_6: {fileID: 0} 370 | switchIcons_7: {fileID: 0} 371 | switchIcons_8: {fileID: 0} 372 | switchIcons_9: {fileID: 0} 373 | switchIcons_10: {fileID: 0} 374 | switchIcons_11: {fileID: 0} 375 | switchIcons_12: {fileID: 0} 376 | switchIcons_13: {fileID: 0} 377 | switchIcons_14: {fileID: 0} 378 | switchSmallIcons_0: {fileID: 0} 379 | switchSmallIcons_1: {fileID: 0} 380 | switchSmallIcons_2: {fileID: 0} 381 | switchSmallIcons_3: {fileID: 0} 382 | switchSmallIcons_4: {fileID: 0} 383 | switchSmallIcons_5: {fileID: 0} 384 | switchSmallIcons_6: {fileID: 0} 385 | switchSmallIcons_7: {fileID: 0} 386 | switchSmallIcons_8: {fileID: 0} 387 | switchSmallIcons_9: {fileID: 0} 388 | switchSmallIcons_10: {fileID: 0} 389 | switchSmallIcons_11: {fileID: 0} 390 | switchSmallIcons_12: {fileID: 0} 391 | switchSmallIcons_13: {fileID: 0} 392 | switchSmallIcons_14: {fileID: 0} 393 | switchManualHTML: 394 | switchAccessibleURLs: 395 | switchLegalInformation: 396 | switchMainThreadStackSize: 1048576 397 | switchPresenceGroupId: 398 | switchLogoHandling: 0 399 | switchReleaseVersion: 0 400 | switchDisplayVersion: 1.0.0 401 | switchStartupUserAccount: 0 402 | switchTouchScreenUsage: 0 403 | switchSupportedLanguagesMask: 0 404 | switchLogoType: 0 405 | switchApplicationErrorCodeCategory: 406 | switchUserAccountSaveDataSize: 0 407 | switchUserAccountSaveDataJournalSize: 0 408 | switchApplicationAttribute: 0 409 | switchCardSpecSize: -1 410 | switchCardSpecClock: -1 411 | switchRatingsMask: 0 412 | switchRatingsInt_0: 0 413 | switchRatingsInt_1: 0 414 | switchRatingsInt_2: 0 415 | switchRatingsInt_3: 0 416 | switchRatingsInt_4: 0 417 | switchRatingsInt_5: 0 418 | switchRatingsInt_6: 0 419 | switchRatingsInt_7: 0 420 | switchRatingsInt_8: 0 421 | switchRatingsInt_9: 0 422 | switchRatingsInt_10: 0 423 | switchRatingsInt_11: 0 424 | switchRatingsInt_12: 0 425 | switchLocalCommunicationIds_0: 426 | switchLocalCommunicationIds_1: 427 | switchLocalCommunicationIds_2: 428 | switchLocalCommunicationIds_3: 429 | switchLocalCommunicationIds_4: 430 | switchLocalCommunicationIds_5: 431 | switchLocalCommunicationIds_6: 432 | switchLocalCommunicationIds_7: 433 | switchParentalControl: 0 434 | switchAllowsScreenshot: 1 435 | switchAllowsVideoCapturing: 1 436 | switchAllowsRuntimeAddOnContentInstall: 0 437 | switchDataLossConfirmation: 0 438 | switchUserAccountLockEnabled: 0 439 | switchSystemResourceMemory: 16777216 440 | switchSupportedNpadStyles: 22 441 | switchNativeFsCacheSize: 32 442 | switchIsHoldTypeHorizontal: 0 443 | switchSupportedNpadCount: 8 444 | switchSocketConfigEnabled: 0 445 | switchTcpInitialSendBufferSize: 32 446 | switchTcpInitialReceiveBufferSize: 64 447 | switchTcpAutoSendBufferSizeMax: 256 448 | switchTcpAutoReceiveBufferSizeMax: 256 449 | switchUdpSendBufferSize: 9 450 | switchUdpReceiveBufferSize: 42 451 | switchSocketBufferEfficiency: 4 452 | switchSocketInitializeEnabled: 1 453 | switchNetworkInterfaceManagerInitializeEnabled: 1 454 | switchPlayerConnectionEnabled: 1 455 | ps4NPAgeRating: 12 456 | ps4NPTitleSecret: 457 | ps4NPTrophyPackPath: 458 | ps4ParentalLevel: 11 459 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 460 | ps4Category: 0 461 | ps4MasterVersion: 01.00 462 | ps4AppVersion: 01.00 463 | ps4AppType: 0 464 | ps4ParamSfxPath: 465 | ps4VideoOutPixelFormat: 0 466 | ps4VideoOutInitialWidth: 1920 467 | ps4VideoOutBaseModeInitialWidth: 1920 468 | ps4VideoOutReprojectionRate: 60 469 | ps4PronunciationXMLPath: 470 | ps4PronunciationSIGPath: 471 | ps4BackgroundImagePath: 472 | ps4StartupImagePath: 473 | ps4StartupImagesFolder: 474 | ps4IconImagesFolder: 475 | ps4SaveDataImagePath: 476 | ps4SdkOverride: 477 | ps4BGMPath: 478 | ps4ShareFilePath: 479 | ps4ShareOverlayImagePath: 480 | ps4PrivacyGuardImagePath: 481 | ps4ExtraSceSysFile: 482 | ps4NPtitleDatPath: 483 | ps4RemotePlayKeyAssignment: -1 484 | ps4RemotePlayKeyMappingDir: 485 | ps4PlayTogetherPlayerCount: 0 486 | ps4EnterButtonAssignment: 1 487 | ps4ApplicationParam1: 0 488 | ps4ApplicationParam2: 0 489 | ps4ApplicationParam3: 0 490 | ps4ApplicationParam4: 0 491 | ps4DownloadDataSize: 0 492 | ps4GarlicHeapSize: 2048 493 | ps4ProGarlicHeapSize: 2560 494 | playerPrefsMaxSize: 32768 495 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 496 | ps4pnSessions: 1 497 | ps4pnPresence: 1 498 | ps4pnFriends: 1 499 | ps4pnGameCustomData: 1 500 | playerPrefsSupport: 0 501 | enableApplicationExit: 0 502 | resetTempFolder: 1 503 | restrictedAudioUsageRights: 0 504 | ps4UseResolutionFallback: 0 505 | ps4ReprojectionSupport: 0 506 | ps4UseAudio3dBackend: 0 507 | ps4UseLowGarlicFragmentationMode: 1 508 | ps4SocialScreenEnabled: 0 509 | ps4ScriptOptimizationLevel: 0 510 | ps4Audio3dVirtualSpeakerCount: 14 511 | ps4attribCpuUsage: 0 512 | ps4PatchPkgPath: 513 | ps4PatchLatestPkgPath: 514 | ps4PatchChangeinfoPath: 515 | ps4PatchDayOne: 0 516 | ps4attribUserManagement: 0 517 | ps4attribMoveSupport: 0 518 | ps4attrib3DSupport: 0 519 | ps4attribShareSupport: 0 520 | ps4attribExclusiveVR: 0 521 | ps4disableAutoHideSplash: 0 522 | ps4videoRecordingFeaturesUsed: 0 523 | ps4contentSearchFeaturesUsed: 0 524 | ps4CompatibilityPS5: 0 525 | ps4GPU800MHz: 1 526 | ps4attribEyeToEyeDistanceSettingVR: 0 527 | ps4IncludedModules: [] 528 | ps4attribVROutputEnabled: 0 529 | monoEnv: 530 | splashScreenBackgroundSourceLandscape: {fileID: 0} 531 | splashScreenBackgroundSourcePortrait: {fileID: 0} 532 | blurSplashScreenBackground: 1 533 | spritePackerPolicy: 534 | webGLMemorySize: 16 535 | webGLExceptionSupport: 1 536 | webGLNameFilesAsHashes: 0 537 | webGLDataCaching: 1 538 | webGLDebugSymbols: 0 539 | webGLEmscriptenArgs: 540 | webGLModulesDirectory: 541 | webGLTemplate: APPLICATION:Default 542 | webGLAnalyzeBuildSize: 0 543 | webGLUseEmbeddedResources: 0 544 | webGLCompressionFormat: 1 545 | webGLLinkerTarget: 1 546 | webGLThreadsSupport: 0 547 | webGLWasmStreaming: 0 548 | scriptingDefineSymbols: {} 549 | platformArchitecture: {} 550 | scriptingBackend: {} 551 | il2cppCompilerConfiguration: {} 552 | managedStrippingLevel: {} 553 | incrementalIl2cppBuild: {} 554 | allowUnsafeCode: 0 555 | additionalIl2CppArgs: 556 | scriptingRuntimeVersion: 1 557 | gcIncremental: 0 558 | gcWBarrierValidation: 0 559 | apiCompatibilityLevelPerPlatform: {} 560 | m_RenderingPath: 1 561 | m_MobileRenderingPath: 1 562 | metroPackageName: Template_2D 563 | metroPackageVersion: 564 | metroCertificatePath: 565 | metroCertificatePassword: 566 | metroCertificateSubject: 567 | metroCertificateIssuer: 568 | metroCertificateNotAfter: 0000000000000000 569 | metroApplicationDescription: Template_2D 570 | wsaImages: {} 571 | metroTileShortName: 572 | metroTileShowName: 0 573 | metroMediumTileShowName: 0 574 | metroLargeTileShowName: 0 575 | metroWideTileShowName: 0 576 | metroSupportStreamingInstall: 0 577 | metroLastRequiredScene: 0 578 | metroDefaultTileSize: 1 579 | metroTileForegroundText: 2 580 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 581 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 582 | a: 1} 583 | metroSplashScreenUseBackgroundColor: 0 584 | platformCapabilities: {} 585 | metroTargetDeviceFamilies: {} 586 | metroFTAName: 587 | metroFTAFileTypes: [] 588 | metroProtocolName: 589 | XboxOneProductId: 590 | XboxOneUpdateKey: 591 | XboxOneSandboxId: 592 | XboxOneContentId: 593 | XboxOneTitleId: 594 | XboxOneSCId: 595 | XboxOneGameOsOverridePath: 596 | XboxOnePackagingOverridePath: 597 | XboxOneAppManifestOverridePath: 598 | XboxOneVersion: 1.0.0.0 599 | XboxOnePackageEncryption: 0 600 | XboxOnePackageUpdateGranularity: 2 601 | XboxOneDescription: 602 | XboxOneLanguage: 603 | - enus 604 | XboxOneCapability: [] 605 | XboxOneGameRating: {} 606 | XboxOneIsContentPackage: 0 607 | XboxOneEnableGPUVariability: 1 608 | XboxOneSockets: {} 609 | XboxOneSplashScreen: {fileID: 0} 610 | XboxOneAllowedProductIds: [] 611 | XboxOnePersistentLocalStorageSize: 0 612 | XboxOneXTitleMemory: 8 613 | XboxOneOverrideIdentityName: 614 | XboxOneOverrideIdentityPublisher: 615 | vrEditorSettings: 616 | daydream: 617 | daydreamIconForeground: {fileID: 0} 618 | daydreamIconBackground: {fileID: 0} 619 | cloudServicesEnabled: 620 | UNet: 1 621 | luminIcon: 622 | m_Name: 623 | m_ModelFolderPath: 624 | m_PortalFolderPath: 625 | luminCert: 626 | m_CertPath: 627 | m_SignPackage: 1 628 | luminIsChannelApp: 0 629 | luminVersion: 630 | m_VersionCode: 1 631 | m_VersionName: 632 | apiCompatibilityLevel: 6 633 | cloudProjectId: 634 | framebufferDepthMemorylessMode: 0 635 | projectName: 636 | organizationId: 637 | cloudEnabled: 0 638 | enableNativePlatformBackendsForNewInputSystem: 0 639 | disableOldInputManagerSupport: 0 640 | legacyClampBlendShapeWeights: 0 641 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.41f1 2 | m_EditorVersionWithRevision: 2020.3.41f1 (7c19dc9acfda) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 16 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 16 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 0 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 0 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 16 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 0 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 0 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 0 112 | billboardsFaceCameraPosition: 0 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 16 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 0 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 0 136 | antiAliasing: 0 137 | softParticles: 0 138 | softVegetation: 1 139 | realtimeReflectionProbes: 0 140 | billboardsFaceCameraPosition: 0 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 16 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 0 153 | shadowResolution: 0 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 0 164 | antiAliasing: 0 165 | softParticles: 0 166 | softVegetation: 1 167 | realtimeReflectionProbes: 0 168 | billboardsFaceCameraPosition: 0 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 16 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Stadia: 5 185 | Standalone: 5 186 | Tizen: 2 187 | WebGL: 3 188 | WiiU: 5 189 | Windows Store Apps: 5 190 | XboxOne: 5 191 | iPhone: 2 192 | tvOS: 2 193 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 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 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Easy Time Slicing 2 | 3 | EasyTimeSlicing makes it easy to slice heavy tasks into consequent game frames to execute and helps to keep the game running smoothly and avoid janks or spikes. 4 | 5 | ## Why time slicing 6 | 7 | There are often problems that have to execute a large number of tasks in a short period (like in a few frames), which, if not handled properly, can cause jank and reduce the performance of the game. 8 | 9 | Here's a common scenario that is to load some areas, including terrain, vegetation, buildings, and NPCs. We will test with two cases, first loading 3 areas and then 10 areas. 10 | 11 | Now we have the following codes: 12 | 13 | ```C# 14 | public IEnumerator LoadAreas1(List requestedAera) 15 | { 16 | foreach (var area in requestedAera) 17 | { 18 | AreaInfo info = GetAreaInfo(area); 19 | LoadTerrain(info); 20 | LoadVegetation(info); 21 | LoadBuildings(info); 22 | LoadNPC(info); 23 | yield return null; 24 | } 25 | } 26 | ``` 27 | 28 | Job completed in a few frames, and the profiler shows like this, jank and spikes are obvious: 29 | 30 | ![pic](./ScreenShots/pic_1_1_3.png) 31 | 32 | ![pic](./ScreenShots/pic_1_1_10.png) 33 | 34 | (The top image is for 3 aeras, and the bottom is for 10 areas) 35 | 36 | Now we try to spread the task over more frames: 37 | 38 | ```C# 39 | public IEnumerator LoadAreas2(List requestedAera) 40 | { 41 | foreach (var area in requestedAera) 42 | { 43 | AreaInfo info = GetAreaInfo(area); 44 | LoadTerrain(info); 45 | yield return null; 46 | LoadVegetation(info); 47 | yield return null; 48 | LoadBuildings(info); 49 | yield return null; 50 | LoadNPC(info); 51 | yield return null; 52 | } 53 | } 54 | ``` 55 | 56 | Now it's getting smooth, but the time per frame may be underused: 57 | 58 | ![pic](./ScreenShots/pic_1_2_3.png) 59 | 60 | ![pic](./ScreenShots/pic_1_2_10.png) 61 | 62 | (The top image is for 3 aeras, and the bottom is for 10 areas) 63 | 64 | Here comes your new choice, EasyTimeSlicing makes it easier to slice a task into separate frames and also make the most of those frames. 65 | 66 | ```C# 67 | public SliceableTask LoadAreas3(List requestedAera) 68 | { 69 | List tasks = new List(); 70 | foreach (var area in requestedAera) 71 | { 72 | AreaInfo info = GetAreaInfo(area); 73 | tasks.Add(() => LoadTerrain(info)); 74 | tasks.Add(() => LoadVegetation(info)); 75 | tasks.Add(() => LoadBuildings(info)); 76 | tasks.Add(() => LoadNPC(info)); 77 | } 78 | 79 | return new SliceableTask(0.010f, tasks); 80 | } 81 | ``` 82 | 83 | And the diagram: 84 | 85 | ![pic](./ScreenShots/pic_1_3_3.png) 86 | 87 | ![pic](./ScreenShots/pic_1_3_10.png) 88 | 89 | (The top image is for 3 aeras, and the bottom is for 10 areas) 90 | 91 | There are no big spikes, and the time per frame is better utilized. 92 | 93 | The following chart is a summary that compares the three solutions in each cases: 94 | 95 | | | frame count (3 areas) | longest frame (3 areas) | frame count (10 areas) | longest frame (10 areas) | 96 | | ---------- | --------------------- | ----------------------- | ---------------------- | ------------------------ | 97 | | LoadAreas1 | 3 | 23.81ms (42FPS) | 10 | 27.84ms (36FPS) | 98 | | LoadAreas2 | 12 | 12.75ms (78FPS) | 40 | 12.06ms (83FPS) | 99 | | LoadAreas3 | 7 | 11.92ms (84FPS) | 21 | 12.55ms (80FPS) | 100 | 101 | Another practical application is to reduce the jank caused by object instantiation, by spreading the instantiating tasks over multiple frames while limiting the maximum execution time in one frame. 102 | 103 | ```c# 104 | private void RunInstantiateTask() 105 | { 106 | // omitted code... 107 | new SliceableTask(executionTime, InstantiateItem2); 108 | } 109 | 110 | private IEnumerator InstantiateItem2() 111 | { 112 | // omitted code... 113 | int index = 0; 114 | 115 | while (index < total) 116 | { 117 | if (index < 0 || index >= total) 118 | { 119 | yield break; 120 | } 121 | 122 | // omitted code... 123 | GameObject go = Instantiate(prefab, this.transform); 124 | 125 | index++; 126 | 127 | yield return null; 128 | } 129 | } 130 | ``` 131 | 132 | ![pic](./ScreenShots/pic_2_2.gif) 133 | 134 | ## Installation 135 | 136 | Clone this repository and copy it to your project folder, or add `https://github.com/aillieo/EasyTimeSlicing.git#upm` as a dependency in the Package Manager window. 137 | 138 | ## Quick Start 139 | 140 | There are two ways to slice tasks: creating a single `SliceableTask` at once or adding tasks to a `SliceableTaskQueue`. Assume that you have functions named `Action0`, `Action1`, `Action2`..., and that's what you are trying to execute in several frames. 141 | 142 | ### Use single SliceableTask 143 | 144 | There are 4 methods to create a `SliceableTask`, use the constructor with different arguments. The max time for execution must be given. And the task will start to execute once constructed. 145 | 146 | 1. create with array or list of `Action`: 147 | 148 | ```c# 149 | SliceableTask task1 = new SliceableTask(0.01f, Action0, Action1, Action2); 150 | 151 | // or 152 | SliceableTask task2 = new SliceableTask(0.01f, new List 153 | { 154 | Action0, 155 | Action1, 156 | Action2 157 | }); 158 | ``` 159 | 160 | 2. with a state machine function: 161 | 162 | ```c# 163 | private bool StateMachineFunc(ref int state) 164 | { 165 | switch (state) 166 | { 167 | case 0: 168 | Action0(); 169 | state++; 170 | return false; 171 | case 1: 172 | Action1(); 173 | state++; 174 | return false; 175 | case 2: 176 | Action2(); 177 | state++; 178 | return true; 179 | } 180 | 181 | throw new Exception($"invalid state {state}"); 182 | } 183 | 184 | // then use it: 185 | SliceableTask task = new SliceableTask(0.01f, 0, StateMachineFunc); 186 | ``` 187 | 188 | 3. with another form of state machine function: 189 | 190 | ```c# 191 | private int state = 0; 192 | private bool StateMachineFunc() 193 | { 194 | switch (state) 195 | { 196 | case 0: 197 | Action0(); 198 | state++; 199 | return false; 200 | case 1: 201 | Action1(); 202 | state++; 203 | return false; 204 | case 2: 205 | Action2(); 206 | state++; 207 | return true; 208 | } 209 | 210 | throw new Exception($"invalid state {state}"); 211 | } 212 | 213 | // then use it: 214 | SliceableTask task = new SliceableTask(0.01f, StateMachineFunc); 215 | ``` 216 | 217 | 4. with a function containing enumerable logic: 218 | 219 | ```c# 220 | private IEnumerator EnumFunc() 221 | { 222 | Action0(); 223 | yield return null; 224 | Action1(); 225 | yield return null; 226 | Action2(); 227 | yield return null; 228 | } 229 | 230 | // then use it: 231 | SliceableTask task = new SliceableTask(0.01f, EnumFunc); 232 | ``` 233 | 234 | When trying to cancel a task: 235 | 236 | ```c# 237 | // SliceableTask task = ... 238 | task.Cancel(); 239 | ``` 240 | 241 | ### Use SliceableTaskQueue 242 | 243 | You can create a `SliceableTaskQueue` and add actions to it continuously. 244 | 245 | ```c# 246 | SliceableTaskQueue queue = new SliceableTaskQueue(0.003f); 247 | ``` 248 | 249 | Once you have a `SliceableTaskQueue`, you can add tasks and queue them up simply with desired priority. 250 | 251 | ```c# 252 | // SliceableTask task1 = ... 253 | queue.Enqueue(task1, SliceableTaskQueue.Priority.High); 254 | 255 | // or 256 | // SliceableTask task2 = ... 257 | var handle = queue.EnqueueWithHandle(task2, SliceableTaskQueue.Priority.High); 258 | ``` 259 | 260 | With a `Handle`, you can cancel a queued task when necessary. A queued task can be canceled only if it is not executed yet. 261 | 262 | ```c# 263 | handle.Cancel(); 264 | ``` 265 | -------------------------------------------------------------------------------- /ScreenShots/pic_1_1_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_1_10.png -------------------------------------------------------------------------------- /ScreenShots/pic_1_1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_1_3.png -------------------------------------------------------------------------------- /ScreenShots/pic_1_2_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_2_10.png -------------------------------------------------------------------------------- /ScreenShots/pic_1_2_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_2_3.png -------------------------------------------------------------------------------- /ScreenShots/pic_1_3_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_3_10.png -------------------------------------------------------------------------------- /ScreenShots/pic_1_3_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_1_3_3.png -------------------------------------------------------------------------------- /ScreenShots/pic_2_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aillieo/EasyTimeSlicing/4a0ae75c84ef36e650a31952251ea05e5f7220a8/ScreenShots/pic_2_2.gif -------------------------------------------------------------------------------- /stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", 3 | "settings": { 4 | "layoutRules": { 5 | "newlineAtEndOfFile": "require" 6 | }, 7 | "documentationRules": { 8 | "companyName": "AilleoTech" 9 | } 10 | } 11 | } 12 | --------------------------------------------------------------------------------