├── .gitattributes ├── .gitignore ├── Assets ├── Coroutines.meta ├── Coroutines │ ├── Coroutines.cs │ ├── Coroutines.cs.meta │ ├── WaitUntilAndForSecondsRealtime.cs │ ├── WaitUntilAndForSecondsRealtime.cs.meta │ ├── WaitUntilOrForSecondsRealtime.cs │ ├── WaitUntilOrForSecondsRealtime.cs.meta │ ├── WaitWhileAndForSecondsRealtime.cs │ ├── WaitWhileAndForSecondsRealtime.cs.meta │ ├── WaitWhileOrForSecondsRealtime.cs │ └── WaitWhileOrForSecondsRealtime.cs.meta ├── CustomBehaviour.cs ├── CustomBehaviour.cs.meta ├── GameObjectExtensions.cs ├── GameObjectExtensions.cs.meta ├── Misc.meta ├── Misc │ ├── Constants.cs │ ├── Constants.cs.meta │ ├── Enums.cs │ ├── Enums.cs.meta │ ├── Exceptions.cs │ └── Exceptions.cs.meta ├── MiscellaneousExtensions.cs ├── MiscellaneousExtensions.cs.meta ├── MovementExtensions.cs ├── MovementExtensions.cs.meta ├── NumeralExtensions.cs ├── NumeralExtensions.cs.meta ├── Patterns.meta ├── Patterns │ ├── Singletons.meta │ └── Singletons │ │ ├── Singleton.cs │ │ ├── Singleton.cs.meta │ │ ├── SingletonLazy.cs │ │ ├── SingletonLazy.cs.meta │ │ ├── SingletonPersistent.cs │ │ ├── SingletonPersistent.cs.meta │ │ ├── SingletonService.cs │ │ └── SingletonService.cs.meta ├── QuaternionExtensions.cs ├── QuaternionExtensions.cs.meta ├── UnityUtilities.asmdef ├── UnityUtilities.asmdef.meta ├── VectorExtensions.cs ├── VectorExtensions.cs.meta ├── package.json └── package.json.meta ├── LICENSE ├── LICENSE.meta ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md └── README.md.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Rider cache directory 30 | .idea/ 31 | 32 | # Gradle cache directory 33 | .gradle/ 34 | 35 | # Autogenerated VS/MD/Consulo solution and project files 36 | ExportedObj/ 37 | .consulo/ 38 | *.csproj 39 | *.unityproj 40 | *.sln 41 | *.suo 42 | *.tmp 43 | *.user 44 | *.userprefs 45 | *.pidb 46 | *.booproj 47 | *.svd 48 | *.pdb 49 | *.mdb 50 | *.opendb 51 | *.VC.db 52 | 53 | # Unity3D generated meta files 54 | *.pidb.meta 55 | *.pdb.meta 56 | *.mdb.meta 57 | 58 | # Unity3D generated file on crash reports 59 | sysinfo.txt 60 | 61 | # Builds 62 | *.apk 63 | *.aab 64 | *.unitypackage 65 | *.app 66 | 67 | # Crashlytics generated file 68 | crashlytics-build.properties 69 | 70 | # Packed Addressables 71 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 72 | 73 | # Temporary auto-generated Android Assets 74 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 75 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /Assets/Coroutines.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5d682bba5f84389a2103f2d36e5d7a8 3 | timeCreated: 1645713805 -------------------------------------------------------------------------------- /Assets/Coroutines/Coroutines.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | 5 | namespace Extensions 6 | { 7 | public class Coroutines 8 | { 9 | /// 10 | /// Delays action by specified number of seconds. 11 | /// to piggyback the from. 12 | /// Action to call after delay. 13 | /// How many realtime seconds will be waiting. 14 | /// 15 | public static Coroutine DelayAction(MonoBehaviour monoBehaviour, Action delayedAction, float timeInSec) 16 | { 17 | IEnumerator DelayActionRoutine() 18 | { 19 | yield return new WaitForSecondsRealtime(timeInSec); 20 | 21 | delayedAction.Invoke(); 22 | } 23 | 24 | return monoBehaviour.StartCoroutine(DelayActionRoutine()); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Coroutines/Coroutines.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c66bf2e04d794ce3a887cf409902e9a8 3 | timeCreated: 1645717391 -------------------------------------------------------------------------------- /Assets/Coroutines/WaitUntilAndForSecondsRealtime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityUtilities.Extensions 5 | { 6 | /// 7 | /// Suspends the coroutine execution for the given amount of seconds using unscaled time and until the passed condition is true. 8 | /// 9 | public class WaitUntilAndForSecondsRealtime : CustomYieldInstruction 10 | { 11 | public WaitForSecondsRealtime WaitForSecondsRealtime { get; } 12 | public WaitUntil WaitUntil { get; } 13 | 14 | public override bool keepWaiting => WaitForSecondsRealtime.keepWaiting || WaitUntil.keepWaiting; 15 | 16 | public WaitUntilAndForSecondsRealtime(WaitUntil waitUntil, WaitForSecondsRealtime waitForSecondsRealtime) 17 | { 18 | WaitUntil = waitUntil; 19 | WaitForSecondsRealtime = waitForSecondsRealtime; 20 | } 21 | 22 | public WaitUntilAndForSecondsRealtime(Func waitUntilPredicate, float waitForSecondsRealtimeTime) : this(new WaitUntil(waitUntilPredicate), new WaitForSecondsRealtime(waitForSecondsRealtimeTime)){} 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Coroutines/WaitUntilAndForSecondsRealtime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da45336924ca4b51aaad434805ee2f1a 3 | timeCreated: 1645713818 -------------------------------------------------------------------------------- /Assets/Coroutines/WaitUntilOrForSecondsRealtime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityUtilities.Extensions 5 | { 6 | /// 7 | /// Suspends the coroutine execution for the given amount of seconds using unscaled time or until the passed condition is true. 8 | /// 9 | public class WaitUntilOrForSecondsRealtime : CustomYieldInstruction 10 | { 11 | public WaitForSecondsRealtime WaitForSecondsRealtime { get; } 12 | public WaitUntil WaitUntil { get; } 13 | 14 | public override bool keepWaiting => WaitForSecondsRealtime.keepWaiting && WaitUntil.keepWaiting; 15 | 16 | public WaitUntilOrForSecondsRealtime(WaitUntil waitUntil, WaitForSecondsRealtime waitForSecondsRealtime) 17 | { 18 | WaitUntil = waitUntil; 19 | WaitForSecondsRealtime = waitForSecondsRealtime; 20 | } 21 | 22 | public WaitUntilOrForSecondsRealtime(Func waitUntilPredicate, float waitForSecondsRealtimeTime) : this(new WaitUntil(waitUntilPredicate), new WaitForSecondsRealtime(waitForSecondsRealtimeTime)){} 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Coroutines/WaitUntilOrForSecondsRealtime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3bb933147164745bc9cf06e57f792f0 3 | timeCreated: 1645713818 -------------------------------------------------------------------------------- /Assets/Coroutines/WaitWhileAndForSecondsRealtime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | using UnityEngine; 4 | 5 | namespace UnityUtilities.Extensions 6 | { 7 | /// 8 | /// Suspends the coroutine execution for the given amount of seconds using unscaled time and while the passed condition is true. 9 | /// 10 | public class WaitWhileAndForSecondsRealtime : CustomYieldInstruction 11 | { 12 | public WaitForSecondsRealtime WaitForSecondsRealtime { get; } 13 | public WaitWhile WaitWhile { get; } 14 | 15 | public override bool keepWaiting => WaitForSecondsRealtime.keepWaiting || WaitWhile.keepWaiting; 16 | 17 | public WaitWhileAndForSecondsRealtime(WaitWhile waitWhile, WaitForSecondsRealtime waitForSecondsRealtime) 18 | { 19 | WaitWhile = waitWhile; 20 | WaitForSecondsRealtime = waitForSecondsRealtime; 21 | } 22 | 23 | public WaitWhileAndForSecondsRealtime(Func waitWhilePredicate, float waitForSecondsRealtimeTime) : this(new WaitWhile(waitWhilePredicate), new WaitForSecondsRealtime(waitForSecondsRealtimeTime)){} 24 | } 25 | } -------------------------------------------------------------------------------- /Assets/Coroutines/WaitWhileAndForSecondsRealtime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3578c7e721af404fb195fc3ccee3ad97 3 | timeCreated: 1645713818 -------------------------------------------------------------------------------- /Assets/Coroutines/WaitWhileOrForSecondsRealtime.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UnityUtilities.Extensions 5 | { 6 | /// 7 | /// Suspends the coroutine execution for the given amount of seconds using unscaled time or while the passed condition is true. 8 | /// 9 | public class WaitWhileOrForSecondsRealtime : CustomYieldInstruction 10 | { 11 | public WaitForSecondsRealtime WaitForSecondsRealtime { get; } 12 | public WaitWhile WaitWhile { get; } 13 | 14 | public override bool keepWaiting => WaitForSecondsRealtime.keepWaiting && WaitWhile.keepWaiting; 15 | 16 | public WaitWhileOrForSecondsRealtime(WaitWhile waitWhile, WaitForSecondsRealtime waitForSecondsRealtime) 17 | { 18 | WaitWhile = waitWhile; 19 | WaitForSecondsRealtime = waitForSecondsRealtime; 20 | } 21 | 22 | public WaitWhileOrForSecondsRealtime(Func waitWhilePredicate, float waitForSecondsRealtimeTime) : this(new WaitWhile(waitWhilePredicate), new WaitForSecondsRealtime(waitForSecondsRealtimeTime)){} 23 | } 24 | } -------------------------------------------------------------------------------- /Assets/Coroutines/WaitWhileOrForSecondsRealtime.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4257c3b82ecb4fd59e0e537a87ad3240 3 | timeCreated: 1645713818 -------------------------------------------------------------------------------- /Assets/CustomBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions 4 | { 5 | /// 6 | /// A custom MonoBehaviour, extending the basic MonoBehaviour. 7 | /// 8 | public class CustomBehaviour : MonoBehaviour 9 | { 10 | /// 11 | /// Logs a message to the console with the object's name. 12 | /// 13 | /// Message to be logged. 14 | public void Log(object message) => Debug.Log(GetType().Name + $": {message}"); 15 | 16 | /// 17 | /// Logs a message to the console with the object's name. 18 | /// 19 | /// Object calling the logger. 20 | /// Message to be logged. 21 | public static void Log(object caller, object message) => Debug.Log(caller.GetType().Name + $": {message}"); 22 | 23 | /// 24 | /// Logs a warning to the console with the object's name. 25 | /// 26 | /// Message to be logged. 27 | public void LogWarning(object message) => Debug.LogWarning(GetType().Name + $": {message}"); 28 | 29 | /// 30 | /// Logs a warning to the console with the object's name. 31 | /// 32 | /// Object calling the logger. 33 | /// Message to be logged. 34 | public static void LogWarning(object caller, object message) => Debug.LogWarning(caller.GetType().Name + $": {message}"); 35 | 36 | /// 37 | /// Logs an error to the console with the object's name. 38 | /// 39 | /// Message to be logged. 40 | public void LogError(object message) => Debug.LogError(GetType().Name + $": {message}"); 41 | 42 | /// 43 | /// Logs an error to the console with the object's name. 44 | /// 45 | /// Object calling the logger. 46 | /// Message to be logged. 47 | public static void LogError(object caller, object message) => Debug.LogError(caller.GetType().Name + $": {message}"); 48 | } 49 | } -------------------------------------------------------------------------------- /Assets/CustomBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9da9e384661f4fb5922b61ab15dbb106 3 | timeCreated: 1652966869 -------------------------------------------------------------------------------- /Assets/GameObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | 6 | namespace UnityUtilities.Extensions 7 | { 8 | public static class GameObjectExtensions 9 | { 10 | /// 11 | /// More elegant way of writing Destroy(gameObject). 12 | /// 13 | public static void Destroy(this GameObject go) 14 | { 15 | Object.Destroy(go); 16 | } 17 | 18 | /// 19 | /// More elegant way of writing DestroyImmediate(gameObject). 20 | /// For use in the Editor only! 21 | /// 22 | public static void DestroyImmediate(this GameObject go) 23 | { 24 | Object.DestroyImmediate(go); 25 | } 26 | 27 | /// 28 | /// Checks if the animator is currently playing an animation. 29 | /// See this Unity Forum post for more information. 30 | /// 31 | /// Animator to be checked. 32 | /// True if it's playing; false otherwise. 33 | public static bool IsAnimatorPlaying(this Animator animator) 34 | { 35 | return animator.GetCurrentAnimatorStateInfo(0).length > 36 | animator.GetCurrentAnimatorStateInfo(0).normalizedTime; 37 | } 38 | 39 | /// 40 | /// Writes the object to the Debug Console. 41 | /// 42 | /// Object to be logged. 43 | /// Type of log. 44 | /// 45 | public static void Print(this object msg, LogType type = LogType.Log) 46 | { 47 | switch (type) 48 | { 49 | case LogType.Log: 50 | Debug.Log(msg); 51 | break; 52 | case LogType.Warning: 53 | Debug.LogWarning(msg); 54 | break; 55 | case LogType.Exception: 56 | case LogType.Error: 57 | Debug.LogError(msg); 58 | break; 59 | case LogType.Assert: 60 | Debug.LogAssertion(msg); 61 | break; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /Assets/GameObjectExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a7840a820fa6654f8ef1024fa27f7f1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c00c46cd3a42ced41b23768b12f8b8a8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Misc/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace UnityUtilities.Misc 2 | { 3 | public static class Constants 4 | { 5 | /// 6 | /// Radius of the Earth in meters. 7 | /// 8 | public static float EarthRadius = 6376500; 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Misc/Constants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b64dae8a150df8a4d84b543f80bf84e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Misc/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace UnityUtilities 2 | { 3 | public enum UnitType 4 | { 5 | Deg, 6 | Rad 7 | } 8 | } -------------------------------------------------------------------------------- /Assets/Misc/Enums.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b16886db2372794fa4151dd83ca9aa4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Misc/Exceptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace UnityUtilities.Exceptions 4 | { 5 | public class InvalidTypeException : Exception 6 | { 7 | public InvalidTypeException() {} 8 | 9 | public InvalidTypeException(string received):base($"Invalid type, received: {received}") {} 10 | } 11 | } -------------------------------------------------------------------------------- /Assets/Misc/Exceptions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79ed82097bcda3f40ba39f1f95dd4b97 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MiscellaneousExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityUtilities.Misc; 3 | 4 | namespace UnityUtilities.Extensions 5 | { 6 | public static class MiscellaneousExtensions 7 | { 8 | /// 9 | /// Flips a 2-big float array, so that the values swap indexes. 10 | /// 11 | /// 12 | /// Flipped array 13 | public static float[] Flip(this float[] array) 14 | { 15 | if (array.Length != 2) return array; 16 | 17 | return new []{array[1], array[0]}; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/MiscellaneousExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fcb45dbd38931240a74e4353519e6af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MovementExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions 4 | { 5 | public static class MovementExtensions 6 | { 7 | /// 8 | /// Smoothly makes the Rigidbody2D follow the current mouse position. 9 | /// Should be used in FixedUpdate (recommended). 10 | /// Follow speed. 11 | /// Turning speed. 12 | /// 13 | public static void FollowMouse2D(this Rigidbody2D rb, float speed = 5f, float rotateSpeed = 200f) 14 | { 15 | // Homing behaviour from: https://github.com/Brackeys/Homing-Missile/blob/master/Homing%20Missile/Assets/HomingMissile.cs 16 | 17 | var direction = (Vector2) Camera.current.ScreenToWorldPoint(Input.mousePosition) - rb.position; 18 | 19 | var localUp = rb.transform.up; 20 | 21 | direction.Normalize(); 22 | 23 | var rotateAmount = Vector3.Cross(direction, localUp).z; 24 | 25 | rb.angularVelocity = -rotateAmount * rotateSpeed; 26 | 27 | rb.velocity = localUp * speed; 28 | } 29 | 30 | /// 31 | /// Smoothly makes the Rigidbody2D follow the specified GameObject. 32 | /// Should be used in FixedUpdate (recommended). 33 | /// GameObject to follow. 34 | /// Follow speed. 35 | /// Turning speed. 36 | /// 37 | public static void FollowObject2D(this Rigidbody2D rb, GameObject go, float speed = 5f, 38 | float rotateSpeed = 200f) 39 | { 40 | // Homing behaviour from: https://github.com/Brackeys/Homing-Missile/blob/master/Homing%20Missile/Assets/HomingMissile.cs 41 | 42 | var direction = (Vector2) go.transform.position - rb.position; 43 | 44 | var localUp = rb.transform.up; 45 | 46 | direction.Normalize(); 47 | 48 | var rotateAmount = Vector3.Cross(direction, localUp).z; 49 | 50 | rb.angularVelocity = -rotateAmount * rotateSpeed; 51 | 52 | rb.velocity = localUp * speed; 53 | } 54 | 55 | /// 56 | /// Smoothly makes the Rigidbody2D follow the specified transform. 57 | /// Should be used in FixedUpdate (recommended). 58 | /// Transform to follow. 59 | /// Follow speed. 60 | /// Turning speed. 61 | /// 62 | public static void FollowObject2D(this Rigidbody2D rb, Transform trans, float speed = 5f, 63 | float rotateSpeed = 200f) 64 | { 65 | // Homing behaviour from: https://github.com/Brackeys/Homing-Missile/blob/master/Homing%20Missile/Assets/HomingMissile.cs 66 | 67 | var direction = (Vector2) trans.position - rb.position; 68 | 69 | var localUp = rb.transform.up; 70 | 71 | direction.Normalize(); 72 | 73 | var rotateAmount = Vector3.Cross(direction, localUp).z; 74 | 75 | rb.angularVelocity = -rotateAmount * rotateSpeed; 76 | 77 | rb.velocity = localUp * speed; 78 | } 79 | 80 | /// 81 | /// Smoothly translates the GameObject up. 82 | /// Speed of translation. 83 | /// 84 | public static void GoUp(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 85 | { 86 | go.transform.Translate(Vector3.up * Time.deltaTime * speed, relativeTo); 87 | } 88 | 89 | /// 90 | /// Smoothly translates the GameObject down. 91 | /// Speed of translation. 92 | /// 93 | public static void GoDown(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 94 | { 95 | go.transform.Translate(Vector3.down * Time.deltaTime * speed, Space.World); 96 | } 97 | 98 | /// 99 | /// Smoothly translates the GameObject left. 100 | /// Speed of translation. 101 | /// 102 | public static void GoLeft(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 103 | { 104 | go.transform.Translate(Vector3.left * Time.deltaTime * speed, relativeTo); 105 | } 106 | 107 | /// 108 | /// Smoothly translates the GameObject right. 109 | /// Speed of translation. 110 | /// 111 | public static void GoRight(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 112 | { 113 | go.transform.Translate(Vector3.right * Time.deltaTime * speed, relativeTo); 114 | } 115 | 116 | /// 117 | /// Smoothly translates the GameObject forwards. 118 | /// Speed of translation. 119 | /// 120 | public static void GoForward(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 121 | { 122 | go.transform.Translate(Vector3.forward * Time.deltaTime * speed, relativeTo); 123 | } 124 | 125 | /// 126 | /// Smoothly translates the GameObject backwards. 127 | /// Speed of translation. 128 | /// 129 | public static void GoBackward(this GameObject go, float speed = 1f, Space relativeTo = Space.World) 130 | { 131 | go.transform.Translate(Vector3.back * Time.deltaTime * speed, relativeTo); 132 | } 133 | 134 | /// 135 | /// Smoothly translates the Transform up. 136 | /// Speed of translation. 137 | /// 138 | public static void GoUp(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 139 | { 140 | trans.Translate(Vector3.up * Time.deltaTime * speed, relativeTo); 141 | } 142 | 143 | /// 144 | /// Smoothly translates the Transform down. 145 | /// Speed of translation. 146 | /// 147 | public static void GoDown(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 148 | { 149 | trans.transform.Translate(Vector3.down * Time.deltaTime * speed, relativeTo); 150 | } 151 | 152 | /// 153 | /// Smoothly translates the Transform left. 154 | /// Speed of translation. 155 | /// 156 | public static void GoLeft(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 157 | { 158 | trans.transform.Translate(Vector3.left * Time.deltaTime * speed, relativeTo); 159 | } 160 | 161 | /// 162 | /// Smoothly translates the Transform right. 163 | /// Speed of translation. 164 | /// 165 | public static void GoRight(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 166 | { 167 | trans.transform.Translate(Vector3.right * Time.deltaTime * speed, relativeTo); 168 | } 169 | 170 | /// 171 | /// Smoothly translates the Transform forwards. 172 | /// Speed of translation. 173 | /// 174 | public static void GoForward(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 175 | { 176 | trans.transform.Translate(Vector3.forward * Time.deltaTime * speed, relativeTo); 177 | } 178 | 179 | /// 180 | /// Smoothly translates the Transform backwards. 181 | /// Speed of translation. 182 | /// 183 | public static void GoBackward(this Transform trans, float speed = 1f, Space relativeTo = Space.World) 184 | { 185 | trans.transform.Translate(Vector3.back * Time.deltaTime * speed, relativeTo); 186 | } 187 | } 188 | } -------------------------------------------------------------------------------- /Assets/MovementExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dad5a6589e50a0c43bfd1e49ec20e34d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/NumeralExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions 4 | { 5 | public static class NumeralExtensions 6 | { 7 | /// 8 | /// Rounds float and returns float. Use this if the number of decimals don't matter and you want to minimize overhead. 9 | /// 10 | /// 11 | /// Rounded float 12 | public static float Round(this float numb) 13 | { 14 | return Mathf.Round(numb); 15 | } 16 | 17 | /// 18 | /// Rounds float and returns float according to the number of decimal places supplied. 19 | /// 20 | /// 21 | /// Number of decimals after the period. 22 | /// Rounded float 23 | public static float Round(this float numb, int decimalPlaces) 24 | { 25 | var multiplier = 1f; 26 | for (var i = 0; i < decimalPlaces; i++) multiplier *= 10f; 27 | return Mathf.Round(numb * multiplier) / multiplier; 28 | } 29 | 30 | /// 31 | /// Rounds float and returns int. 32 | /// 33 | /// 34 | /// 35 | public static int RoundToInt(this float numb) 36 | { 37 | return Mathf.RoundToInt(numb); 38 | } 39 | 40 | /// 41 | /// Clamps float between provided values. 42 | /// 43 | /// 44 | /// Lower bound. 45 | /// Upper bound. 46 | /// Clamped float 47 | public static float Clamp(this float numb, float min, float max) 48 | { 49 | return Mathf.Clamp(numb, min, max); 50 | } 51 | 52 | /// 53 | /// Clamps float between 0 and 1. 54 | /// 55 | /// 56 | /// Clamped float 57 | public static float Clamp(this float numb) 58 | { 59 | return Mathf.Clamp01(numb); 60 | } 61 | 62 | /// 63 | /// Returns the absolute value. 64 | /// 65 | /// 66 | /// Absolute value 67 | public static float Abs(this float numb) 68 | { 69 | return Mathf.Abs(numb); 70 | } 71 | 72 | /// 73 | /// Returns the absolute value. 74 | /// 75 | /// 76 | /// Absolute value 77 | public static int Abs(this int numb) 78 | { 79 | return Mathf.Abs(numb); 80 | } 81 | 82 | /// 83 | /// Maps the supplied value and range to the desired range for (floats).
84 | /// Returns -1 if supplied value is out of supplied range.
85 | /// Exact function from here. 86 | ///
87 | /// 88 | /// Start of range of supplied value. 89 | /// End of range of supplied value. 90 | /// Start of desired range. 91 | /// End of desired range. 92 | /// 93 | public static float Map (this float value, float from1, float to1, float from2, float to2) 94 | { 95 | return (value - from1) / (to1 - from1) * (to2 - from2) + from2; 96 | } 97 | 98 | /// 99 | /// Maps the supplied value and range to the desired range (for ints).
100 | /// Returns -1 if supplied value is out of supplied range.
101 | /// Exact function from here. 102 | ///
103 | /// 104 | /// Start of range of supplied value. 105 | /// End of range of supplied value. 106 | /// Start of desired range. 107 | /// End of desired range. 108 | /// 109 | public static int Map (this int value, int from1, int to1, int from2, int to2) 110 | { 111 | return (value - from1) / (to1 - from1) * (to2 - from2) + from2; 112 | } 113 | } 114 | } -------------------------------------------------------------------------------- /Assets/NumeralExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04da6f7bcd8bd5a439c4f2951eb97fe0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Patterns.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42590ce9ac4bcc54bac69cecf96c4b7c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Patterns/Singletons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de56b0a4923a06946ae39bc0f75c516e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/Singleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions.Patterns 4 | { 5 | /// 6 | /// Generic singleton class, made for MonoBehaviours. 7 | /// If is null, this object is assigned; if it's not equal to this object, destroy this object. Does not survive scene loading and if does not exist, won't be created! 8 | /// 9 | /// Inheriting classes must call base.Awake() if overriding Awake! 10 | /// Type. 11 | public abstract class Singleton : CustomBehaviour where T : CustomBehaviour 12 | { 13 | /// 14 | /// Static instance. 15 | /// 16 | public static T Instance { get; private set;} 17 | 18 | protected virtual void Awake() 19 | { 20 | if ( Instance == null) 21 | { 22 | Instance = this as T; 23 | } 24 | else if (Instance != this as T) 25 | { 26 | gameObject.Destroy(); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8bdb935940455e54d9eb55db8d5f5d3f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonLazy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions.Patterns 4 | { 5 | /// 6 | /// Generic lazy singleton class, made for MonoBehaviours. 7 | /// Survives scene loading and if is invalid, then will be created! 8 | /// 9 | /// Inheriting classes must call base.Awake() if overriding Awake! 10 | /// Type. 11 | public abstract class SingletonLazy : CustomBehaviour where T : CustomBehaviour 12 | { 13 | /// 14 | /// Static instance. 15 | /// 16 | public static T Instance 17 | { 18 | get 19 | { 20 | if (_instance == null) 21 | { 22 | _instance = Instantiate( new GameObject(nameof(T)).AddComponent(), Vector3.zero, Quaternion.identity); 23 | } 24 | 25 | return _instance; 26 | } 27 | } 28 | 29 | private static T _instance; 30 | 31 | protected virtual void Awake() 32 | { 33 | if (_instance != this as T) 34 | { 35 | gameObject.Destroy(); 36 | } 37 | else 38 | { 39 | DontDestroyOnLoad(this as T); 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonLazy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 313a27d04156c6d4484500744135d278 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonPersistent.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityUtilities.Extensions.Patterns 4 | { 5 | /// 6 | /// Generic persistent singleton class, made for MonoBehaviours. 7 | /// If is null, this object is assigned; if it's not equal to this object, destroy this object. Survives scene loading, but if does not exist, won't be created! 8 | /// 9 | /// Inheriting classes must call base.Awake() if overriding Awake! 10 | /// Type. 11 | public abstract class SingletonPersistent : CustomBehaviour where T : CustomBehaviour 12 | { 13 | /// 14 | /// Static instance. 15 | /// 16 | public static T Instance { get; private set; } 17 | 18 | protected virtual void Awake() 19 | { 20 | if ( Instance == null) 21 | { 22 | Instance = this as T; 23 | DontDestroyOnLoad(this as T); 24 | } 25 | else if (Instance != this as T) 26 | { 27 | gameObject.Destroy(); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonPersistent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9f5831cbc814f543aa12bdbb637964d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonService.cs: -------------------------------------------------------------------------------- 1 | namespace UnityUtilities.Extensions.Patterns 2 | { 3 | /// 4 | /// Generic singleton-style class, for public parameterless constructor's classes. 5 | /// A C# only singleton (does not interact with Unity), mainly used for services. 6 | /// When inheriting, create static methods to interact with the service; keep all properties and variables as private, non-static and fetch them from ! See example and link below for more info: 7 | /// 8 | /// 10 | /// { 11 | /// private int _number = 23 12 | /// public ServiceOne() { } 13 | /// public static int GetSomething() 14 | /// { 15 | /// return Instance._number; 16 | /// } 17 | /// }]]> 18 | /// 19 | /// Check out this Unity Forum post! 20 | /// 21 | /// Type. 22 | public abstract class SingletonService where T: new() 23 | { 24 | /// 25 | /// Static instance. 26 | /// 27 | protected static T Instance => _backingInstance ??= new T(); 28 | private static T _backingInstance; 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Patterns/Singletons/SingletonService.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbbb92057741bc34e92c297f85becbda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/QuaternionExtensions.cs: -------------------------------------------------------------------------------- 1 | // Methods come from this very helpful post: https://forum.unity.com/threads/average-quaternions.86898/ 2 | 3 | using UnityEngine; 4 | 5 | namespace UnityUtilities.Extensions 6 | { 7 | 8 | public static class QuaternionExtensions 9 | { 10 | /// 11 | /// Get an average (mean) from more than two quaternions (with two, slerp would be used). 12 | /// 13 | /// 14 | /// This only works if all the quaternions are relatively close together. 15 | /// 16 | /// External Vector4 which holds all the added x, y, z and w components. 17 | /// Next rotation to be added to the average pool. 18 | /// First quaternion of the array to be averaged. 19 | /// Total amount of quaternions which are currently added. 20 | /// Current average quaternion 21 | public static Quaternion AverageQuaternions(ref Vector4 cumulative, Quaternion newRotation, Quaternion firstRotation, int addAmount) 22 | { 23 | //Before we add the new rotation to the average (mean), we have to check whether the quaternion has to be inverted. Because 24 | //q and -q are the same rotation, but cannot be averaged, we have to make sure they are all the same. 25 | if (!newRotation.IsClose(firstRotation)) newRotation.InverseSign(); 26 | 27 | var avgQ = new Quaternion(); 28 | 29 | //Average the values 30 | var addDet = 1f / addAmount; 31 | cumulative.w += newRotation.w; 32 | avgQ.w = cumulative.w * addDet; 33 | cumulative.x += newRotation.x; 34 | avgQ.x = cumulative.x * addDet; 35 | cumulative.y += newRotation.y; 36 | avgQ.y = cumulative.y * addDet; 37 | cumulative.z += newRotation.z; 38 | avgQ.z = cumulative.z * addDet; 39 | 40 | //note: if speed is an issue, you can skip the normalization step. it's to make sure they're normalized, even if they should be! 41 | //see this: https://gamedev.net/forums/topic/429146-why-normalize-quaternions/3854543/ for more information. 42 | avgQ.Normalize(); 43 | 44 | return avgQ; 45 | } 46 | 47 | /// 48 | /// Get an average (mean) from more than two quaternions (with two, slerp would be used). It's the method's fast version, as it does not normalize the result. 49 | /// 50 | /// 51 | /// This only works if all the quaternions are relatively close together. 52 | /// 53 | /// External Vector4 which holds all the added x, y, z and w components. 54 | /// Next rotation to be added to the average pool. 55 | /// First quaternion of the array to be averaged. 56 | /// Total amount of quaternions which are currently added. 57 | /// Current average quaternion 58 | public static Quaternion AverageQuaternionsFast(ref Vector4 cumulative, Quaternion newRotation, Quaternion firstRotation, int addAmount) 59 | { 60 | //Before we add the new rotation to the average (mean), we have to check whether the quaternion has to be inverted. Because 61 | //q and -q are the same rotation, but cannot be averaged, we have to make sure they are all the same. 62 | if (!newRotation.IsClose(firstRotation)) newRotation.InverseSign(); 63 | 64 | //Average the values 65 | var avgQ = new Quaternion(); 66 | 67 | //Average the values 68 | var addDet = 1f / addAmount; 69 | cumulative.w += newRotation.w; 70 | avgQ.w = cumulative.w * addDet; 71 | cumulative.x += newRotation.x; 72 | avgQ.x = cumulative.x * addDet; 73 | cumulative.y += newRotation.y; 74 | avgQ.y = cumulative.y * addDet; 75 | cumulative.z += newRotation.z; 76 | avgQ.z = cumulative.z * addDet; 77 | 78 | return avgQ; 79 | } 80 | 81 | /// 82 | /// Normalizes a quaternion. 83 | /// 84 | /// Quaternion to be normalized. 85 | /// Normalized quaternion. 86 | public static void Normalize(this ref Quaternion q) 87 | { 88 | q = Quaternion.Normalize(q); 89 | } 90 | 91 | /// 92 | /// Inverses the quaternion. 93 | /// 94 | /// Quaternion to inverse 95 | public static void Inverse(this ref Quaternion q) 96 | { 97 | q = Quaternion.Inverse(q); 98 | } 99 | 100 | /// 101 | /// Changes the sign of the quaternion components. This is not the same as the inverse. 102 | /// 103 | /// Quaternion to inverse 104 | public static void InverseSign(this ref Quaternion q) 105 | { 106 | q = new Quaternion(-q.x, -q.y, -q.z, -q.w); 107 | } 108 | 109 | 110 | /// 111 | /// Can be used to check whether or not one of two quaternions which are supposed to be very similar but has its component signs reversed (q has the same rotation as -q). 112 | /// 113 | /// First quaternion to check. 114 | /// Second quaternion to check. 115 | /// True if the two input quaternions are close to each other 116 | public static bool IsClose(this Quaternion q1, Quaternion q2) 117 | { 118 | var dot = Quaternion.Dot(q1, q2); 119 | 120 | if (dot < 0.0f) 121 | return false; 122 | else 123 | return true; 124 | } 125 | 126 | /// 127 | /// Multiplies this quaternion with the given scalar. 128 | /// 129 | /// Quaternion to scale. 130 | /// Scalar to use. 131 | public static void Scale(this ref Quaternion q, float amount) 132 | { 133 | q.w *= amount; 134 | q.x *= amount; 135 | q.y *= amount; 136 | q.z *= amount; 137 | } 138 | } 139 | } -------------------------------------------------------------------------------- /Assets/QuaternionExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99ad9da66325462f8f405631a2242bd5 3 | timeCreated: 1650997054 -------------------------------------------------------------------------------- /Assets/UnityUtilities.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityUtilities", 3 | "rootNamespace": "UnityUtilities", 4 | "references": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [], 12 | "versionDefines": [], 13 | "noEngineReferences": false 14 | } -------------------------------------------------------------------------------- /Assets/UnityUtilities.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47f59f2c35a24290ac36241f14f5b6d4 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/VectorExtensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityUtilities.Misc; 3 | 4 | namespace UnityUtilities.Extensions 5 | { 6 | public static class VectorExtensions 7 | { 8 | /// 9 | /// Rounds Vector3. 10 | /// 11 | /// 12 | /// Rounded Vector3Int 13 | public static Vector3Int RoundToInt(this Vector3 vector3) 14 | { 15 | return new Vector3Int( 16 | vector3.x.RoundToInt(), 17 | vector3.y.RoundToInt(), 18 | vector3.z.RoundToInt()); 19 | } 20 | 21 | /// 22 | /// Rounds Vector3 to the specified number of decimals. 23 | /// 24 | /// 25 | /// 26 | /// Rounded Vector3 27 | public static Vector3 Round(this Vector3 vector3, int decimalPlaces = 0) 28 | { 29 | float multiplier = 1; 30 | for (var i = 0; i < decimalPlaces; i++) multiplier *= 10f; 31 | return new Vector3( 32 | Mathf.Round(vector3.x * multiplier) / multiplier, 33 | Mathf.Round(vector3.y * multiplier) / multiplier, 34 | Mathf.Round(vector3.z * multiplier) / multiplier); 35 | } 36 | 37 | /// 38 | /// Clamps Vector3 components between 0 and 1. 39 | /// 40 | /// 41 | /// Clamped Vector3 42 | public static Vector3 Clamp(this Vector3 vector3) 43 | { 44 | return new Vector3( 45 | Mathf.Clamp01(vector3.x), 46 | Mathf.Clamp01(vector3.y), 47 | Mathf.Clamp01(vector3.z)); 48 | } 49 | 50 | /// 51 | /// Clamps Vector3 components between provided values. 52 | /// 53 | /// 54 | /// 55 | /// 56 | /// Clamped Vector3 57 | public static Vector3 Clamp(this Vector3 vector3, float min, float max) 58 | { 59 | return new Vector3( 60 | Mathf.Clamp(vector3.x, min, max), 61 | Mathf.Clamp(vector3.y, min, max), 62 | Mathf.Clamp(vector3.z, min, max)); 63 | } 64 | 65 | /// 66 | /// Rounds Vector2. 67 | /// 68 | /// 69 | /// Vector2Int 70 | public static Vector2Int RoundToInt(this Vector2 vector2) 71 | { 72 | return new Vector2Int( 73 | vector2.x.RoundToInt(), 74 | vector2.y.RoundToInt()); 75 | } 76 | 77 | /// 78 | /// Rounds Vector2 to the specified number of decimals. 79 | /// 80 | /// 81 | /// 82 | /// Rounded Vector2 83 | public static Vector2 Round(this Vector2 vector2, int decimalPlaces = 0) 84 | { 85 | var multiplier = 1f; 86 | for (var i = 0; i < decimalPlaces; i++) multiplier *= 10f; 87 | return new Vector2( 88 | Mathf.Round(vector2.x * multiplier) / multiplier, 89 | Mathf.Round(vector2.y * multiplier) / multiplier); 90 | } 91 | 92 | /// 93 | /// Clamps Vector2 components between provided values. 94 | /// 95 | /// 96 | /// 97 | /// 98 | /// Clamped Vector2 99 | public static Vector2 Clamp(this Vector2 vector2, float min, float max) 100 | { 101 | return new Vector2( 102 | Mathf.Clamp(vector2.x, min, max), 103 | Mathf.Clamp(vector2.y, min, max)); 104 | } 105 | 106 | /// 107 | /// Transforms a Vector2 to a 2-big float array. 108 | /// 109 | /// 110 | /// Array from Vector2 111 | public static float[] ToArray(this Vector2 vector2) 112 | { 113 | return new []{vector2.x, vector2.y}; 114 | } 115 | 116 | /// 117 | /// Transforms a Vector3 to a 3-big float array. 118 | /// 119 | /// 120 | /// Array from Vector3 121 | public static float[] ToArray(this Vector3 vector3) 122 | { 123 | return new []{vector3.x, vector3.y, vector3.z}; 124 | } 125 | 126 | /// 127 | /// Transforms a float array (of size 2) to a Vector 2. 128 | /// 129 | /// 130 | /// Vector2 from array 131 | public static Vector2 ToVector2(this float[] array) 132 | { 133 | if (array.Length != 2) return Vector2.negativeInfinity; 134 | 135 | return new Vector2(array[0], array[1]); 136 | } 137 | 138 | /// 139 | /// Transforms a float array (of size 3) to a Vector 3. 140 | /// 141 | /// 142 | /// Vector2 from array 143 | public static Vector3 ToVector3(this float[] array) 144 | { 145 | if (array.Length != 2) return Vector3.negativeInfinity; 146 | 147 | return new Vector3(array[0], array[1],array[2]); 148 | } 149 | 150 | /// 151 | /// Transforms a Vector2 to a Vector3 with Unity's (x, z) 2D coordinate system in mind. 152 | /// 153 | /// 154 | /// Transformed Vector3 155 | public static Vector3 TransformTo2DVector3(this Vector2 vector2) 156 | { 157 | return new Vector3(vector2.x, 0, vector2.y); 158 | } 159 | 160 | /// 161 | /// Chops a Vector3 to a Vector3 with Unity's (x, z) 2D coordinate system in mind. 162 | /// 163 | /// 164 | /// Optional parameter to give the Vector3 a specific y value (generally called depth in Unity's 2D mode). 165 | /// Chopped Vector3 166 | public static Vector3 ChopTo2DVector3(this Vector3 vector3, float y = 0f) 167 | { 168 | return new Vector3(vector3.x, y, vector3.z); 169 | } 170 | 171 | /// 172 | /// Returns the corresponding vector of the given angle (in degrees or radians). This method assumes +X is 0 degrees/radians. 173 | /// Desired vector magnitude. 174 | /// Specifies if in degrees or radians. 175 | /// 176 | /// Vector2 from angle 177 | public static Vector2 VectorFromAngle(this float angle, UnitType unitType = UnitType.Deg, float magnitude = 1f) 178 | { 179 | var converter = unitType == UnitType.Deg ? Mathf.Rad2Deg : 1; 180 | 181 | return new Vector2( 182 | Mathf.Cos(angle * converter), 183 | Mathf.Sin(angle * converter)) * magnitude; 184 | } 185 | 186 | /// 187 | /// Returns the positive angle in degrees or radians of the given Vector2. This method assumes +X axis is 0 degrees/radians. 188 | /// 189 | /// 190 | /// Specifies if in degrees or radians. 191 | /// In degrees or radians. 192 | /// Angle from Vector2 193 | public static float AngleFromVector(this Vector2 vector2, UnitType unitType = UnitType.Deg, float angleOffset = 0f) 194 | { 195 | var converter = unitType == UnitType.Deg ? Mathf.Rad2Deg : 1; 196 | return Mathf.Atan2(vector2.y, vector2.x) * converter + angleOffset; 197 | } 198 | 199 | /// 200 | /// Rotates the Vector2 by the given angle (in degrees or radians). 201 | /// In degrees. 202 | /// 203 | /// Rotated Vector2 204 | public static Vector2 RotateByAngle(this Vector2 v, float angle, UnitType unitType) 205 | { 206 | var converter = unitType == UnitType.Deg ? Mathf.Rad2Deg : 1; 207 | 208 | v.x = Mathf.Cos((angle + v.AngleFromVector(unitType)) * converter) * v.magnitude; 209 | v.y = Mathf.Sin((angle + v.AngleFromVector(unitType)) * converter) * v.magnitude; 210 | 211 | return v; 212 | } 213 | 214 | /// 215 | /// Calculates distance between two coordinates. See this post for more info. 216 | /// 217 | /// One coordinate. 218 | /// Another coordinate. 219 | /// Distance in meters. 220 | public static float GeoDistanceTo(this Vector2 oneVec, Vector2 anotherVec) 221 | { 222 | var d1 = oneVec.x * Mathf.Deg2Rad; 223 | var num1 = oneVec.y * Mathf.Deg2Rad; 224 | var d2 = anotherVec.x * Mathf.Deg2Rad; 225 | var num2 = anotherVec.y * Mathf.Deg2Rad - num1; 226 | var d3 = Mathf.Pow(Mathf.Sin((d2 - d1) / 2.0f), 2.0f) + Mathf.Cos(d1) * Mathf.Cos(d2) * Mathf.Pow(Mathf.Sin(num2 / 2.0f), 2.0f); 227 | 228 | return Constants.EarthRadius * (2.0f * Mathf.Atan2(Mathf.Sqrt(d3), Mathf.Sqrt(1.0f - d3))); 229 | } 230 | } 231 | } -------------------------------------------------------------------------------- /Assets/VectorExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 213e98211f204f642aa45380309f6f79 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.amp.unityutilities", 3 | "displayName": "Unity Utilities", 4 | "version": "v0.4.4", 5 | "unity": "2020.3", 6 | "author": { 7 | "name": "Augusto Mota Pinheiro", 8 | "email": "augustomp55@gmail.com", 9 | "url": "https://augustopinheiro.ca" 10 | }, 11 | "description": "Utilities to improve the C# experience in Unity: ranging from more capabilities to shorter code length!", 12 | "license": "MIT" 13 | } -------------------------------------------------------------------------------- /Assets/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43893cb27e633b84f906d0238074bf74 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 AugustDG 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 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b140c4a85db8925408ff2c9c6aa32d2a 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.15.18", 4 | "com.unity.ide.rider": "3.0.15", 5 | "com.unity.ide.visualstudio": "2.0.16", 6 | "com.unity.ide.vscode": "1.2.5", 7 | "com.unity.test-framework": "1.1.31", 8 | "com.unity.textmeshpro": "3.0.6", 9 | "com.unity.timeline": "1.6.4", 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.modules.ai": "1.0.0", 12 | "com.unity.modules.androidjni": "1.0.0", 13 | "com.unity.modules.animation": "1.0.0", 14 | "com.unity.modules.assetbundle": "1.0.0", 15 | "com.unity.modules.audio": "1.0.0", 16 | "com.unity.modules.cloth": "1.0.0", 17 | "com.unity.modules.director": "1.0.0", 18 | "com.unity.modules.imageconversion": "1.0.0", 19 | "com.unity.modules.imgui": "1.0.0", 20 | "com.unity.modules.jsonserialize": "1.0.0", 21 | "com.unity.modules.particlesystem": "1.0.0", 22 | "com.unity.modules.physics": "1.0.0", 23 | "com.unity.modules.physics2d": "1.0.0", 24 | "com.unity.modules.screencapture": "1.0.0", 25 | "com.unity.modules.terrain": "1.0.0", 26 | "com.unity.modules.terrainphysics": "1.0.0", 27 | "com.unity.modules.tilemap": "1.0.0", 28 | "com.unity.modules.ui": "1.0.0", 29 | "com.unity.modules.uielements": "1.0.0", 30 | "com.unity.modules.umbra": "1.0.0", 31 | "com.unity.modules.unityanalytics": "1.0.0", 32 | "com.unity.modules.unitywebrequest": "1.0.0", 33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 34 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 35 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 36 | "com.unity.modules.unitywebrequestwww": "1.0.0", 37 | "com.unity.modules.vehicles": "1.0.0", 38 | "com.unity.modules.video": "1.0.0", 39 | "com.unity.modules.vr": "1.0.0", 40 | "com.unity.modules.wind": "1.0.0", 41 | "com.unity.modules.xr": "1.0.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": { 4 | "version": "1.15.18", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.services.core": "1.0.1" 9 | }, 10 | "url": "https://packages.unity.com" 11 | }, 12 | "com.unity.ext.nunit": { 13 | "version": "1.0.6", 14 | "depth": 1, 15 | "source": "registry", 16 | "dependencies": {}, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ide.rider": { 20 | "version": "3.0.15", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.ext.nunit": "1.0.6" 25 | }, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.ide.visualstudio": { 29 | "version": "2.0.16", 30 | "depth": 0, 31 | "source": "registry", 32 | "dependencies": { 33 | "com.unity.test-framework": "1.1.9" 34 | }, 35 | "url": "https://packages.unity.com" 36 | }, 37 | "com.unity.ide.vscode": { 38 | "version": "1.2.5", 39 | "depth": 0, 40 | "source": "registry", 41 | "dependencies": {}, 42 | "url": "https://packages.unity.com" 43 | }, 44 | "com.unity.nuget.newtonsoft-json": { 45 | "version": "3.0.2", 46 | "depth": 2, 47 | "source": "registry", 48 | "dependencies": {}, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.services.core": { 52 | "version": "1.4.0", 53 | "depth": 1, 54 | "source": "registry", 55 | "dependencies": { 56 | "com.unity.modules.unitywebrequest": "1.0.0", 57 | "com.unity.nuget.newtonsoft-json": "3.0.2", 58 | "com.unity.modules.androidjni": "1.0.0" 59 | }, 60 | "url": "https://packages.unity.com" 61 | }, 62 | "com.unity.test-framework": { 63 | "version": "1.1.31", 64 | "depth": 0, 65 | "source": "registry", 66 | "dependencies": { 67 | "com.unity.ext.nunit": "1.0.6", 68 | "com.unity.modules.imgui": "1.0.0", 69 | "com.unity.modules.jsonserialize": "1.0.0" 70 | }, 71 | "url": "https://packages.unity.com" 72 | }, 73 | "com.unity.textmeshpro": { 74 | "version": "3.0.6", 75 | "depth": 0, 76 | "source": "registry", 77 | "dependencies": { 78 | "com.unity.ugui": "1.0.0" 79 | }, 80 | "url": "https://packages.unity.com" 81 | }, 82 | "com.unity.timeline": { 83 | "version": "1.6.4", 84 | "depth": 0, 85 | "source": "registry", 86 | "dependencies": { 87 | "com.unity.modules.director": "1.0.0", 88 | "com.unity.modules.animation": "1.0.0", 89 | "com.unity.modules.audio": "1.0.0", 90 | "com.unity.modules.particlesystem": "1.0.0" 91 | }, 92 | "url": "https://packages.unity.com" 93 | }, 94 | "com.unity.ugui": { 95 | "version": "1.0.0", 96 | "depth": 0, 97 | "source": "builtin", 98 | "dependencies": { 99 | "com.unity.modules.ui": "1.0.0", 100 | "com.unity.modules.imgui": "1.0.0" 101 | } 102 | }, 103 | "com.unity.modules.ai": { 104 | "version": "1.0.0", 105 | "depth": 0, 106 | "source": "builtin", 107 | "dependencies": {} 108 | }, 109 | "com.unity.modules.androidjni": { 110 | "version": "1.0.0", 111 | "depth": 0, 112 | "source": "builtin", 113 | "dependencies": {} 114 | }, 115 | "com.unity.modules.animation": { 116 | "version": "1.0.0", 117 | "depth": 0, 118 | "source": "builtin", 119 | "dependencies": {} 120 | }, 121 | "com.unity.modules.assetbundle": { 122 | "version": "1.0.0", 123 | "depth": 0, 124 | "source": "builtin", 125 | "dependencies": {} 126 | }, 127 | "com.unity.modules.audio": { 128 | "version": "1.0.0", 129 | "depth": 0, 130 | "source": "builtin", 131 | "dependencies": {} 132 | }, 133 | "com.unity.modules.cloth": { 134 | "version": "1.0.0", 135 | "depth": 0, 136 | "source": "builtin", 137 | "dependencies": { 138 | "com.unity.modules.physics": "1.0.0" 139 | } 140 | }, 141 | "com.unity.modules.director": { 142 | "version": "1.0.0", 143 | "depth": 0, 144 | "source": "builtin", 145 | "dependencies": { 146 | "com.unity.modules.audio": "1.0.0", 147 | "com.unity.modules.animation": "1.0.0" 148 | } 149 | }, 150 | "com.unity.modules.imageconversion": { 151 | "version": "1.0.0", 152 | "depth": 0, 153 | "source": "builtin", 154 | "dependencies": {} 155 | }, 156 | "com.unity.modules.imgui": { 157 | "version": "1.0.0", 158 | "depth": 0, 159 | "source": "builtin", 160 | "dependencies": {} 161 | }, 162 | "com.unity.modules.jsonserialize": { 163 | "version": "1.0.0", 164 | "depth": 0, 165 | "source": "builtin", 166 | "dependencies": {} 167 | }, 168 | "com.unity.modules.particlesystem": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": {} 173 | }, 174 | "com.unity.modules.physics": { 175 | "version": "1.0.0", 176 | "depth": 0, 177 | "source": "builtin", 178 | "dependencies": {} 179 | }, 180 | "com.unity.modules.physics2d": { 181 | "version": "1.0.0", 182 | "depth": 0, 183 | "source": "builtin", 184 | "dependencies": {} 185 | }, 186 | "com.unity.modules.screencapture": { 187 | "version": "1.0.0", 188 | "depth": 0, 189 | "source": "builtin", 190 | "dependencies": { 191 | "com.unity.modules.imageconversion": "1.0.0" 192 | } 193 | }, 194 | "com.unity.modules.subsystems": { 195 | "version": "1.0.0", 196 | "depth": 1, 197 | "source": "builtin", 198 | "dependencies": { 199 | "com.unity.modules.jsonserialize": "1.0.0" 200 | } 201 | }, 202 | "com.unity.modules.terrain": { 203 | "version": "1.0.0", 204 | "depth": 0, 205 | "source": "builtin", 206 | "dependencies": {} 207 | }, 208 | "com.unity.modules.terrainphysics": { 209 | "version": "1.0.0", 210 | "depth": 0, 211 | "source": "builtin", 212 | "dependencies": { 213 | "com.unity.modules.physics": "1.0.0", 214 | "com.unity.modules.terrain": "1.0.0" 215 | } 216 | }, 217 | "com.unity.modules.tilemap": { 218 | "version": "1.0.0", 219 | "depth": 0, 220 | "source": "builtin", 221 | "dependencies": { 222 | "com.unity.modules.physics2d": "1.0.0" 223 | } 224 | }, 225 | "com.unity.modules.ui": { 226 | "version": "1.0.0", 227 | "depth": 0, 228 | "source": "builtin", 229 | "dependencies": {} 230 | }, 231 | "com.unity.modules.uielements": { 232 | "version": "1.0.0", 233 | "depth": 0, 234 | "source": "builtin", 235 | "dependencies": { 236 | "com.unity.modules.ui": "1.0.0", 237 | "com.unity.modules.imgui": "1.0.0", 238 | "com.unity.modules.jsonserialize": "1.0.0", 239 | "com.unity.modules.uielementsnative": "1.0.0" 240 | } 241 | }, 242 | "com.unity.modules.uielementsnative": { 243 | "version": "1.0.0", 244 | "depth": 1, 245 | "source": "builtin", 246 | "dependencies": { 247 | "com.unity.modules.ui": "1.0.0", 248 | "com.unity.modules.imgui": "1.0.0", 249 | "com.unity.modules.jsonserialize": "1.0.0" 250 | } 251 | }, 252 | "com.unity.modules.umbra": { 253 | "version": "1.0.0", 254 | "depth": 0, 255 | "source": "builtin", 256 | "dependencies": {} 257 | }, 258 | "com.unity.modules.unityanalytics": { 259 | "version": "1.0.0", 260 | "depth": 0, 261 | "source": "builtin", 262 | "dependencies": { 263 | "com.unity.modules.unitywebrequest": "1.0.0", 264 | "com.unity.modules.jsonserialize": "1.0.0" 265 | } 266 | }, 267 | "com.unity.modules.unitywebrequest": { 268 | "version": "1.0.0", 269 | "depth": 0, 270 | "source": "builtin", 271 | "dependencies": {} 272 | }, 273 | "com.unity.modules.unitywebrequestassetbundle": { 274 | "version": "1.0.0", 275 | "depth": 0, 276 | "source": "builtin", 277 | "dependencies": { 278 | "com.unity.modules.assetbundle": "1.0.0", 279 | "com.unity.modules.unitywebrequest": "1.0.0" 280 | } 281 | }, 282 | "com.unity.modules.unitywebrequestaudio": { 283 | "version": "1.0.0", 284 | "depth": 0, 285 | "source": "builtin", 286 | "dependencies": { 287 | "com.unity.modules.unitywebrequest": "1.0.0", 288 | "com.unity.modules.audio": "1.0.0" 289 | } 290 | }, 291 | "com.unity.modules.unitywebrequesttexture": { 292 | "version": "1.0.0", 293 | "depth": 0, 294 | "source": "builtin", 295 | "dependencies": { 296 | "com.unity.modules.unitywebrequest": "1.0.0", 297 | "com.unity.modules.imageconversion": "1.0.0" 298 | } 299 | }, 300 | "com.unity.modules.unitywebrequestwww": { 301 | "version": "1.0.0", 302 | "depth": 0, 303 | "source": "builtin", 304 | "dependencies": { 305 | "com.unity.modules.unitywebrequest": "1.0.0", 306 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 307 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 308 | "com.unity.modules.audio": "1.0.0", 309 | "com.unity.modules.assetbundle": "1.0.0", 310 | "com.unity.modules.imageconversion": "1.0.0" 311 | } 312 | }, 313 | "com.unity.modules.vehicles": { 314 | "version": "1.0.0", 315 | "depth": 0, 316 | "source": "builtin", 317 | "dependencies": { 318 | "com.unity.modules.physics": "1.0.0" 319 | } 320 | }, 321 | "com.unity.modules.video": { 322 | "version": "1.0.0", 323 | "depth": 0, 324 | "source": "builtin", 325 | "dependencies": { 326 | "com.unity.modules.audio": "1.0.0", 327 | "com.unity.modules.ui": "1.0.0", 328 | "com.unity.modules.unitywebrequest": "1.0.0" 329 | } 330 | }, 331 | "com.unity.modules.vr": { 332 | "version": "1.0.0", 333 | "depth": 0, 334 | "source": "builtin", 335 | "dependencies": { 336 | "com.unity.modules.jsonserialize": "1.0.0", 337 | "com.unity.modules.physics": "1.0.0", 338 | "com.unity.modules.xr": "1.0.0" 339 | } 340 | }, 341 | "com.unity.modules.wind": { 342 | "version": "1.0.0", 343 | "depth": 0, 344 | "source": "builtin", 345 | "dependencies": {} 346 | }, 347 | "com.unity.modules.xr": { 348 | "version": "1.0.0", 349 | "depth": 0, 350 | "source": "builtin", 351 | "dependencies": { 352 | "com.unity.modules.physics": "1.0.0", 353 | "com.unity.modules.jsonserialize": "1.0.0", 354 | "com.unity.modules.subsystems": "1.0.0" 355 | } 356 | } 357 | } 358 | } 359 | -------------------------------------------------------------------------------- /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: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 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: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /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: 13 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: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /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/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: 22 7 | productGUID: fc61f1f0ebe4e964ab40281a02b9e826 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: Unity-Utilities 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 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | androidResizableWindow: 0 72 | androidDefaultWindowWidth: 1920 73 | androidDefaultWindowHeight: 1080 74 | androidMinimumWindowWidth: 400 75 | androidMinimumWindowHeight: 300 76 | androidFullscreenMode: 1 77 | defaultIsNativeResolution: 1 78 | macRetinaSupport: 1 79 | runInBackground: 1 80 | captureSingleScreen: 0 81 | muteOtherAudioSources: 0 82 | Prepare IOS For Recording: 0 83 | Force IOS Speakers When Recording: 0 84 | deferSystemGesturesMode: 0 85 | hideHomeButton: 0 86 | submitAnalytics: 1 87 | usePlayerLog: 1 88 | bakeCollisionMeshes: 0 89 | forceSingleInstance: 0 90 | useFlipModelSwapchain: 1 91 | resizableWindow: 0 92 | useMacAppStoreValidation: 0 93 | macAppStoreCategory: public.app-category.games 94 | gpuSkinning: 1 95 | xboxPIXTextureCapture: 0 96 | xboxEnableAvatar: 0 97 | xboxEnableKinect: 0 98 | xboxEnableKinectAutoTracking: 0 99 | xboxEnableFitness: 0 100 | visibleInBackground: 1 101 | allowFullscreenSwitch: 1 102 | fullscreenMode: 1 103 | xboxSpeechDB: 0 104 | xboxEnableHeadOrientation: 0 105 | xboxEnableGuest: 0 106 | xboxEnablePIXSampling: 0 107 | metalFramebufferOnly: 0 108 | xboxOneResolution: 0 109 | xboxOneSResolution: 0 110 | xboxOneXResolution: 3 111 | xboxOneMonoLoggingLevel: 0 112 | xboxOneLoggingLevel: 1 113 | xboxOneDisableEsram: 0 114 | xboxOneEnableTypeOptimization: 0 115 | xboxOnePresentImmediateThreshold: 0 116 | switchQueueCommandMemory: 0 117 | switchQueueControlMemory: 16384 118 | switchQueueComputeMemory: 262144 119 | switchNVNShaderPoolsGranularity: 33554432 120 | switchNVNDefaultPoolsGranularity: 16777216 121 | switchNVNOtherPoolsGranularity: 16777216 122 | switchNVNMaxPublicTextureIDCount: 0 123 | switchNVNMaxPublicSamplerIDCount: 0 124 | stadiaPresentMode: 0 125 | stadiaTargetFramerate: 0 126 | vulkanNumSwapchainBuffers: 3 127 | vulkanEnableSetSRGBWrite: 0 128 | vulkanEnablePreTransform: 0 129 | vulkanEnableLateAcquireNextImage: 0 130 | vulkanEnableCommandBufferRecycling: 1 131 | m_SupportedAspectRatios: 132 | 4:3: 1 133 | 5:4: 1 134 | 16:10: 1 135 | 16:9: 1 136 | Others: 1 137 | bundleVersion: 0.1 138 | preloadedAssets: [] 139 | metroInputSource: 0 140 | wsaTransparentSwapchain: 0 141 | m_HolographicPauseOnTrackingLoss: 1 142 | xboxOneDisableKinectGpuReservation: 1 143 | xboxOneEnable7thCore: 1 144 | vrSettings: 145 | enable360StereoCapture: 0 146 | isWsaHolographicRemotingEnabled: 0 147 | enableFrameTimingStats: 0 148 | useHDRDisplay: 0 149 | D3DHDRBitDepth: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: {} 156 | buildNumber: 157 | Standalone: 0 158 | iPhone: 0 159 | tvOS: 0 160 | overrideDefaultApplicationIdentifier: 0 161 | AndroidBundleVersionCode: 1 162 | AndroidMinSdkVersion: 19 163 | AndroidTargetSdkVersion: 0 164 | AndroidPreferredInstallLocation: 1 165 | aotOptions: 166 | stripEngineCode: 1 167 | iPhoneStrippingLevel: 0 168 | iPhoneScriptCallOptimization: 0 169 | ForceInternetPermission: 0 170 | ForceSDCardPermission: 0 171 | CreateWallpaper: 0 172 | APKExpansionFiles: 0 173 | keepLoadedShadersAlive: 0 174 | StripUnusedMeshComponents: 1 175 | VertexChannelCompressionMask: 4054 176 | iPhoneSdkVersion: 988 177 | iOSTargetOSVersionString: 11.0 178 | tvOSSdkVersion: 0 179 | tvOSRequireExtendedGameController: 0 180 | tvOSTargetOSVersionString: 11.0 181 | uIPrerenderedIcon: 0 182 | uIRequiresPersistentWiFi: 0 183 | uIRequiresFullScreen: 1 184 | uIStatusBarHidden: 1 185 | uIExitOnSuspend: 0 186 | uIStatusBarStyle: 0 187 | appleTVSplashScreen: {fileID: 0} 188 | appleTVSplashScreen2x: {fileID: 0} 189 | tvOSSmallIconLayers: [] 190 | tvOSSmallIconLayers2x: [] 191 | tvOSLargeIconLayers: [] 192 | tvOSLargeIconLayers2x: [] 193 | tvOSTopShelfImageLayers: [] 194 | tvOSTopShelfImageLayers2x: [] 195 | tvOSTopShelfImageWideLayers: [] 196 | tvOSTopShelfImageWideLayers2x: [] 197 | iOSLaunchScreenType: 0 198 | iOSLaunchScreenPortrait: {fileID: 0} 199 | iOSLaunchScreenLandscape: {fileID: 0} 200 | iOSLaunchScreenBackgroundColor: 201 | serializedVersion: 2 202 | rgba: 0 203 | iOSLaunchScreenFillPct: 100 204 | iOSLaunchScreenSize: 100 205 | iOSLaunchScreenCustomXibPath: 206 | iOSLaunchScreeniPadType: 0 207 | iOSLaunchScreeniPadImage: {fileID: 0} 208 | iOSLaunchScreeniPadBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreeniPadFillPct: 100 212 | iOSLaunchScreeniPadSize: 100 213 | iOSLaunchScreeniPadCustomXibPath: 214 | iOSLaunchScreenCustomStoryboardPath: 215 | iOSLaunchScreeniPadCustomStoryboardPath: 216 | iOSDeviceRequirements: [] 217 | iOSURLSchemes: [] 218 | iOSBackgroundModes: 0 219 | iOSMetalForceHardShadows: 0 220 | metalEditorSupport: 1 221 | metalAPIValidation: 1 222 | iOSRenderExtraFrameOnPause: 0 223 | iosCopyPluginsCodeInsteadOfSymlink: 0 224 | appleDeveloperTeamID: 225 | iOSManualSigningProvisioningProfileID: 226 | tvOSManualSigningProvisioningProfileID: 227 | iOSManualSigningProvisioningProfileType: 0 228 | tvOSManualSigningProvisioningProfileType: 0 229 | appleEnableAutomaticSigning: 0 230 | iOSRequireARKit: 0 231 | iOSAutomaticallyDetectAndAddCapabilities: 1 232 | appleEnableProMotion: 0 233 | shaderPrecisionModel: 0 234 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 235 | templatePackageId: com.unity.template.3d@5.0.4 236 | templateDefaultScene: Assets/Scenes/SampleScene.unity 237 | useCustomMainManifest: 0 238 | useCustomLauncherManifest: 0 239 | useCustomMainGradleTemplate: 0 240 | useCustomLauncherGradleManifest: 0 241 | useCustomBaseGradleTemplate: 0 242 | useCustomGradlePropertiesTemplate: 0 243 | useCustomProguardFile: 0 244 | AndroidTargetArchitectures: 1 245 | AndroidTargetDevices: 0 246 | AndroidSplashScreenScale: 0 247 | androidSplashScreen: {fileID: 0} 248 | AndroidKeystoreName: 249 | AndroidKeyaliasName: 250 | AndroidBuildApkPerCpuArchitecture: 0 251 | AndroidTVCompatibility: 0 252 | AndroidIsGame: 1 253 | AndroidEnableTango: 0 254 | androidEnableBanner: 1 255 | androidUseLowAccuracyLocation: 0 256 | androidUseCustomKeystore: 0 257 | m_AndroidBanners: 258 | - width: 320 259 | height: 180 260 | banner: {fileID: 0} 261 | androidGamepadSupportLevel: 0 262 | chromeosInputEmulation: 1 263 | AndroidMinifyWithR8: 0 264 | AndroidMinifyRelease: 0 265 | AndroidMinifyDebug: 0 266 | AndroidValidateAppBundleSize: 1 267 | AndroidAppBundleSizeToValidate: 150 268 | m_BuildTargetIcons: [] 269 | m_BuildTargetPlatformIcons: [] 270 | m_BuildTargetBatching: 271 | - m_BuildTarget: Standalone 272 | m_StaticBatching: 1 273 | m_DynamicBatching: 0 274 | - m_BuildTarget: tvOS 275 | m_StaticBatching: 1 276 | m_DynamicBatching: 0 277 | - m_BuildTarget: Android 278 | m_StaticBatching: 1 279 | m_DynamicBatching: 0 280 | - m_BuildTarget: iPhone 281 | m_StaticBatching: 1 282 | m_DynamicBatching: 0 283 | - m_BuildTarget: WebGL 284 | m_StaticBatching: 0 285 | m_DynamicBatching: 0 286 | m_BuildTargetGraphicsJobs: 287 | - m_BuildTarget: MacStandaloneSupport 288 | m_GraphicsJobs: 0 289 | - m_BuildTarget: Switch 290 | m_GraphicsJobs: 1 291 | - m_BuildTarget: MetroSupport 292 | m_GraphicsJobs: 1 293 | - m_BuildTarget: AppleTVSupport 294 | m_GraphicsJobs: 0 295 | - m_BuildTarget: BJMSupport 296 | m_GraphicsJobs: 1 297 | - m_BuildTarget: LinuxStandaloneSupport 298 | m_GraphicsJobs: 1 299 | - m_BuildTarget: PS4Player 300 | m_GraphicsJobs: 1 301 | - m_BuildTarget: iOSSupport 302 | m_GraphicsJobs: 0 303 | - m_BuildTarget: WindowsStandaloneSupport 304 | m_GraphicsJobs: 1 305 | - m_BuildTarget: XboxOnePlayer 306 | m_GraphicsJobs: 1 307 | - m_BuildTarget: LuminSupport 308 | m_GraphicsJobs: 0 309 | - m_BuildTarget: AndroidPlayer 310 | m_GraphicsJobs: 0 311 | - m_BuildTarget: WebGLSupport 312 | m_GraphicsJobs: 0 313 | m_BuildTargetGraphicsJobMode: 314 | - m_BuildTarget: PS4Player 315 | m_GraphicsJobMode: 0 316 | - m_BuildTarget: XboxOnePlayer 317 | m_GraphicsJobMode: 0 318 | m_BuildTargetGraphicsAPIs: 319 | - m_BuildTarget: AndroidPlayer 320 | m_APIs: 150000000b000000 321 | m_Automatic: 0 322 | - m_BuildTarget: iOSSupport 323 | m_APIs: 10000000 324 | m_Automatic: 1 325 | - m_BuildTarget: AppleTVSupport 326 | m_APIs: 10000000 327 | m_Automatic: 1 328 | - m_BuildTarget: WebGLSupport 329 | m_APIs: 0b000000 330 | m_Automatic: 1 331 | m_BuildTargetVRSettings: 332 | - m_BuildTarget: Standalone 333 | m_Enabled: 0 334 | m_Devices: 335 | - Oculus 336 | - OpenVR 337 | openGLRequireES31: 0 338 | openGLRequireES31AEP: 0 339 | openGLRequireES32: 0 340 | m_TemplateCustomTags: {} 341 | mobileMTRendering: 342 | Android: 1 343 | iPhone: 1 344 | tvOS: 1 345 | m_BuildTargetGroupLightmapEncodingQuality: [] 346 | m_BuildTargetGroupLightmapSettings: [] 347 | m_BuildTargetNormalMapEncoding: [] 348 | playModeTestRunnerEnabled: 0 349 | runPlayModeTestAsEditModeTest: 0 350 | actionOnDotNetUnhandledException: 1 351 | enableInternalProfiler: 0 352 | logObjCUncaughtExceptions: 1 353 | enableCrashReportAPI: 0 354 | cameraUsageDescription: 355 | locationUsageDescription: 356 | microphoneUsageDescription: 357 | bluetoothUsageDescription: 358 | switchNMETAOverride: 359 | switchNetLibKey: 360 | switchSocketMemoryPoolSize: 6144 361 | switchSocketAllocatorPoolSize: 128 362 | switchSocketConcurrencyLimit: 14 363 | switchScreenResolutionBehavior: 2 364 | switchUseCPUProfiler: 0 365 | switchUseGOLDLinker: 0 366 | switchApplicationID: 0x01004b9000490000 367 | switchNSODependencies: 368 | switchTitleNames_0: 369 | switchTitleNames_1: 370 | switchTitleNames_2: 371 | switchTitleNames_3: 372 | switchTitleNames_4: 373 | switchTitleNames_5: 374 | switchTitleNames_6: 375 | switchTitleNames_7: 376 | switchTitleNames_8: 377 | switchTitleNames_9: 378 | switchTitleNames_10: 379 | switchTitleNames_11: 380 | switchTitleNames_12: 381 | switchTitleNames_13: 382 | switchTitleNames_14: 383 | switchTitleNames_15: 384 | switchPublisherNames_0: 385 | switchPublisherNames_1: 386 | switchPublisherNames_2: 387 | switchPublisherNames_3: 388 | switchPublisherNames_4: 389 | switchPublisherNames_5: 390 | switchPublisherNames_6: 391 | switchPublisherNames_7: 392 | switchPublisherNames_8: 393 | switchPublisherNames_9: 394 | switchPublisherNames_10: 395 | switchPublisherNames_11: 396 | switchPublisherNames_12: 397 | switchPublisherNames_13: 398 | switchPublisherNames_14: 399 | switchPublisherNames_15: 400 | switchIcons_0: {fileID: 0} 401 | switchIcons_1: {fileID: 0} 402 | switchIcons_2: {fileID: 0} 403 | switchIcons_3: {fileID: 0} 404 | switchIcons_4: {fileID: 0} 405 | switchIcons_5: {fileID: 0} 406 | switchIcons_6: {fileID: 0} 407 | switchIcons_7: {fileID: 0} 408 | switchIcons_8: {fileID: 0} 409 | switchIcons_9: {fileID: 0} 410 | switchIcons_10: {fileID: 0} 411 | switchIcons_11: {fileID: 0} 412 | switchIcons_12: {fileID: 0} 413 | switchIcons_13: {fileID: 0} 414 | switchIcons_14: {fileID: 0} 415 | switchIcons_15: {fileID: 0} 416 | switchSmallIcons_0: {fileID: 0} 417 | switchSmallIcons_1: {fileID: 0} 418 | switchSmallIcons_2: {fileID: 0} 419 | switchSmallIcons_3: {fileID: 0} 420 | switchSmallIcons_4: {fileID: 0} 421 | switchSmallIcons_5: {fileID: 0} 422 | switchSmallIcons_6: {fileID: 0} 423 | switchSmallIcons_7: {fileID: 0} 424 | switchSmallIcons_8: {fileID: 0} 425 | switchSmallIcons_9: {fileID: 0} 426 | switchSmallIcons_10: {fileID: 0} 427 | switchSmallIcons_11: {fileID: 0} 428 | switchSmallIcons_12: {fileID: 0} 429 | switchSmallIcons_13: {fileID: 0} 430 | switchSmallIcons_14: {fileID: 0} 431 | switchSmallIcons_15: {fileID: 0} 432 | switchManualHTML: 433 | switchAccessibleURLs: 434 | switchLegalInformation: 435 | switchMainThreadStackSize: 1048576 436 | switchPresenceGroupId: 437 | switchLogoHandling: 0 438 | switchReleaseVersion: 0 439 | switchDisplayVersion: 1.0.0 440 | switchStartupUserAccount: 0 441 | switchTouchScreenUsage: 0 442 | switchSupportedLanguagesMask: 0 443 | switchLogoType: 0 444 | switchApplicationErrorCodeCategory: 445 | switchUserAccountSaveDataSize: 0 446 | switchUserAccountSaveDataJournalSize: 0 447 | switchApplicationAttribute: 0 448 | switchCardSpecSize: -1 449 | switchCardSpecClock: -1 450 | switchRatingsMask: 0 451 | switchRatingsInt_0: 0 452 | switchRatingsInt_1: 0 453 | switchRatingsInt_2: 0 454 | switchRatingsInt_3: 0 455 | switchRatingsInt_4: 0 456 | switchRatingsInt_5: 0 457 | switchRatingsInt_6: 0 458 | switchRatingsInt_7: 0 459 | switchRatingsInt_8: 0 460 | switchRatingsInt_9: 0 461 | switchRatingsInt_10: 0 462 | switchRatingsInt_11: 0 463 | switchRatingsInt_12: 0 464 | switchLocalCommunicationIds_0: 465 | switchLocalCommunicationIds_1: 466 | switchLocalCommunicationIds_2: 467 | switchLocalCommunicationIds_3: 468 | switchLocalCommunicationIds_4: 469 | switchLocalCommunicationIds_5: 470 | switchLocalCommunicationIds_6: 471 | switchLocalCommunicationIds_7: 472 | switchParentalControl: 0 473 | switchAllowsScreenshot: 1 474 | switchAllowsVideoCapturing: 1 475 | switchAllowsRuntimeAddOnContentInstall: 0 476 | switchDataLossConfirmation: 0 477 | switchUserAccountLockEnabled: 0 478 | switchSystemResourceMemory: 16777216 479 | switchSupportedNpadStyles: 22 480 | switchNativeFsCacheSize: 32 481 | switchIsHoldTypeHorizontal: 0 482 | switchSupportedNpadCount: 8 483 | switchSocketConfigEnabled: 0 484 | switchTcpInitialSendBufferSize: 32 485 | switchTcpInitialReceiveBufferSize: 64 486 | switchTcpAutoSendBufferSizeMax: 256 487 | switchTcpAutoReceiveBufferSizeMax: 256 488 | switchUdpSendBufferSize: 9 489 | switchUdpReceiveBufferSize: 42 490 | switchSocketBufferEfficiency: 4 491 | switchSocketInitializeEnabled: 1 492 | switchNetworkInterfaceManagerInitializeEnabled: 1 493 | switchPlayerConnectionEnabled: 1 494 | switchUseNewStyleFilepaths: 0 495 | switchUseMicroSleepForYield: 1 496 | switchMicroSleepForYieldTime: 25 497 | ps4NPAgeRating: 12 498 | ps4NPTitleSecret: 499 | ps4NPTrophyPackPath: 500 | ps4ParentalLevel: 11 501 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 502 | ps4Category: 0 503 | ps4MasterVersion: 01.00 504 | ps4AppVersion: 01.00 505 | ps4AppType: 0 506 | ps4ParamSfxPath: 507 | ps4VideoOutPixelFormat: 0 508 | ps4VideoOutInitialWidth: 1920 509 | ps4VideoOutBaseModeInitialWidth: 1920 510 | ps4VideoOutReprojectionRate: 60 511 | ps4PronunciationXMLPath: 512 | ps4PronunciationSIGPath: 513 | ps4BackgroundImagePath: 514 | ps4StartupImagePath: 515 | ps4StartupImagesFolder: 516 | ps4IconImagesFolder: 517 | ps4SaveDataImagePath: 518 | ps4SdkOverride: 519 | ps4BGMPath: 520 | ps4ShareFilePath: 521 | ps4ShareOverlayImagePath: 522 | ps4PrivacyGuardImagePath: 523 | ps4ExtraSceSysFile: 524 | ps4NPtitleDatPath: 525 | ps4RemotePlayKeyAssignment: -1 526 | ps4RemotePlayKeyMappingDir: 527 | ps4PlayTogetherPlayerCount: 0 528 | ps4EnterButtonAssignment: 1 529 | ps4ApplicationParam1: 0 530 | ps4ApplicationParam2: 0 531 | ps4ApplicationParam3: 0 532 | ps4ApplicationParam4: 0 533 | ps4DownloadDataSize: 0 534 | ps4GarlicHeapSize: 2048 535 | ps4ProGarlicHeapSize: 2560 536 | playerPrefsMaxSize: 32768 537 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 538 | ps4pnSessions: 1 539 | ps4pnPresence: 1 540 | ps4pnFriends: 1 541 | ps4pnGameCustomData: 1 542 | playerPrefsSupport: 0 543 | enableApplicationExit: 0 544 | resetTempFolder: 1 545 | restrictedAudioUsageRights: 0 546 | ps4UseResolutionFallback: 0 547 | ps4ReprojectionSupport: 0 548 | ps4UseAudio3dBackend: 0 549 | ps4UseLowGarlicFragmentationMode: 1 550 | ps4SocialScreenEnabled: 0 551 | ps4ScriptOptimizationLevel: 0 552 | ps4Audio3dVirtualSpeakerCount: 14 553 | ps4attribCpuUsage: 0 554 | ps4PatchPkgPath: 555 | ps4PatchLatestPkgPath: 556 | ps4PatchChangeinfoPath: 557 | ps4PatchDayOne: 0 558 | ps4attribUserManagement: 0 559 | ps4attribMoveSupport: 0 560 | ps4attrib3DSupport: 0 561 | ps4attribShareSupport: 0 562 | ps4attribExclusiveVR: 0 563 | ps4disableAutoHideSplash: 0 564 | ps4videoRecordingFeaturesUsed: 0 565 | ps4contentSearchFeaturesUsed: 0 566 | ps4CompatibilityPS5: 0 567 | ps4AllowPS5Detection: 0 568 | ps4GPU800MHz: 1 569 | ps4attribEyeToEyeDistanceSettingVR: 0 570 | ps4IncludedModules: [] 571 | ps4attribVROutputEnabled: 0 572 | monoEnv: 573 | splashScreenBackgroundSourceLandscape: {fileID: 0} 574 | splashScreenBackgroundSourcePortrait: {fileID: 0} 575 | blurSplashScreenBackground: 1 576 | spritePackerPolicy: 577 | webGLMemorySize: 16 578 | webGLExceptionSupport: 1 579 | webGLNameFilesAsHashes: 0 580 | webGLDataCaching: 1 581 | webGLDebugSymbols: 0 582 | webGLEmscriptenArgs: 583 | webGLModulesDirectory: 584 | webGLTemplate: APPLICATION:Default 585 | webGLAnalyzeBuildSize: 0 586 | webGLUseEmbeddedResources: 0 587 | webGLCompressionFormat: 1 588 | webGLWasmArithmeticExceptions: 0 589 | webGLLinkerTarget: 1 590 | webGLThreadsSupport: 0 591 | webGLDecompressionFallback: 0 592 | scriptingDefineSymbols: {} 593 | additionalCompilerArguments: {} 594 | platformArchitecture: {} 595 | scriptingBackend: {} 596 | il2cppCompilerConfiguration: {} 597 | managedStrippingLevel: {} 598 | incrementalIl2cppBuild: {} 599 | suppressCommonWarnings: 1 600 | allowUnsafeCode: 0 601 | useDeterministicCompilation: 1 602 | useReferenceAssemblies: 1 603 | enableRoslynAnalyzers: 1 604 | additionalIl2CppArgs: 605 | scriptingRuntimeVersion: 1 606 | gcIncremental: 1 607 | assemblyVersionValidation: 1 608 | gcWBarrierValidation: 0 609 | apiCompatibilityLevelPerPlatform: {} 610 | m_RenderingPath: 1 611 | m_MobileRenderingPath: 1 612 | metroPackageName: Template_3D 613 | metroPackageVersion: 614 | metroCertificatePath: 615 | metroCertificatePassword: 616 | metroCertificateSubject: 617 | metroCertificateIssuer: 618 | metroCertificateNotAfter: 0000000000000000 619 | metroApplicationDescription: Template_3D 620 | wsaImages: {} 621 | metroTileShortName: 622 | metroTileShowName: 0 623 | metroMediumTileShowName: 0 624 | metroLargeTileShowName: 0 625 | metroWideTileShowName: 0 626 | metroSupportStreamingInstall: 0 627 | metroLastRequiredScene: 0 628 | metroDefaultTileSize: 1 629 | metroTileForegroundText: 2 630 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 631 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 632 | metroSplashScreenUseBackgroundColor: 0 633 | platformCapabilities: {} 634 | metroTargetDeviceFamilies: {} 635 | metroFTAName: 636 | metroFTAFileTypes: [] 637 | metroProtocolName: 638 | XboxOneProductId: 639 | XboxOneUpdateKey: 640 | XboxOneSandboxId: 641 | XboxOneContentId: 642 | XboxOneTitleId: 643 | XboxOneSCId: 644 | XboxOneGameOsOverridePath: 645 | XboxOnePackagingOverridePath: 646 | XboxOneAppManifestOverridePath: 647 | XboxOneVersion: 1.0.0.0 648 | XboxOnePackageEncryption: 0 649 | XboxOnePackageUpdateGranularity: 2 650 | XboxOneDescription: 651 | XboxOneLanguage: 652 | - enus 653 | XboxOneCapability: [] 654 | XboxOneGameRating: {} 655 | XboxOneIsContentPackage: 0 656 | XboxOneEnhancedXboxCompatibilityMode: 0 657 | XboxOneEnableGPUVariability: 1 658 | XboxOneSockets: {} 659 | XboxOneSplashScreen: {fileID: 0} 660 | XboxOneAllowedProductIds: [] 661 | XboxOnePersistentLocalStorageSize: 0 662 | XboxOneXTitleMemory: 8 663 | XboxOneOverrideIdentityName: 664 | XboxOneOverrideIdentityPublisher: 665 | vrEditorSettings: {} 666 | cloudServicesEnabled: 667 | UNet: 1 668 | luminIcon: 669 | m_Name: 670 | m_ModelFolderPath: 671 | m_PortalFolderPath: 672 | luminCert: 673 | m_CertPath: 674 | m_SignPackage: 1 675 | luminIsChannelApp: 0 676 | luminVersion: 677 | m_VersionCode: 1 678 | m_VersionName: 679 | apiCompatibilityLevel: 6 680 | activeInputHandler: 0 681 | cloudProjectId: 682 | framebufferDepthMemorylessMode: 0 683 | qualitySettingsNames: [] 684 | projectName: 685 | organizationId: 686 | cloudEnabled: 0 687 | legacyClampBlendShapeWeights: 0 688 | virtualTexturingSupportEnabled: 0 689 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.6f1 2 | m_EditorVersionWithRevision: 2021.3.6f1 (7da38d85baf6) 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: 5 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 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 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: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /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.33333334 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_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /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/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /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 | # Unity Utilities 2 | 3 | [![openupm](https://img.shields.io/npm/v/com.amp.unityutilities?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.amp.unityutilities/) 4 | 5 | Utilities to improve the C# experience in Unity: ranging from more capabilities to shorter code length! 6 | 7 | For now, to use this library, you need to copy the repo (or download it) and build a .dll file in Visual Studio, 8 | Jetbrains Rider or any .NET IDE, to then add it to your Unity project! Alternatively, you can also copy all the scripts 9 | in your project :) Don't forget to add the `UnityUtilities` namespace! 10 | 11 | ### OpenUPM 12 | 13 | You can now install this as an UPM packge through OpenUPM! Here's the package [page](https://openupm.com/packages/com.amp.unityutilities/#) :D 14 | 15 | Just open a terminal within your project and type: 16 | ```commandline 17 | openupm add com.amp.unityutilities 18 | ``` 19 | 20 | or, manually install it through the package manager like [this](https://openupm.com/packages/com.amp.unityutilities/#modal-manualinstallation)! 21 | 22 | ### C# Version 23 | 24 | Currently frozen at [#8.0](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8) for backwards compability 25 | with `Unity 2020.3` and above! 26 | 27 | ## Patterns 28 | 29 | A series of popular programming patterns, implemented in easy to use classes! 30 | 31 | ### Singletons 32 | 33 | Through the controversy of using them, here are generic, 34 | base [Singleton](https://en.wikipedia.org/wiki/Singleton_pattern#:~:text=In%20software%20engineering%2C%20the%20singleton,mathematical%20concept%20of%20a%20singleton.) 35 | classes to get you up and going if you need them! 36 | 37 | **Since Unity is singlethreaded, none of the following are thread safe!** 38 | 39 | - `Singleton` → Generic singleton class, made for _MonoBehaviours_. 40 | - `SingletonPersistent` → Generic persistent singleton class, made for _MonoBehaviours_. Persists through scene reloads. 41 | - `SingletonLazy` → Generic lazy singleton class, made for _MonoBehaviours_. Creates itself, if it doesn't exist. 42 | - `SingletonService` → A newer kind of a C# (doesn't interact with Unity) _Singleton_, only accessible through method calls. Mainly used for services. 43 | 44 | ## Coroutines 45 | 46 | - `WaitUntilAndForSecondsRealtime` → Suspends the coroutine execution for the given amount of seconds using unscaled time and until the passed condition is true. 47 | - `WaitUntilOrForSecondsRealtime` → Suspends the coroutine execution for the given amount of seconds using unscaled time or until the passed condition is true. 48 | - `WaitWhileAndForSecondsRealtime` → Suspends the coroutine execution for the given amount of seconds using unscaled time and while the passed condition is true. 49 | - `WaitWhileOrForSecondsRealtime` → Suspends the coroutine execution for the given amount of seconds using unscaled time or while the passed condition is true. 50 | 51 | ## Extensions 52 | 53 | ### Numerals 54 | 55 | - `Round` → Rounds float and returns float; number of decimals can be specified. 56 | - `RoundToInt` → Rounds float and returns int. 57 | - `Abs` → Returns the absolute value (of ints and floats). 58 | - `Clamp` → Clamps float or int to the supplied range. 59 | - `Map` → Maps a float from the supplied range to the supplied range (for floats and ints). 60 | 61 | ### Movement 62 | 63 | - `GoUp` → Smoothly translates the _gameobject_ (or transform) up at the desired speed (float). 64 | - `GoDown` → Smoothly translates the _gameobject_ (or transform) down at the desired speed (float). 65 | - `GoLeft` → Smoothly translates the _gameobject_ (or transform) left at the desired speed (float). 66 | - `GoRight` → Smoothly translates the _gameobject_ (or transform) right at the desired speed (float). 67 | - `GoForward` → Smoothly translates the _gameobject_ (or transform) forward at the desired speed (float). 68 | - `GoBackward` → Smoothly translates the _gameobject_ (or transform) backward at the desired speed (float). 69 | - `FollowMouse2D` → Smoothly makes the _Rigidbody2D_ follow the mouse position at the desired speeds (float, float). 70 | - `FollowObject2D` → Smoothly makes the _Rigidbody2D_ follow the specified object (or transform) at the desired 71 | speeds (float, float); 72 | 73 | ### Vectors 74 | 75 | - `Round` → Rounds _Vector2_, _Vector3_ and returns a rounded vector with the specified number of decimals. 76 | - `RoundToInt` → Rounds _Vector2_, _Vector3_ and returns _Vector2Int_. 77 | - `Clamp` → Clamps the components of the Vector3 between supplied values. 78 | - `VectorFromAngle` → Returns the corresponding vector to the given angle (in degrees or radians). 79 | - `RotateByAngle` → Rotates the _Vector2_ by the given angle (in degress or radians). This method assumes +X axis 80 | is 0 degrees/radians. 81 | - `AngleFromVector` → Returns the positive angle in degrees (or radians) of given _Vector2_. This method assumes +X 82 | axis is 0 degrees/radians. 83 | - `TransformTo2DVector3` → Transforms _Vector2_ into _Vector3_ respecting Unity's coordinate system (so x = x, y = 84 | 0, z = y). 85 | - `ChopTo2DVector3` → Takes and returns a _Vector3_ respecting Unity's coordinate system (so x = x, y = 0 (or 86 | specified), z = y). 87 | - `ToVector2` → Transforms a 2-big float array to a _Vector2_. 88 | - `ToVector3` → Transforms a 3-big float array to a _Vector3_. 89 | - `ToArray` → Transforms a _Vector3_ or _Vector2_ to a 3-big or 2-big float array, respectively. 90 | - `GeoDistanceTo` → Calculates distance between two coordinates. 91 | 92 | ### Quaternions 93 | 94 | - `AverageQuaternions` → Returns the average of the _Quaternions_. 95 | - `AverageQuaternionsFast` → Returns the average of the _Quaternions_, without normalizing to save on speed. 96 | - `Normalize` → Normalizes the _Quaternion_. 97 | - `Inverse` → Inverses the _Quaternion_. 98 | - `InverseSign` → Inverses the sign of the _Quaternion_. 99 | - `IsClose` → Checks if the _Quaternion_ is close to the given one. 100 | - `Scale` → Scales the _Quaternion_. 101 | 102 | ### GameObject 103 | 104 | - `Print` → Cleaner way of _Debug.Log()_ with log type support 105 | - `DelayAction` → Delays supplied action by specified number of seconds (float). 106 | - `IsAnimatorPlaying` → Checks if the animator is currently playing an animation. 107 | - `Destroy` → More elegant way of writing _Destroy(gameObject)_. 108 | - `DestroyImmediate` → More elegant way of writing _DestroyImmediate(gameObject)_. 109 | 110 | ### CustomBehaviour 111 | 112 | - `Log` → Logs a message to the console with the object's name. 113 | - `LogWarning` → Logs a warning to the console with the object's name. 114 | - `LogError` → Logs an error to the console with the object's name. 115 | 116 | - `static Log` → Logs a message to the console with the passed object's name. 117 | - `static LogWarning` → Logs a warning to the console with the passed object's name. 118 | - `static LogError` → Logs an error to the console with the passed object's name. 119 | 120 | ### Miscelleanous 121 | 122 | - `Flip` → Flips a 2-big float array, so that the values swap indexes. 123 | 124 | ## Changelog 125 | 126 | ### v0.4.4 127 | 128 | - Fixed `CustomBehaviour` logging methods. 129 | 130 | ### v0.4.3 131 | 132 | - Duplicated `CustomBehaviour` logging methods and made them static (for non-MonoBehaviours). 133 | 134 | ### v0.4.2 135 | 136 | - Made `CustomBehaviour` logging methods public. 137 | 138 | ### v0.4.1 139 | 140 | - Added `Inverse` method to `Quaternion` extensions. 141 | - Added `CustomBehaviour` class, extending the basic _MonoBehaviour_. 142 | - Added `Log` 143 | - Added `LogWarning` 144 | - Added `LogError` 145 | 146 | - Changed all `Singleton` classes extending `CustomBehaviour` classes. 147 | 148 | ### v0.4.0 149 | 150 | - Fixed namespace for `Coroutines` extensions 151 | - Added `Quaternion` extension methods, more specifally: 152 | - `AverageQuaternions` 153 | - `AverageQuaternionsFast` 154 | - `Normalize` 155 | - `InverseSign` 156 | - `IsClose` 157 | - `Scale` 158 | 159 | ### v0.3.2 160 | 161 | - Fixed `Coroutine`-related classes 162 | - Will implement testing soon to avoid fixes... 163 | 164 | ### v0.3.1 165 | 166 | - Moved `DelayAction` to its own file 167 | 168 | ### v0.3.0 169 | 170 | - Added the following `Coroutine`-related classes: 171 | - `WaitUntilAndForSecondsRealtime` 172 | - `WaitUntilOrForSecondsRealtime` 173 | - `WaitWhileAndForSecondsRealtime` 174 | - `WaitWhileOrForSecondsRealtime` 175 | 176 | ### v0.2.0 177 | 178 | - Fixed all `Singleton` implementations. 179 | 180 | ### v0.1.9 181 | 182 | - Fixed package structure! 183 | 184 | ### v0.1.5 185 | 186 | - Added `ToVector3` to transform a 3-big float array to a _Vector3_. 187 | - Added `Flip` to flip a 2-big float array, so that the values swap indexes. 188 | - Added `ToArray` to transform a _Vector3_ or _Vector2_ to a 3-big or 2-big float array, respectively. 189 | - Some refactoring! 190 | 191 | ### v0.1.4 192 | 193 | - Submitted package to [open upm](https://openupm.com/): it's now approved! 194 | - Added required `.meta` files! 195 | 196 | ### v0.1.3 197 | 198 | - Submitted package to [open upm](https://openupm.com/)! 199 | - Some refactoring too! 200 | 201 | ### v0.1.2 202 | 203 | Long time no see... Sorry, about that! 204 | 205 | - Renamed files for a clearer project 206 | - Added `IsAnimatorPlaying` to check whether an _Animator_ is currently playing an _Animation_ 207 | - Added _Patterns_ folder for useful programming patterns! 208 | - Started setup for [upm](https://openupm.com/) hosting! 209 | 210 | ### 11-06-2021 211 | 212 | - Added `MiscellaneousExtensions` for... miscellaneous extensions like `GeoDistance`! 213 | - Moved miscellaneous section into its own script ^^! 214 | 215 | ### 19-05-2021 216 | 217 | - Removed `ref` keyword (accident, sorry!) 218 | - Changed all namespaces to `UnityUtilities` 219 | - Added `ToVector2` to transform float arrays (of size 2) into a vector 2 220 | - Added `GeoDistanceTo` to calculate distance between two geocoordinates 221 | 222 | ### 26-04-2021 223 | 224 | - Removed `ValueType` method 225 | - Changed all angle related methods to a single one for each use case, i.e. you now have to specify what unit of measure 226 | you are using :) 227 | - All of the `GoUp`, `GoDown`, etc. methods can now be directly used for Transforms as well 228 | - Separated each extension-related methods in their respective files (Numerals, GameObject, Vector, Unity (= Misc.)) 229 | - Removed `double` methods as it's rarely used in Unity 230 | 231 | ### 25-04-2021 232 | 233 | Will probably remove the ValueType function as it can be used with a variety of things and can therefore introduce bugs 234 | 😅 235 | 236 | - Added `DelayAction` 237 | - Added `DestroyImmediate` 238 | - Added `Clamp` (for vectors and floats) 239 | - Added `TransformTo2DVector3` 240 | - Added `ChopTo2DVector3` 241 | - Added `Map` 242 | - Moved all `CsExtensions.cs` functions into UnityExtensions as this is a Unity only extension "pack" 243 | - `Round` now returns Vector3Int and Vector2Int when paramaterless 244 | - Simplified use `FollowMouse2D` and `FollowObject2D` 245 | - Replaced specific value types for `var` 246 | 247 | ### 1-01-2021 248 | 249 | - Added `RoundToInt` 250 | - Added `GoUp` 251 | - Added `GoDown` 252 | - Added `GoLeft` 253 | - Added `GoRight` 254 | - Added `GoForward` 255 | - Added `GoBackward` 256 | - Added `FollowMouse` 257 | - Added `FollowObject2D` 258 | - Expanded `Print` 259 | - Cleaned up README 260 | 261 | ### 1-12-2020 262 | 263 | - Changed solution and project name 264 | - Added some instructions to the README =D 265 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b64b174056f147647b6329f20a7790b4 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------