├── .gitignore ├── Assets ├── Code.meta ├── Code │ ├── AsyncSystem.meta │ ├── AsyncSystem │ │ ├── AsyncSystem.cs │ │ ├── AsyncSystem.cs.meta │ │ ├── StateSystem.cs │ │ ├── StateSystem.cs.meta │ │ ├── Utils.meta │ │ └── Utils │ │ │ ├── IHaveAspect.cs │ │ │ ├── IHaveAspect.cs.meta │ │ │ ├── ModuleExtensions.cs │ │ │ ├── ModuleExtensions.cs.meta │ │ │ ├── ProtoAspectInjectUtil.cs │ │ │ ├── ProtoAspectInjectUtil.cs.meta │ │ │ ├── UiExtensions.cs │ │ │ └── UiExtensions.cs.meta │ ├── GameAspect.cs │ ├── GameAspect.cs.meta │ ├── Lib.meta │ ├── Lib │ │ ├── Proto.meta │ │ ├── Proto │ │ │ └── cs.meta │ │ ├── Routines.meta │ │ ├── Routines │ │ │ ├── Awaiters.meta │ │ │ ├── Awaiters │ │ │ │ ├── ActionAwaiter.cs │ │ │ │ ├── ActionAwaiter.cs.meta │ │ │ │ ├── AllAwaiter.cs │ │ │ │ ├── AllAwaiter.cs.meta │ │ │ │ ├── AnyAwaiter.cs │ │ │ │ ├── AnyAwaiter.cs.meta │ │ │ │ ├── FirstAwaiter.cs │ │ │ │ ├── FirstAwaiter.cs.meta │ │ │ │ ├── ForeverAwaiter.cs │ │ │ │ ├── ForeverAwaiter.cs.meta │ │ │ │ ├── FuncAwaiter.cs │ │ │ │ ├── FuncAwaiter.cs.meta │ │ │ │ ├── ProxyAwaiter.cs │ │ │ │ ├── ProxyAwaiter.cs.meta │ │ │ │ ├── SelfRollbackAwaiter.cs │ │ │ │ ├── SelfRollbackAwaiter.cs.meta │ │ │ │ ├── TryAwaiter.cs │ │ │ │ ├── TryAwaiter.cs.meta │ │ │ │ ├── YieldAwaiter.cs │ │ │ │ ├── YieldAwaiter.cs.meta │ │ │ │ ├── YieldAwaiterTicks.cs │ │ │ │ └── YieldAwaiterTicks.cs.meta │ │ │ ├── Builders.meta │ │ │ ├── Builders │ │ │ │ ├── RoutineBuilder.cs │ │ │ │ ├── RoutineBuilder.cs.meta │ │ │ │ ├── RoutineBuilder_T.cs │ │ │ │ └── RoutineBuilder_T.cs.meta │ │ │ ├── IRoutine.cs │ │ │ ├── IRoutine.cs.meta │ │ │ ├── InternalsVisibleTo.cs │ │ │ ├── InternalsVisibleTo.cs.meta │ │ │ ├── README_ROUTINE.md │ │ │ ├── README_ROUTINE.md.meta │ │ │ ├── Routine.cs │ │ │ ├── Routine.cs.meta │ │ │ ├── RoutineApi.cs │ │ │ ├── RoutineApi.cs.meta │ │ │ ├── Routine_T.cs │ │ │ ├── Routine_T.cs.meta │ │ │ ├── Utils.meta │ │ │ └── Utils │ │ │ │ ├── Asr.cs │ │ │ │ ├── Asr.cs.meta │ │ │ │ ├── CalledOnceGuard.cs │ │ │ │ ├── CalledOnceGuard.cs.meta │ │ │ │ ├── DebugFileInfo.cs │ │ │ │ ├── DebugFileInfo.cs.meta │ │ │ │ ├── InfLoopSafety.cs │ │ │ │ ├── InfLoopSafety.cs.meta │ │ │ │ ├── Option.cs │ │ │ │ ├── Option.cs.meta │ │ │ │ ├── Pool.cs │ │ │ │ ├── Pool.cs.meta │ │ │ │ ├── Utils.cs │ │ │ │ └── Utils.cs.meta │ │ ├── Scope.meta │ │ └── Scope │ │ │ ├── ISafeScope.cs │ │ │ ├── ISafeScope.cs.meta │ │ │ ├── README_SCOPE.md │ │ │ ├── README_SCOPE.md.meta │ │ │ ├── Scope.cs │ │ │ ├── Scope.cs.meta │ │ │ ├── ScopeExtensions.cs │ │ │ └── ScopeExtensions.cs.meta │ ├── SceneContext.cs │ ├── SceneContext.cs.meta │ ├── Startup.cs │ ├── Startup.cs.meta │ ├── SysGameFlow.cs │ ├── SysGameFlow.cs.meta │ ├── SysInitGame.cs │ ├── SysInitGame.cs.meta │ ├── SysUnit.cs │ ├── SysUnit.cs.meta │ ├── UnitView.cs │ └── UnitView.cs.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene.unity │ ├── SampleScene.unity.meta │ ├── Unit.prefab │ └── Unit.prefab.meta ├── TextMesh Pro.meta └── TextMesh Pro │ ├── Fonts.meta │ ├── Fonts │ ├── LiberationSans - OFL.txt │ ├── LiberationSans - OFL.txt.meta │ ├── LiberationSans.ttf │ └── LiberationSans.ttf.meta │ ├── Resources.meta │ ├── Resources │ ├── Fonts & Materials.meta │ ├── Fonts & Materials │ │ ├── LiberationSans SDF - Drop Shadow.mat │ │ ├── LiberationSans SDF - Drop Shadow.mat.meta │ │ ├── LiberationSans SDF - Fallback.asset │ │ ├── LiberationSans SDF - Fallback.asset.meta │ │ ├── LiberationSans SDF - Outline.mat │ │ ├── LiberationSans SDF - Outline.mat.meta │ │ ├── LiberationSans SDF.asset │ │ └── LiberationSans SDF.asset.meta │ ├── LineBreaking Following Characters.txt │ ├── LineBreaking Following Characters.txt.meta │ ├── LineBreaking Leading Characters.txt │ ├── LineBreaking Leading Characters.txt.meta │ ├── Sprite Assets.meta │ ├── Sprite Assets │ │ ├── EmojiOne.asset │ │ └── EmojiOne.asset.meta │ ├── Style Sheets.meta │ ├── Style Sheets │ │ ├── Default Style Sheet.asset │ │ └── Default Style Sheet.asset.meta │ ├── TMP Settings.asset │ └── TMP Settings.asset.meta │ ├── Shaders.meta │ ├── Shaders │ ├── SDFFunctions.hlsl │ ├── SDFFunctions.hlsl.meta │ ├── TMP_Bitmap-Custom-Atlas.shader │ ├── TMP_Bitmap-Custom-Atlas.shader.meta │ ├── TMP_Bitmap-Mobile.shader │ ├── TMP_Bitmap-Mobile.shader.meta │ ├── TMP_Bitmap.shader │ ├── TMP_Bitmap.shader.meta │ ├── TMP_SDF Overlay.shader │ ├── TMP_SDF Overlay.shader.meta │ ├── TMP_SDF SSD.shader │ ├── TMP_SDF SSD.shader.meta │ ├── TMP_SDF-HDRP LIT.shadergraph │ ├── TMP_SDF-HDRP LIT.shadergraph.meta │ ├── TMP_SDF-HDRP UNLIT.shadergraph │ ├── TMP_SDF-HDRP UNLIT.shadergraph.meta │ ├── TMP_SDF-Mobile Masking.shader │ ├── TMP_SDF-Mobile Masking.shader.meta │ ├── TMP_SDF-Mobile Overlay.shader │ ├── TMP_SDF-Mobile Overlay.shader.meta │ ├── TMP_SDF-Mobile SSD.shader │ ├── TMP_SDF-Mobile SSD.shader.meta │ ├── TMP_SDF-Mobile-2-Pass.shader │ ├── TMP_SDF-Mobile-2-Pass.shader.meta │ ├── TMP_SDF-Mobile.shader │ ├── TMP_SDF-Mobile.shader.meta │ ├── TMP_SDF-Surface-Mobile.shader │ ├── TMP_SDF-Surface-Mobile.shader.meta │ ├── TMP_SDF-Surface.shader │ ├── TMP_SDF-Surface.shader.meta │ ├── TMP_SDF-URP Lit.shadergraph │ ├── TMP_SDF-URP Lit.shadergraph.meta │ ├── TMP_SDF-URP Unlit.shadergraph │ ├── TMP_SDF-URP Unlit.shadergraph.meta │ ├── TMP_SDF.shader │ ├── TMP_SDF.shader.meta │ ├── TMP_Sprite.shader │ ├── TMP_Sprite.shader.meta │ ├── TMPro.cginc │ ├── TMPro.cginc.meta │ ├── TMPro_Mobile.cginc │ ├── TMPro_Mobile.cginc.meta │ ├── TMPro_Properties.cginc │ ├── TMPro_Properties.cginc.meta │ ├── TMPro_Surface.cginc │ └── TMPro_Surface.cginc.meta │ ├── Sprites.meta │ └── Sprites │ ├── EmojiOne Attribution.txt │ ├── EmojiOne Attribution.txt.meta │ ├── EmojiOne.json │ ├── EmojiOne.json.meta │ ├── EmojiOne.png │ └── EmojiOne.png.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── MultiplayerManager.asset ├── NavMeshAreas.asset ├── NotificationsSettings.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── ShaderGraphSettings.asset ├── TagManager.asset ├── TimeManager.asset ├── URPProjectSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Leopotam.EcsProto* 2 | Leopotam.EcsProto.QoL* 3 | PerformanceTestRun* 4 | /.utmp 5 | *_DoNotShip/ 6 | *_BackUpThisFolder_ButDontShipItWithYourGame/ 7 | /[Uu]ser[Ss]ettings/ 8 | /[Ll]ibrary/ 9 | /[Tt]emp/ 10 | /[Oo]bj/ 11 | /[Bb]uild/ 12 | /[Bb]uilds/ 13 | /.idea/ 14 | /.gradle/ 15 | /Logs/ 16 | /.vs/ 17 | _TerrainAutoUpgrade* 18 | 19 | build_BackUpThisFolder_ButDontShipItWithYourGame 20 | build_BurstDebugInformation_DoNotShip 21 | 22 | /*.csproj 23 | /*.sln 24 | *.suo 25 | *.user 26 | *.DotSettings 27 | *.apk -------------------------------------------------------------------------------- /Assets/Code.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e6bec1a38d3c3d478a435306306c782 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2f6644b86aef4543b563a49fe8e5dc5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/AsyncSystem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Leopotam.EcsProto; 3 | using Leopotam.EcsProto.QoL; 4 | using Mk.Routines; 5 | 6 | namespace AsyncSystem { 7 | /// 8 | /// Базовый класс для асинхронных систем в ProtoECS. 9 | /// Позволяет писать логику в синтаксисе `async/await`, в рамках сущности попадающей в указанный итератор 10 | /// 11 | /// Тип наследуемой системы. 12 | public abstract class AsyncSystem : IHaveAspect, IProtoRunSystem, IProtoInitSystem, IProtoDestroySystem 13 | where TSelf : AsyncSystem { 14 | _Aspect _self; 15 | Inc _incMode; 16 | 17 | ProtoItExc _routineStart; 18 | Slice<(Routine routine, ProtoPackedEntityWithWorld entity)> _buf = new (); 19 | 20 | public IProtoAspect GetAspect () => new _Aspect (); 21 | 22 | protected abstract Routine Run (ProtoEntity entity); 23 | 24 | protected abstract IProtoIt GetProtoIt (); 25 | 26 | 27 | public void Init (IProtoSystems systems) { 28 | _self = systems.World ().Aspect<_Aspect> (); 29 | var world = _self.World (); 30 | var sourceIt = GetProtoIt (); 31 | if (sourceIt is ProtoIt inc) { 32 | _incMode = new () { 33 | Source = inc, 34 | End = new (new[] { typeof (_Routine) }) 35 | }; 36 | _incMode.Source.Init (world); 37 | _incMode.End.Init (world); 38 | var protoPools = inc.Includes (); 39 | var inc1 = new Type[protoPools.Length]; 40 | for (var i = protoPools.Length - 1; i >= 0; i--) { 41 | inc1[i] = protoPools[i].ItemType (); 42 | } 43 | 44 | _routineStart = new (inc1, It.Exc<_Routine> ()); 45 | } 46 | else { 47 | throw new NotImplementedException (); 48 | } 49 | 50 | _routineStart.Init (world); 51 | 52 | Run (); 53 | } 54 | 55 | public void Run () { 56 | foreach (var e in _routineStart) { 57 | _self._routine.Add (e).Routine = Run (e); 58 | } 59 | 60 | var either = _incMode; 61 | foreach (var e in either.End) { 62 | if (either.Source.Has (e)) { 63 | _buf.Add ((_self._routine.Get (e).Routine, _self._world.PackEntityWithWorld (e))); 64 | } 65 | else { 66 | _self._routine.DelIfExists (e); 67 | } 68 | } 69 | 70 | for (var i = 0; i < _buf.Len (); i++) { 71 | ref var valueTuple = ref _buf.Get (i); 72 | if (!valueTuple.entity.TryUnpack (out _, out _)) { 73 | continue; 74 | } 75 | 76 | valueTuple.routine.Tick (); 77 | } 78 | 79 | _buf.Clear (); 80 | } 81 | 82 | public void Destroy () { 83 | foreach (var e in _incMode.End) { 84 | _self._routine.DelIfExists (e); 85 | } 86 | } 87 | 88 | class _Aspect : IProtoAspect { 89 | public ProtoWorld _world; 90 | public ProtoPool<_Routine> _routine; 91 | 92 | ProtoAspectInjectUtil.Result _res; 93 | 94 | public void Init (ProtoWorld world) { 95 | _res = ProtoAspectInjectUtil.Init (this, world); 96 | Asr.IsTrue (_world == null); 97 | _world = world; 98 | ProtoAspectInjectUtil.GetPool (_world, ref _routine); 99 | } 100 | 101 | public void PostInit () { 102 | ProtoAspectInjectUtil.PostInit (_res); 103 | } 104 | 105 | public ProtoWorld World () { 106 | return _world; 107 | } 108 | } 109 | 110 | class Inc { 111 | public ProtoIt Source; 112 | public ProtoIt End; 113 | } 114 | 115 | struct _Routine : IProtoHandlers<_Routine> { 116 | public Routine Routine; 117 | 118 | public void SetHandlers (IProtoPool<_Routine> pool) { 119 | pool.SetResetHandler (AutoReset); 120 | } 121 | 122 | static void AutoReset (ref _Routine c) { 123 | c.Routine?.Dispose (); 124 | c = default; 125 | } 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/AsyncSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ac7a4d3439433b48a7ee866fec2e875 -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/StateSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f770e3e40604cba924b93134536b0cc 3 | timeCreated: 1749021552 -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eee3341f249aae41a3c11c427dac69a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/IHaveAspect.cs: -------------------------------------------------------------------------------- 1 | using Leopotam.EcsProto; 2 | 3 | namespace AsyncSystem { 4 | public interface IHaveAspect { 5 | public IProtoAspect GetAspect (); 6 | } 7 | } -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/IHaveAspect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 257cfd7107c98784d901b2000785b0d1 -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/ModuleExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Leopotam.EcsProto; 3 | using Leopotam.EcsProto.QoL; 4 | 5 | namespace AsyncSystem.Utils { 6 | public static class ModuleExtensions { 7 | public static void AddSystem (this ProtoModules modules, T system)where T : IProtoSystem { 8 | if (system is IHaveAspect asyncSystem) { 9 | modules.AddAspect (asyncSystem.GetAspect ()); 10 | } 11 | 12 | modules.AddModule (new SystemModule (system)); 13 | } 14 | 15 | public static void AddModulesFrom (this ProtoModules modules, ProtoModules toAdd) { 16 | foreach (var m in toAdd.Modules ()) { 17 | modules.AddModule (m); 18 | } 19 | 20 | modules.AddAspect (toAdd.BuildAspect ()); 21 | } 22 | 23 | // ReSharper disable once UnusedTypeParameter 24 | class SystemModule : IProtoModule { 25 | readonly IProtoSystem _system; 26 | 27 | public SystemModule (IProtoSystem system) { 28 | _system = system; 29 | } 30 | 31 | public void Init (IProtoSystems systems) { 32 | systems.AddSystem (_system); 33 | } 34 | 35 | public IProtoAspect[] Aspects () { 36 | return null; 37 | } 38 | 39 | public Type[] Dependencies () { 40 | return null; 41 | } 42 | 43 | public IProtoModule[] Modules () { 44 | return null; 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/ModuleExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83958bcb4e4d456ea0e36f2aec646517 3 | timeCreated: 1739715296 -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/ProtoAspectInjectUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cdd366911ba05d4dae613f5c49c18e6 -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/UiExtensions.cs: -------------------------------------------------------------------------------- 1 | using Mk.Routines; 2 | using Mk.Scopes; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | using UnityEngine.UI; 6 | 7 | namespace AsyncSystem.Utils { 8 | static class UiExtensions { 9 | public static void AddListenerScoped (this UnityEvent e, ISafeScope scope, UnityAction callback) { 10 | e.AddListener (callback); 11 | scope.Add (() => e.RemoveListener (callback)); 12 | } 13 | 14 | public static void SetActiveScoped (this GameObject e, ISafeScope scope, bool value) { 15 | if (e.activeSelf == value) { 16 | return; 17 | } 18 | 19 | e.SetActive (value); 20 | scope.Add (() => e.SetActive (!value)); 21 | } 22 | 23 | public static async Routine WaitForClick (this Button button) { 24 | var clicked = false; 25 | var scope = await Routine.GetScope (); 26 | button.onClick.AddListenerScoped (scope, () => clicked = true); 27 | 28 | await Routine.When (() => clicked); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/Code/AsyncSystem/Utils/UiExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed98eb78dfbf4f1f8a3cf96554cbedf9 3 | timeCreated: 1739719286 -------------------------------------------------------------------------------- /Assets/Code/GameAspect.cs: -------------------------------------------------------------------------------- 1 | using Leopotam.EcsProto; 2 | using Leopotam.EcsProto.QoL; 3 | 4 | struct CGame { } 5 | 6 | struct CUnit { 7 | public int Health; 8 | } 9 | 10 | class GameAspect : ProtoAspectInject { 11 | public ProtoPool CUnit = default; 12 | public ProtoPool CGame = default; 13 | 14 | public ProtoIt UnitIt = new (It.Inc ()); 15 | } -------------------------------------------------------------------------------- /Assets/Code/GameAspect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8cfd1c1461344f09f0cbad7379d9c71 3 | timeCreated: 1739720751 -------------------------------------------------------------------------------- /Assets/Code/Lib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4153765a19f2e384ca1f94abc5858263 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Proto.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed9778619ff432c4da394e1e561e6582 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Proto/cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f29d4ca29ba0e04b899b246ac93b7ad 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c889601d0a59dd42816b823f83eab5e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c1ec2f333ba7014f9f301a0c12bb266 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ActionAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using Mk.Scopes; 9 | 10 | namespace Mk.Routines { 11 | #line hidden 12 | public class ActionAwaiter : IRoutine, ICriticalNotifyCompletion { 13 | public Func DoWhile; 14 | public Action OnUpdate; 15 | public Action BeforeDispose; 16 | public Action OnStart; 17 | Scope _scope; 18 | bool _started; 19 | 20 | public ActionAwaiter () { } 21 | 22 | void IDisposable.Dispose () { 23 | IsCompleted = true; 24 | BeforeDispose?.Invoke (); 25 | _scope?.Dispose (); 26 | } 27 | 28 | void IRoutine.UpdateParent () { 29 | if (Utils.TrySetNull (ref _continuation, out var c)) { 30 | c.Invoke (); 31 | } 32 | } 33 | 34 | void IRoutine.Tick () { 35 | if (IsCompleted) { 36 | return; 37 | } 38 | 39 | if (DoWhile != null && !DoWhile.Invoke ()) { 40 | this.DisposeAndUpdateParent (); 41 | return; 42 | } 43 | 44 | if (!_started) { 45 | _started = true; 46 | if (OnStart != null) { 47 | _scope = new (); 48 | OnStart.Invoke (_scope); 49 | } 50 | } 51 | 52 | OnUpdate?.Invoke (); 53 | } 54 | 55 | #region async 56 | 57 | Action _continuation; 58 | 59 | public ActionAwaiter GetAwaiter () { 60 | return this; 61 | } 62 | 63 | public void GetResult () { } 64 | 65 | public void OnCompleted (Action continuation) { 66 | if (IsCompleted) { 67 | continuation.Invoke (); 68 | return; 69 | } 70 | 71 | Asr.IsTrue (_continuation == null); 72 | _continuation = continuation; 73 | } 74 | 75 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 76 | 77 | public bool IsCompleted { get; private set; } 78 | 79 | #endregion 80 | } 81 | #line default 82 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ActionAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e31c0b238fb64c3c89d1aac576457631 3 | timeCreated: 1618072301 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/AllAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Runtime.CompilerServices; 9 | using JetBrains.Annotations; 10 | 11 | namespace Mk.Routines { 12 | #line hidden 13 | public class AllAwaiter : IRoutine, ICriticalNotifyCompletion { 14 | public IReadOnlyList Args; 15 | Action _continuation; 16 | 17 | public void Dispose () { 18 | if (IsCompleted) return; 19 | IsCompleted = true; 20 | foreach (var u in Args) u.Dispose (); 21 | } 22 | 23 | public void UpdateParent () { 24 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 25 | } 26 | 27 | public void Tick () { 28 | if (IsCompleted) return; 29 | 30 | var all = true; 31 | for (var index = 0; index < Args.Count; index++) { 32 | var u = Args[index]; 33 | u.Tick (); 34 | all &= u.IsCompleted; 35 | } 36 | 37 | if (all) { 38 | this.DisposeAndUpdateParent (); 39 | } 40 | } 41 | 42 | #region async 43 | 44 | [UsedImplicitly] 45 | public AllAwaiter GetAwaiter () { 46 | return this; 47 | } 48 | 49 | [UsedImplicitly] 50 | public void GetResult () { } 51 | 52 | [UsedImplicitly] 53 | public void OnCompleted (Action continuation) { 54 | if (IsCompleted) { 55 | continuation.Invoke (); 56 | return; 57 | } 58 | 59 | Asr.IsTrue (_continuation == null); 60 | _continuation = continuation; 61 | } 62 | 63 | [UsedImplicitly] 64 | public void UnsafeOnCompleted (Action continuation) { 65 | OnCompleted (continuation); 66 | } 67 | 68 | [UsedImplicitly] 69 | public bool IsCompleted { get; private set; } 70 | 71 | #endregion 72 | } 73 | #line default 74 | #line hidden 75 | public class AllAwaiter : IRoutine>>, ICriticalNotifyCompletion { 76 | public IReadOnlyList> Args; 77 | 78 | Action _continuation; 79 | 80 | public void Dispose () { 81 | if (IsCompleted) return; 82 | IsCompleted = true; 83 | foreach (var u in Args) u.Dispose (); 84 | } 85 | 86 | public void UpdateParent () { 87 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 88 | } 89 | 90 | public void Tick () { 91 | if (IsCompleted) return; 92 | 93 | var all = true; 94 | for (var index = 0; index < Args.Count; index++) { 95 | var u = Args[index]; 96 | u.Tick (); 97 | all &= u.IsCompleted; 98 | } 99 | 100 | if (all) { 101 | this.DisposeAndUpdateParent (); 102 | } 103 | } 104 | 105 | #region async 106 | 107 | [UsedImplicitly] 108 | public AllAwaiter GetAwaiter () { 109 | return this; 110 | } 111 | 112 | [UsedImplicitly] 113 | public IReadOnlyList> GetResult() 114 | { 115 | return Args; 116 | 117 | } 118 | 119 | [UsedImplicitly] 120 | public void OnCompleted (Action continuation) { 121 | if (IsCompleted) { 122 | continuation.Invoke (); 123 | return; 124 | } 125 | 126 | Asr.IsTrue (_continuation == null); 127 | _continuation = continuation; 128 | } 129 | 130 | [UsedImplicitly] 131 | public void UnsafeOnCompleted (Action continuation) { 132 | OnCompleted (continuation); 133 | } 134 | 135 | [UsedImplicitly] 136 | public bool IsCompleted { get; private set; } 137 | 138 | #endregion 139 | } 140 | #line default 141 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/AllAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 359c7ebaf9a04407ac31e91f9e7a54c6 3 | timeCreated: 1602582178 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/AnyAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Runtime.CompilerServices; 9 | using JetBrains.Annotations; 10 | 11 | namespace Mk.Routines { 12 | #line hidden 13 | public class AnyAwaiter : IRoutine>, ICriticalNotifyCompletion { 14 | public IReadOnlyList Args; 15 | bool[] _result; 16 | Action _continuation; 17 | 18 | public void Dispose () { 19 | if (IsCompleted) return; 20 | IsCompleted = true; 21 | foreach (var u in Args) u.Dispose (); 22 | } 23 | 24 | public void UpdateParent () { 25 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 26 | } 27 | 28 | public void Tick () { 29 | if (IsCompleted) return; 30 | 31 | var any = false; 32 | for (var index = 0; index < Args.Count; index++) { 33 | var u = Args[index]; 34 | u.Tick (); 35 | _result[index] = u.IsCompleted; 36 | any |= u.IsCompleted; 37 | } 38 | 39 | if (any) { 40 | this.DisposeAndUpdateParent (); 41 | } 42 | } 43 | 44 | #region async 45 | 46 | CalledOnceGuard _guard; 47 | 48 | [UsedImplicitly] 49 | public AnyAwaiter GetAwaiter () { 50 | _result = new bool[Args.Count]; 51 | _guard.Assert (); 52 | return this; 53 | } 54 | 55 | [UsedImplicitly] 56 | public IReadOnlyList GetResult () { 57 | return _result; 58 | } 59 | 60 | [UsedImplicitly] 61 | public void OnCompleted (Action continuation) { 62 | if (IsCompleted) { 63 | continuation.Invoke (); 64 | return; 65 | } 66 | 67 | Asr.IsTrue (_continuation == null); 68 | _continuation = continuation; 69 | } 70 | 71 | [UsedImplicitly] 72 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 73 | 74 | [UsedImplicitly] 75 | public bool IsCompleted { get; private set; } 76 | 77 | #endregion 78 | } 79 | public class AnyAwaiter : IRoutine[]>, ICriticalNotifyCompletion { 80 | public IRoutine[] Args; 81 | Action _continuation; 82 | 83 | public void Dispose () { 84 | if (IsCompleted) return; 85 | IsCompleted = true; 86 | foreach (var u in Args) u.Dispose (); 87 | } 88 | 89 | public void UpdateParent () { 90 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 91 | } 92 | 93 | public void Tick () { 94 | if (IsCompleted) return; 95 | 96 | var any = false; 97 | for (var index = 0; index < Args.Length; index++) { 98 | ref var result = ref Args[index]; 99 | result.Tick (); 100 | // result.Item1 = result.Item2.IsCompleted; 101 | any |= result.IsCompleted; 102 | } 103 | 104 | if (any) { 105 | this.DisposeAndUpdateParent (); 106 | } 107 | } 108 | 109 | #region async 110 | 111 | CalledOnceGuard _guard; 112 | 113 | [UsedImplicitly] 114 | public AnyAwaiter GetAwaiter () { 115 | _guard.Assert (); 116 | return this; 117 | } 118 | 119 | [UsedImplicitly] 120 | public IRoutine[] GetResult () { 121 | return Args; 122 | } 123 | 124 | [UsedImplicitly] 125 | public void OnCompleted (Action continuation) { 126 | if (IsCompleted) { 127 | continuation.Invoke (); 128 | return; 129 | } 130 | 131 | Asr.IsTrue (_continuation == null); 132 | _continuation = continuation; 133 | } 134 | 135 | [UsedImplicitly] 136 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 137 | 138 | [UsedImplicitly] 139 | public bool IsCompleted { get; private set; } 140 | 141 | #endregion 142 | } 143 | #line default 144 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/AnyAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c573c91d0a6449cb413ccb09c8d6ad2 3 | timeCreated: 1602582112 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/FirstAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Runtime.CompilerServices; 9 | using JetBrains.Annotations; 10 | 11 | namespace Mk.Routines { 12 | #line hidden 13 | public class FirstAwaiter : IRoutine, ICriticalNotifyCompletion { 14 | public IReadOnlyList Args; 15 | Action _continuation; 16 | bool _has; 17 | int _index; 18 | 19 | public void Dispose () { 20 | if (IsCompleted) return; 21 | IsCompleted = true; 22 | foreach (var u in Args) u.Dispose (); 23 | } 24 | 25 | public void UpdateParent () { 26 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 27 | } 28 | 29 | public void Tick () { 30 | if (IsCompleted) return; 31 | 32 | var any = false; 33 | for (var index = 0; index < Args.Count; index++) { 34 | var u = Args[index]; 35 | u.Tick (); 36 | if (!_has && u.IsCompleted) { 37 | _has = true; 38 | _index = index; 39 | } 40 | 41 | any |= u.IsCompleted; 42 | } 43 | 44 | if (any) { 45 | this.DisposeAndUpdateParent (); 46 | } 47 | } 48 | 49 | #region async 50 | 51 | CalledOnceGuard _guard; 52 | 53 | [UsedImplicitly] 54 | public FirstAwaiter GetAwaiter () { 55 | _guard.Assert (); 56 | return this; 57 | } 58 | 59 | [UsedImplicitly] 60 | public int GetResult () { 61 | Asr.IsTrue (_has); 62 | return _index; 63 | } 64 | 65 | [UsedImplicitly] 66 | public void OnCompleted (Action continuation) { 67 | if (IsCompleted) { 68 | continuation.Invoke (); 69 | return; 70 | } 71 | 72 | Asr.IsTrue (_continuation == null); 73 | _continuation = continuation; 74 | } 75 | 76 | [UsedImplicitly] 77 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 78 | 79 | [UsedImplicitly] 80 | public bool IsCompleted { get; private set; } 81 | 82 | #endregion 83 | } 84 | 85 | public class FirstAwaiter : IRoutine, ICriticalNotifyCompletion { 86 | public IReadOnlyList> Args; 87 | Action _continuation; 88 | T _result; 89 | bool _has; 90 | 91 | public void Dispose () { 92 | if (IsCompleted) return; 93 | IsCompleted = true; 94 | foreach (var u in Args) u.Dispose (); 95 | } 96 | 97 | public void UpdateParent () { 98 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 99 | } 100 | 101 | public void Tick () { 102 | if (IsCompleted) return; 103 | 104 | var any = false; 105 | for (var index = 0; index < Args.Count; index++) { 106 | var u = Args[index]; 107 | u.Tick (); 108 | if (!_has && u.IsCompleted) { 109 | _has = true; 110 | _result = u.GetResult (); 111 | } 112 | 113 | any |= u.IsCompleted; 114 | } 115 | 116 | if (any) { 117 | this.DisposeAndUpdateParent (); 118 | } 119 | } 120 | 121 | #region async 122 | 123 | CalledOnceGuard _guard; 124 | 125 | [UsedImplicitly] 126 | public FirstAwaiter GetAwaiter () { 127 | _guard.Assert (); 128 | return this; 129 | } 130 | 131 | [UsedImplicitly] 132 | public T GetResult () { 133 | Asr.IsTrue (_has); 134 | return _result; 135 | } 136 | 137 | [UsedImplicitly] 138 | public void OnCompleted (Action continuation) { 139 | if (IsCompleted) { 140 | continuation.Invoke (); 141 | return; 142 | } 143 | 144 | Asr.IsTrue (_continuation == null); 145 | _continuation = continuation; 146 | } 147 | 148 | [UsedImplicitly] 149 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 150 | 151 | [UsedImplicitly] 152 | public bool IsCompleted { get; private set; } 153 | 154 | #endregion 155 | } 156 | #line default 157 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/FirstAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 123d5e866c814895acb4661c26fe4600 3 | timeCreated: 1613069565 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ForeverAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using JetBrains.Annotations; 9 | 10 | namespace Mk.Routines { 11 | public class ForeverAwaiter : IRoutine, ICriticalNotifyCompletion { 12 | public static ForeverAwaiter Instance { get; } = new (); 13 | 14 | ForeverAwaiter() { } 15 | 16 | public void UpdateParent() { } 17 | public void Tick() { } 18 | public void Dispose() { } 19 | 20 | #region async 21 | 22 | [UsedImplicitly] 23 | public bool IsCompleted { get; } = false; 24 | 25 | [UsedImplicitly] 26 | public void GetResult() { } 27 | 28 | [UsedImplicitly] 29 | public void OnCompleted(Action _) { } 30 | 31 | [UsedImplicitly] 32 | public void UnsafeOnCompleted(Action _) { } 33 | 34 | [UsedImplicitly] 35 | public ForeverAwaiter GetAwaiter() => this; 36 | 37 | #endregion 38 | } 39 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ForeverAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c48ee13fd8341b8987d0e0b80bc89be 3 | timeCreated: 1591815743 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/FuncAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using JetBrains.Annotations; 9 | 10 | namespace Mk.Routines { 11 | #line hidden 12 | public class FuncAwaiter : IRoutine, ICriticalNotifyCompletion where T : IOption { 13 | public Func TryGet; 14 | public Action OnDispose; 15 | Action _continuation; 16 | T _cached; 17 | 18 | public void Dispose () { 19 | if (IsCompleted) return; 20 | IsCompleted = true; 21 | OnDispose?.Invoke (); 22 | } 23 | 24 | void IRoutine.UpdateParent () { 25 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 26 | } 27 | 28 | public void Tick () { 29 | if (IsCompleted) return; 30 | 31 | _cached = TryGet.Invoke (); 32 | if (_cached.HasValue) { 33 | this.DisposeAndUpdateParent (); 34 | } 35 | } 36 | 37 | #region async 38 | 39 | CalledOnceGuard _guard; 40 | 41 | [UsedImplicitly] 42 | public FuncAwaiter GetAwaiter () { 43 | _guard.Assert (); 44 | return this; 45 | } 46 | 47 | [UsedImplicitly] 48 | public bool IsCompleted { get; private set; } 49 | 50 | [UsedImplicitly] 51 | public T GetResult () => _cached; 52 | 53 | [UsedImplicitly] 54 | public void OnCompleted (Action continuation) { 55 | if (IsCompleted) { 56 | continuation.Invoke (); 57 | return; 58 | } 59 | 60 | Asr.IsTrue (_continuation == null); 61 | _continuation = continuation; 62 | } 63 | 64 | [UsedImplicitly] 65 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 66 | 67 | #endregion 68 | } 69 | #line default 70 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/FuncAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3865ef35b90a4eb8aadeb96c0b32cc53 3 | timeCreated: 1628312147 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ProxyAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Reflection; 8 | using System.Runtime.CompilerServices; 9 | using Mk.Scopes; 10 | 11 | namespace Mk.Routines { 12 | #line hidden 13 | public class ProxyAwaiter : IRoutine, ICriticalNotifyCompletion { 14 | public Func DoWhile; 15 | public Action OnStart; 16 | public Action OnBreak; 17 | public Action BeforeUpdate; 18 | public Action AfterUpdate; 19 | public Action BeforeDispose; 20 | internal IRoutine Main; 21 | bool _started; 22 | Scope _scope; 23 | 24 | void IDisposable.Dispose () { 25 | IsCompleted = true; 26 | BeforeDispose?.Invoke (); 27 | Main.Dispose (); 28 | _scope?.Dispose (); 29 | } 30 | 31 | void IRoutine.UpdateParent () { 32 | Main.UpdateParent (); 33 | if (Utils.TrySetNull (ref _continuation, out var c)) { 34 | c.Invoke (); 35 | } 36 | } 37 | 38 | void IRoutine.Tick () { 39 | if (IsCompleted) { 40 | return; 41 | } 42 | 43 | if (DoWhile != null && !DoWhile.Invoke ()) { 44 | OnBreak?.Invoke (); 45 | this.DisposeAndUpdateParent (); 46 | return; 47 | } 48 | 49 | if (!_started) { 50 | _started = true; 51 | if (OnStart != null) { 52 | _scope = new (); 53 | _scope.Add (Main.Dispose); 54 | OnStart.Invoke (_scope); 55 | } 56 | } 57 | 58 | 59 | BeforeUpdate?.Invoke (); 60 | Main.Tick (); 61 | if (Main.IsCompleted) { 62 | this.DisposeAndUpdateParent (); 63 | return; 64 | } 65 | 66 | // todo bug: afterUpdate got called after disposal 67 | AfterUpdate?.Invoke (); 68 | } 69 | 70 | #region async 71 | 72 | CalledOnceGuard _guard; 73 | Action _continuation; 74 | 75 | public ProxyAwaiter GetAwaiter () { 76 | _guard.Assert (); 77 | return this; 78 | } 79 | 80 | public void GetResult () { } 81 | 82 | public void OnCompleted (Action continuation) { 83 | if (IsCompleted) { 84 | continuation.Invoke (); 85 | return; 86 | } 87 | 88 | Asr.IsTrue (_continuation == null); 89 | _continuation = continuation; 90 | // Main.OnCompleted(continuation); 91 | } 92 | 93 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 94 | 95 | public bool IsCompleted { get; private set; } 96 | 97 | #endregion 98 | } 99 | 100 | public class ProxyAwaiter : IRoutine, ICriticalNotifyCompletion { 101 | public Action BeforeUpdateAction; 102 | public Action BeforeDisposeAction; 103 | public Action AfterUpdateAction; 104 | public IRoutine MainRoutine; 105 | 106 | Action _continuation; 107 | 108 | public void Dispose () { 109 | IsCompleted = true; 110 | BeforeDisposeAction?.Invoke (); 111 | MainRoutine.Dispose (); 112 | } 113 | 114 | public void UpdateParent () { 115 | MainRoutine.UpdateParent (); 116 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 117 | } 118 | 119 | public void Tick () { 120 | if (IsCompleted) return; 121 | 122 | BeforeUpdateAction?.Invoke (); 123 | MainRoutine.Tick (); 124 | if (MainRoutine.IsCompleted) { 125 | this.DisposeAndUpdateParent (); 126 | return; 127 | } 128 | 129 | AfterUpdateAction?.Invoke (); 130 | } 131 | 132 | #region async 133 | 134 | public ProxyAwaiter GetAwaiter () => this; 135 | 136 | public T GetResult () { 137 | return MainRoutine.GetResult (); 138 | } 139 | 140 | public void OnCompleted (Action continuation) { 141 | if (IsCompleted) { 142 | continuation.Invoke (); 143 | return; 144 | } 145 | 146 | Asr.IsTrue (_continuation == null); 147 | _continuation = continuation; 148 | // MainRoutine.OnCompleted(continuation); 149 | } 150 | 151 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 152 | 153 | public bool IsCompleted { get; private set; } 154 | 155 | #endregion 156 | } 157 | #line default 158 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/ProxyAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49e995903d51479f90422edf9cf0b460 3 | timeCreated: 1602583413 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/SelfRollbackAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Runtime.CompilerServices; 9 | using JetBrains.Annotations; 10 | using Mk.Scopes; 11 | using UnityEngine; 12 | 13 | namespace Mk.Routines { 14 | [Serializable] 15 | public class AttachedRoutines { 16 | [SerializeReference] internal List Routines = new (); 17 | 18 | public void AttachUpdate (Action action) { 19 | Attach (Routine.FromActions (action)); 20 | } 21 | 22 | public void Attach (IRoutine r) { 23 | Routines.Add (r); 24 | r.Tick (); // todo ? 25 | } 26 | 27 | public void AttachScoped (ISafeScope scope, IRoutine r) { 28 | Attach (r); 29 | scope.Add (() => { 30 | r.Dispose (); 31 | Detach (r); 32 | }); 33 | } 34 | 35 | public void Detach (IRoutine r) { 36 | Routines.Remove (r); 37 | } 38 | } 39 | 40 | public class SelfParallelAwaiter : IRoutine, ICriticalNotifyCompletion { 41 | internal AttachedRoutines Value; 42 | public void UpdateParent () { } 43 | public void Tick () { } 44 | public void Dispose () { } 45 | 46 | #region async 47 | 48 | CalledOnceGuard _guard; 49 | 50 | [UsedImplicitly] 51 | public SelfParallelAwaiter GetAwaiter () { 52 | _guard.Assert (); 53 | return this; 54 | } 55 | 56 | [UsedImplicitly] 57 | public bool IsCompleted { [UsedImplicitly] get; private set; } 58 | 59 | [UsedImplicitly] 60 | public AttachedRoutines GetResult () => Value; 61 | 62 | [UsedImplicitly] 63 | public void OnCompleted (Action continuation) => IsCompleted = true; 64 | 65 | [UsedImplicitly] 66 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 67 | 68 | #endregion 69 | } 70 | 71 | public class SelfRollbackAwaiter : IRoutine, ICriticalNotifyCompletion { 72 | internal Scope Value; 73 | public void UpdateParent () { } 74 | public void Tick () { } 75 | public void Dispose () { } 76 | 77 | #region async 78 | 79 | CalledOnceGuard _guard; 80 | 81 | [UsedImplicitly] 82 | public SelfRollbackAwaiter GetAwaiter () { 83 | _guard.Assert (); 84 | return this; 85 | } 86 | 87 | [UsedImplicitly] 88 | public bool IsCompleted { [UsedImplicitly] get; private set; } 89 | 90 | [UsedImplicitly] 91 | public Scope GetResult () => Value; 92 | 93 | [UsedImplicitly] 94 | public void OnCompleted (Action continuation) => IsCompleted = true; 95 | 96 | [UsedImplicitly] 97 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 98 | 99 | #endregion 100 | } 101 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/SelfRollbackAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cad0a02d4a28c95498e3cd17de17a249 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/TryAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using JetBrains.Annotations; 9 | 10 | namespace Mk.Routines { 11 | #line hidden 12 | public class TryAwaiter : IRoutine, ICriticalNotifyCompletion { 13 | public Func TryGet; 14 | public Action OnDispose; 15 | Action _continuation; 16 | 17 | public void Dispose () { 18 | if (IsCompleted) return; 19 | IsCompleted = true; 20 | OnDispose?.Invoke (); 21 | } 22 | 23 | void IRoutine.UpdateParent () { 24 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 25 | } 26 | 27 | public void Tick () { 28 | if (IsCompleted) return; 29 | if (!TryGet.Invoke ()) return; 30 | this.DisposeAndUpdateParent (); 31 | } 32 | 33 | #region async 34 | 35 | CalledOnceGuard _guard; 36 | 37 | [UsedImplicitly] 38 | public TryAwaiter GetAwaiter () { 39 | _guard.Assert (); 40 | return this; 41 | } 42 | 43 | [UsedImplicitly] 44 | public bool IsCompleted { get; private set; } 45 | 46 | [UsedImplicitly] 47 | public void GetResult () { } 48 | 49 | [UsedImplicitly] 50 | public void OnCompleted (Action continuation) { 51 | if (IsCompleted) { 52 | continuation.Invoke (); 53 | return; 54 | } 55 | 56 | Asr.IsTrue (_continuation == null); 57 | _continuation = continuation; 58 | } 59 | 60 | [UsedImplicitly] 61 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 62 | 63 | #endregion 64 | } 65 | 66 | public class TryAwaiter : IRoutine, ICriticalNotifyCompletion { 67 | public Func> TryGet; 68 | public Action OnDispose; 69 | Action _continuation; 70 | Option _cached; 71 | 72 | public void Dispose () { 73 | if (IsCompleted) return; 74 | IsCompleted = true; 75 | OnDispose?.Invoke (); 76 | } 77 | 78 | void IRoutine.UpdateParent () { 79 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 80 | } 81 | 82 | public void Tick () { 83 | if (IsCompleted) return; 84 | 85 | _cached = TryGet.Invoke (); 86 | if (_cached.HasValue) { 87 | this.DisposeAndUpdateParent (); 88 | } 89 | } 90 | 91 | #region async 92 | 93 | CalledOnceGuard _guard; 94 | 95 | [UsedImplicitly] 96 | public TryAwaiter GetAwaiter () { 97 | _guard.Assert (); 98 | return this; 99 | } 100 | 101 | [UsedImplicitly] 102 | public bool IsCompleted { get; private set; } 103 | 104 | [UsedImplicitly] 105 | public T GetResult () => _cached.GetUnsafe (); 106 | 107 | [UsedImplicitly] 108 | public void OnCompleted (Action continuation) { 109 | if (IsCompleted) { 110 | continuation.Invoke (); 111 | return; 112 | } 113 | 114 | Asr.IsTrue (_continuation == null); 115 | _continuation = continuation; 116 | } 117 | 118 | [UsedImplicitly] 119 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 120 | 121 | #endregion 122 | } 123 | #line default 124 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/TryAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4450b08d959447d932a159160578cf2 3 | timeCreated: 1600683706 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/YieldAwaiter.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using JetBrains.Annotations; 9 | 10 | namespace Mk.Routines { 11 | #line hidden 12 | public class YieldAwaiter : IRoutine, ICriticalNotifyCompletion { 13 | internal static Pool Pool = new (() => new (), awaiter => { }, onPop: a => a.Reset ()); 14 | bool _updatedOnce; 15 | Action _continuation; 16 | 17 | public void Dispose () { 18 | if (!IsCompleted) { 19 | IsCompleted = true; 20 | Pool.Push (this); 21 | } 22 | } 23 | 24 | void Reset () { 25 | _updatedOnce = false; 26 | IsCompleted = false; 27 | _continuation = default; 28 | _guard = default; 29 | } 30 | 31 | public void UpdateParent () { 32 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 33 | } 34 | 35 | public void Tick () { 36 | if (!_updatedOnce) { 37 | _updatedOnce = true; 38 | return; 39 | } 40 | 41 | if (IsCompleted) return; 42 | this.DisposeAndUpdateParent (); 43 | } 44 | 45 | #region async 46 | 47 | [UsedImplicitly] 48 | public bool IsCompleted { get; private set; } 49 | 50 | [UsedImplicitly] 51 | public void GetResult () { } 52 | 53 | CalledOnceGuard _guard; 54 | 55 | [UsedImplicitly] 56 | public YieldAwaiter GetAwaiter () { 57 | _guard.Assert (); 58 | return this; 59 | } 60 | 61 | [UsedImplicitly] 62 | public void OnCompleted (Action continuation) { 63 | if (IsCompleted) { 64 | continuation.Invoke (); 65 | return; 66 | } 67 | 68 | Asr.IsTrue (_continuation == null); 69 | _continuation = continuation; 70 | } 71 | 72 | [UsedImplicitly] 73 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 74 | 75 | #endregion 76 | } 77 | #line default 78 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/YieldAwaiter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d70230daa3c4975b6a73c2191e37272 3 | timeCreated: 1590181076 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/YieldAwaiterTicks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using JetBrains.Annotations; 4 | 5 | namespace Mk.Routines 6 | { 7 | public class YieldAwaiterTicks : IRoutine, ICriticalNotifyCompletion { 8 | int _updatedCount; 9 | readonly int _targetCount; 10 | Action _continuation; 11 | 12 | public YieldAwaiterTicks(int targetCount) { 13 | Asr.IsTrue(targetCount > 0); 14 | _targetCount = targetCount; 15 | } 16 | 17 | public void Dispose () { 18 | if (!IsCompleted) { 19 | IsCompleted = true; 20 | } 21 | } 22 | 23 | public void UpdateParent () { 24 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 25 | } 26 | 27 | public void Tick () 28 | { 29 | _updatedCount += 1; 30 | if (_updatedCount <= _targetCount) { 31 | return; 32 | } 33 | 34 | if (IsCompleted) return; 35 | this.DisposeAndUpdateParent (); 36 | } 37 | 38 | #region async 39 | 40 | [UsedImplicitly] 41 | public bool IsCompleted { get; private set; } 42 | 43 | [UsedImplicitly] 44 | public void GetResult () { } 45 | 46 | CalledOnceGuard _guard; 47 | 48 | [UsedImplicitly] 49 | public YieldAwaiterTicks GetAwaiter () { 50 | _guard.Assert (); 51 | return this; 52 | } 53 | 54 | [UsedImplicitly] 55 | public void OnCompleted (Action continuation) { 56 | if (IsCompleted) { 57 | continuation.Invoke (); 58 | return; 59 | } 60 | 61 | Asr.IsTrue (_continuation == null); 62 | _continuation = continuation; 63 | } 64 | 65 | [UsedImplicitly] 66 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 67 | 68 | #endregion 69 | } 70 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Awaiters/YieldAwaiterTicks.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd075a3557ec47359fbc8db92b45d90c 3 | timeCreated: 1703152899 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Builders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c54ca22fd5c0e424a9edee74b7f7ad8c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Builders/RoutineBuilder.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using System.Security; 9 | using JetBrains.Annotations; 10 | using Mk; 11 | using Mk.Routines; 12 | using Mk.Scopes; 13 | using UnityEngine; 14 | 15 | 16 | namespace Mk.Routines { 17 | #line hidden 18 | 19 | public class RoutineBuilder { 20 | static DebugFileInfo _lineCache = new (); 21 | Action _continuation; 22 | Scope _taskScope; 23 | 24 | [UsedImplicitly] 25 | public Routine Task { get; } 26 | 27 | RoutineBuilder (Routine r) { 28 | // Dbg.Line (); 29 | Task = r; 30 | } 31 | 32 | [UsedImplicitly] 33 | public static RoutineBuilder Create () { 34 | var task = new Routine (); 35 | var res = new RoutineBuilder (task); 36 | return res; 37 | } 38 | 39 | [UsedImplicitly] 40 | public void Start (ref TStateMachine stateMachine) 41 | where TStateMachine : IAsyncStateMachine { 42 | _continuation = stateMachine.MoveNext; 43 | Task.Start = _continuation; 44 | // _continuation.Invoke(); 45 | } 46 | 47 | 48 | [UsedImplicitly] 49 | public void AwaitOnCompleted (ref TAwaiter awaiter, ref TStateMachine stateMachine) 50 | where TAwaiter : INotifyCompletion, IRoutine 51 | where TStateMachine : IAsyncStateMachine { 52 | switch (awaiter) { 53 | case SelfParallelAwaiter attachedRoutinesAwaiter: 54 | if (!Task.AttachedRoutines.TryGet (out var value)) { 55 | value = new (); 56 | Task.AttachedRoutines = value; 57 | } 58 | 59 | attachedRoutinesAwaiter.Value = value; 60 | stateMachine.MoveNext (); 61 | attachedRoutinesAwaiter.OnCompleted (default); 62 | return; 63 | case SelfRollbackAwaiter selfScopeAwaiter: 64 | if (_taskScope == null) _taskScope = Task.TaskScope = new (); 65 | Task.TaskScope.Add (Task.Dispose); 66 | selfScopeAwaiter.Value = _taskScope; 67 | stateMachine.MoveNext (); 68 | selfScopeAwaiter.OnCompleted (default); 69 | return; 70 | } 71 | 72 | awaiter.OnCompleted (_continuation); 73 | Task.CurrentAwaiter = awaiter; 74 | awaiter.Tick (); 75 | #if MK_TRACE 76 | _lineCache.SetDebugName (ref Task.__Await, 2); 77 | #endif 78 | } 79 | 80 | [UsedImplicitly] 81 | public void SetResult () { 82 | #if MK_TRACE 83 | _lineCache.SetDebugName (ref Task.__Await, 1); 84 | Task.__Await = $"[Returned at] {Task.__Await}"; 85 | #endif 86 | Task.DisposeAndUpdateParent (); 87 | } 88 | 89 | #line hidden 90 | [UsedImplicitly] 91 | public void SetException (Exception e) { 92 | #if MK_TRACE 93 | _lineCache.SetDebugName (ref Task.__Await, 1); 94 | Task.__Await = $"[Exception at] {e.Message} {Task.__Await}"; 95 | #endif 96 | Debug.LogException (e); 97 | Task.Dispose (); 98 | // Task.BreakAndUpdateParent (); 99 | } 100 | #line default 101 | 102 | [UsedImplicitly] 103 | [SecuritySafeCritical,] 104 | public void AwaitUnsafeOnCompleted (ref TAwaiter awaiter, ref TStateMachine stateMachine) 105 | where TAwaiter : ICriticalNotifyCompletion, IRoutine 106 | where TStateMachine : IAsyncStateMachine { 107 | AwaitOnCompleted (ref awaiter, ref stateMachine); 108 | } 109 | 110 | [UsedImplicitly] 111 | public void SetStateMachine (IAsyncStateMachine stateMachine) { 112 | _continuation = stateMachine.MoveNext; 113 | } 114 | } 115 | #line default 116 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Builders/RoutineBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f866a72cb59089b4da952ad5dfbbc84d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Builders/RoutineBuilder_T.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using System.Security; 9 | using JetBrains.Annotations; 10 | using Mk.Scopes; 11 | using UnityEngine; 12 | 13 | namespace Mk.Routines { 14 | #line hidden 15 | public class RoutineBuilder { 16 | static DebugFileInfo _lineCache = new (); 17 | Action _continuation; 18 | Scope _taskScope; 19 | 20 | [UsedImplicitly] 21 | public Routine Task { get; } 22 | 23 | RoutineBuilder (Routine r) { 24 | Task = r; 25 | } 26 | 27 | [UsedImplicitly] 28 | public static RoutineBuilder Create () { 29 | var task = new Routine (); 30 | var res = new RoutineBuilder (task); 31 | return res; 32 | } 33 | 34 | [UsedImplicitly] 35 | public void Start (ref TStateMachine stateMachine) 36 | where TStateMachine : IAsyncStateMachine { 37 | _continuation = stateMachine.MoveNext; 38 | Task._Start = _continuation; 39 | // _continuation.Invoke(); 40 | } 41 | 42 | 43 | [UsedImplicitly] 44 | public void AwaitOnCompleted (ref TAwaiter awaiter, ref TStateMachine stateMachine) 45 | where TAwaiter : INotifyCompletion, IRoutine 46 | where TStateMachine : IAsyncStateMachine { 47 | switch (awaiter) { 48 | case SelfParallelAwaiter attachedRoutinesAwaiter: 49 | if (!Task.AttachedRoutines.TryGet (out var value)) { 50 | value = new (); 51 | Task.AttachedRoutines = value; 52 | } 53 | 54 | attachedRoutinesAwaiter.Value = value; 55 | stateMachine.MoveNext (); 56 | attachedRoutinesAwaiter.OnCompleted (default); 57 | return; 58 | case SelfRollbackAwaiter selfScopeAwaiter: 59 | if (_taskScope == null) _taskScope = Task.Scope = new (); 60 | 61 | selfScopeAwaiter.Value = _taskScope; 62 | stateMachine.MoveNext (); 63 | selfScopeAwaiter.OnCompleted (default); 64 | return; 65 | } 66 | 67 | awaiter.OnCompleted (_continuation); 68 | Task.CurrentAwaiter = awaiter; 69 | awaiter.Tick (); 70 | #if MK_TRACE 71 | _lineCache.SetDebugName (ref Task.__Await, 2); 72 | #endif 73 | } 74 | 75 | [UsedImplicitly] 76 | public void SetResult (T value) { 77 | #if MK_TRACE 78 | _lineCache.SetDebugName (ref Task.__Await, 1); 79 | Task.__Await = $"[Returned at] {Task.__Await}"; 80 | #endif 81 | Task.CurrentAwaiter = null; 82 | Task._hasValue = true; 83 | Task._cached = value; 84 | Task.DisposeAndUpdateParent (); 85 | } 86 | 87 | 88 | [UsedImplicitly] 89 | public void SetException (Exception e) { 90 | #if MK_TRACE 91 | _lineCache.SetDebugName (ref Task.__Await, 1); 92 | Task.__Await = $"[Exception at] {e.Message} {Task.__Await}"; 93 | #endif 94 | Task.CurrentAwaiter = null; 95 | Debug.LogException (e); 96 | // Task.DisposeAndContinue(); 97 | Task.Dispose (); 98 | // throw new Exception(string.Empty, e); 99 | } 100 | 101 | 102 | [UsedImplicitly] 103 | [SecuritySafeCritical,] 104 | public void AwaitUnsafeOnCompleted (ref TAwaiter awaiter, ref TStateMachine stateMachine) 105 | where TAwaiter : ICriticalNotifyCompletion, IRoutine 106 | where TStateMachine : IAsyncStateMachine { 107 | AwaitOnCompleted (ref awaiter, ref stateMachine); 108 | } 109 | 110 | [UsedImplicitly] 111 | public void SetStateMachine (IAsyncStateMachine stateMachine) { 112 | _continuation = stateMachine.MoveNext; 113 | } 114 | } 115 | #line default 116 | } 117 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Builders/RoutineBuilder_T.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b37a1d89b3214664a4c823b28a32b2f6 3 | timeCreated: 1603079247 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/IRoutine.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | 8 | namespace Mk.Routines { 9 | public interface IRoutine : IDisposable{ 10 | bool IsCompleted { get; } 11 | void Tick (); 12 | void UpdateParent (); 13 | } 14 | 15 | public interface IRoutine : IRoutine { 16 | T GetResult (); 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/IRoutine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 851744708942c4741ace1f665d6205da 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/InternalsVisibleTo.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System.Runtime.CompilerServices; 7 | 8 | [assembly: InternalsVisibleTo("Mk.Tests")] 9 | [assembly: InternalsVisibleTo("Assembly-CSharp-Editor")] -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/InternalsVisibleTo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62f6a0aaeb5d42a0a539eab96ba26147 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/README_ROUTINE.md: -------------------------------------------------------------------------------- 1 | # What is async Routine? 2 | 3 | Custom `async` type. Very different from `Task`, allows to: 4 | - use `async` syntax without Threading 5 | - Allows to stop at any time by calling Routine.Dispose() 6 | - Excplicit scheduling: doesn't rely on implicit scheduler, executes only when you call `Routine.Tick()` 7 | 8 | ## Difference from Systems.Threading.Task: 9 | - Doesn’t have scheduler. You need to call Routine.Tick() manually 10 | - Cannot have multiple awaiters. Awaiter is Routine itself and is used for calling Routine.Tick(), Dispose(), etc, 11 | - Routine can be disposed with it's sub-routine tree without CancellationToken-like mechanism, just calling Dispose() 12 | - Any cleanup is better to implement via Scope.Add() 13 | 14 | # How to use it? 15 | 16 | ```csharp 17 | bool flag1; 18 | 19 | async Routine Flow(){ 20 | Scope scope = await Routine.GetScope(); 21 | scope.Defer(() => Debug("Flow() disposed")); 22 | Debug("Start"); 23 | await Routine.Yield; 24 | Debug("Tick 1"); 25 | await Routine.When(() => flag1); 26 | Debug("flag1 is true"); 27 | } 28 | 29 | void Run_Normal(){ 30 | Routine flow = Flow(); // output: Start 31 | flow.Tick(); // output: Tick 1 32 | flow.Tick(); // 33 | flag1 = true; // 34 | flow.Tick(); // output: is true 35 | // Flow() disposed 36 | } 37 | 38 | void Run_Dispose(){ 39 | Routine flow = Flow(); // output: Start 40 | flow.Dispose(); // output: Flow() disposed 41 | flow.Tick(); // does nothing 42 | } 43 | ``` 44 | 45 | ## 2 built-in operations: 46 | 47 | ```csharp 48 | Scope scope = await Routine.GetScope(); 49 | scope.Defer(() => Debug.Log("Executed on routine dispose")) 50 | 51 | Parallel parallel = await Routine.GetParallel(); 52 | parallel.Attach(AnimateTweens()); // 53 | ``` 54 | 55 | ## Extendable with awaiters: 56 | You can also extend with your own awaiters similar to these: 57 | 58 | ```csharp 59 | await Routine.When(Func); // yields until predicate is true 60 | 61 | await Routine.Yield; // yields until next Tick() 62 | 63 | await Routine.YieldTicks(3); // yields for 3 Ticks 64 | 65 | await Routine.Forever; // never pass this await 66 | 67 | IList> results = await Routine.WhenAny(IList>); 68 | 69 | await Routine.WhenAll(IList>); 70 | 71 | await SomeRoutine().Configure(Func breakIf, Action onUpdate); // allows to wrap routine 72 | ``` 73 | 74 | 75 | Slightly outdated version can be found here: 76 | https://github.com/korchoon/mk.routines -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/README_ROUTINE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1b74e7d8fea0444c91ea436800aa87c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Routine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6bd3b1e15194768a54330deb7e9903f 3 | timeCreated: 1552604136 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/RoutineApi.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using JetBrains.Annotations; 8 | using Mk.Scopes; 9 | 10 | 11 | namespace Mk.Routines { 12 | #line hidden 13 | public static class RoutineApi { 14 | public static void DisposeAndUpdateParent (this T r) where T : IRoutine { 15 | r.Dispose (); 16 | r.UpdateParent (); 17 | } 18 | 19 | [MustUseReturnValue] 20 | public static ProxyAwaiter Configure (this IRoutine r 21 | , Func doWhile = default 22 | , Action beforeUpdate = default 23 | , Action afterUpdate = default 24 | , Action beforeDispose = default 25 | , Action onBreak = default 26 | , Action onStart = default 27 | ) { 28 | Asr.IsFalse (typeof (Routine<>).IsAssignableFrom (r.GetType ())); 29 | return new () { 30 | DoWhile = doWhile, 31 | Main = r, 32 | BeforeDispose = beforeDispose, 33 | BeforeUpdate = beforeUpdate, 34 | AfterUpdate = afterUpdate, 35 | OnBreak = onBreak, 36 | OnStart = onStart, 37 | }; 38 | } 39 | 40 | [MustUseReturnValue] 41 | public static ProxyAwaiter Configure (this IRoutine main 42 | , ProxyAwaiter arg) { 43 | Asr.IsTrue (arg.Main == null); 44 | Asr.IsFalse (typeof (Routine<>).IsAssignableFrom (main.GetType ())); 45 | arg.Main = main; 46 | return arg; 47 | } 48 | 49 | 50 | public static ProxyAwaiter BreakOn (this IRoutine routine, Func breakOn, Action onBreak = default) => 51 | routine.Configure (doWhile: () => !breakOn (), onBreak: onBreak); 52 | 53 | public static async Routine ToRoutine (this IRoutine routine) { 54 | var rollback = await Routine.GetScope (); 55 | rollback.Add (routine.Dispose); 56 | await Routine.When (() => { 57 | routine.Tick (); 58 | return routine.IsCompleted; 59 | }); 60 | } 61 | 62 | 63 | public static Routine> BreakOn (this IRoutine routine, Func breakOn) => routine.While (() => !breakOn ()); 64 | 65 | public static Routine> BreakOn (this IRoutine routine, IRoutine breakOn) => routine.While (() => { 66 | breakOn.Tick (); 67 | return !breakOn.IsCompleted; 68 | }); 69 | 70 | public static async Routine BreakOn (this IRoutine routine, Func breakOn, T onBreak, Action onBreakAction = default) { 71 | var t = await routine.While (() => !breakOn ()); 72 | if (t.TryGet (out var value)) { 73 | return value; 74 | } 75 | 76 | onBreakAction?.Invoke (); 77 | return onBreak; 78 | } 79 | 80 | public static Routine> While (this IRoutine routine, Func doWhile) { 81 | return inner (); 82 | 83 | async Routine> inner () { 84 | var rollback = await Routine.GetScope (); 85 | rollback.Add (routine.Dispose); 86 | while (true) { 87 | routine.Tick (); 88 | if (routine.IsCompleted) { 89 | return routine.GetResult (); 90 | } 91 | 92 | if (!doWhile.Invoke ()) { 93 | return default; 94 | } 95 | 96 | await Routine.Yield; 97 | } 98 | } 99 | } 100 | 101 | [MustUseReturnValue] 102 | public static ProxyAwaiter Configure (this IRoutine r 103 | , Action beforeUpdate = default 104 | , Action afterUpdate = default 105 | , Action beforeDispose = default 106 | ) => 107 | new() { 108 | MainRoutine = r, 109 | BeforeDisposeAction = beforeDispose, 110 | BeforeUpdateAction = beforeUpdate, 111 | AfterUpdateAction = afterUpdate, 112 | }; 113 | } 114 | #line default 115 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/RoutineApi.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5046aa3c01643c4b4bbb237f4119b47 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Routine_T.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Runtime.CompilerServices; 8 | using JetBrains.Annotations; 9 | using Mk.Scopes; 10 | using UnityEngine; 11 | 12 | namespace Mk.Routines { 13 | #if MK_TRACE 14 | [Serializable] 15 | #endif 16 | #line hidden 17 | [AsyncMethodBuilder (typeof (RoutineBuilder<>))] 18 | public sealed class Routine : IRoutine, ICriticalNotifyCompletion { 19 | [HideInInspector] public Action _Start; 20 | public string __Await; 21 | internal Scope Scope; 22 | [SerializeReference] internal IRoutine CurrentAwaiter; 23 | [SerializeReference] internal Option AttachedRoutines; 24 | Action _continuation; 25 | internal T _cached; 26 | internal bool _hasValue; 27 | internal Routine () { } 28 | 29 | public void Dispose () { 30 | if (IsCompleted) return; 31 | 32 | _Start = null; 33 | IsCompleted = true; 34 | if (AttachedRoutines.TryGet (out var attachedRoutines)) { 35 | AttachedRoutines = default; 36 | for (var i = attachedRoutines.Routines.Count - 1; i >= 0; i--) attachedRoutines.Routines[i].Dispose (); 37 | } 38 | 39 | if (Utils.TrySetNull (ref CurrentAwaiter, out var buf)) buf.Dispose (); 40 | Scope?.Dispose (); 41 | #if MK_TRACE 42 | __Await = $"[Interrupted at] {__Await}"; 43 | #endif 44 | } 45 | 46 | void IRoutine.UpdateParent () { 47 | if (AttachedRoutines.TryGet (out var attachedRoutines)) 48 | for (var i = 0; i < attachedRoutines.Routines.Count; i++) 49 | attachedRoutines.Routines[i].UpdateParent (); 50 | 51 | if (Utils.TrySetNull (ref _continuation, out var c)) c.Invoke (); 52 | } 53 | 54 | public void Tick () { 55 | if (IsCompleted) return; 56 | 57 | if (Utils.TrySetNull (ref _Start, out var s)) { 58 | s.Invoke (); 59 | return; 60 | } 61 | 62 | if (AttachedRoutines.TryGet (out var attachedRoutines)) 63 | for (var i = 0; i < attachedRoutines.Routines.Count; i++) 64 | attachedRoutines.Routines[i].Tick (); 65 | 66 | CurrentAwaiter?.Tick (); 67 | } 68 | 69 | public Option TryGetResult () => _hasValue ? _cached : default; 70 | 71 | #region async 72 | 73 | [UsedImplicitly] 74 | public bool IsCompleted { get; private set; } 75 | 76 | CalledOnceGuard _guard; 77 | 78 | [UsedImplicitly] 79 | public Routine GetAwaiter () { 80 | _guard.Assert (); 81 | return this; 82 | } 83 | 84 | [UsedImplicitly] 85 | public T GetResult () { 86 | Asr.IsTrue (_hasValue); 87 | return _cached; 88 | } 89 | 90 | public void OnCompleted (Action continuation) { 91 | if (IsCompleted) { 92 | continuation.Invoke (); 93 | return; 94 | } 95 | 96 | Asr.IsTrue (_continuation == null); 97 | _continuation = continuation; 98 | } 99 | 100 | public void UnsafeOnCompleted (Action continuation) => OnCompleted (continuation); 101 | 102 | #endregion 103 | } 104 | #line default 105 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Routine_T.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32fefe60da8f4ea29a9604dae569fbf5 3 | timeCreated: 1603079222 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2eeb53d26b3c41946a95a9d9cb2547a2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Asr.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using Mk.Routines; 4 | 5 | 6 | public static class Asr { 7 | #line hidden 8 | [Conditional (FLAGS.UNITY_EDITOR)] 9 | public static void IsNotNull ([System.Diagnostics.CodeAnalysis.DoesNotReturnIf (parameterValue: false)] T obj, string msg = null, UnityEngine.Object context = null) where T : class { 10 | if (obj != null) { 11 | return; 12 | } 13 | 14 | Fail (msg, context); 15 | } 16 | 17 | [Conditional (FLAGS.UNITY_EDITOR)] 18 | public static void IsNotNullOrEmpty (string s, string msg = null, UnityEngine.Object context = null) { 19 | if (!string.IsNullOrEmpty (s)) { 20 | return; 21 | } 22 | 23 | Fail (msg, context); 24 | } 25 | 26 | [Conditional (FLAGS.UNITY_EDITOR)] 27 | public static void IsTrue ([System.Diagnostics.CodeAnalysis.DoesNotReturnIf (parameterValue: false)] bool expr, string msg = null, UnityEngine.Object context = default) { 28 | if (expr) { 29 | return; 30 | } 31 | 32 | Fail (msg, context); 33 | } 34 | 35 | 36 | [Conditional (FLAGS.UNITY_EDITOR)] 37 | public static void IsFalse ([System.Diagnostics.CodeAnalysis.DoesNotReturnIf (parameterValue: true)] bool expr, string msg = null, UnityEngine.Object context = default) { 38 | if (!expr) { 39 | return; 40 | } 41 | 42 | Fail (msg, context); 43 | } 44 | 45 | // ReSharper disable Unity.PerformanceAnalysis 46 | [Conditional (FLAGS.UNITY_EDITOR)] 47 | public static void Fail (string userMessage = null, UnityEngine.Object context = default, int skipFrames = 2) { 48 | if (string.IsNullOrEmpty (userMessage)) { 49 | userMessage = $"{CallerSourceLine (skipFrames)}"; 50 | } 51 | else { 52 | userMessage = $"{userMessage}:\n {CallerSourceLine (skipFrames)}"; 53 | } 54 | 55 | if (context) { 56 | UnityEngine.Debug.LogError (userMessage, context); 57 | } 58 | 59 | throw new Err (userMessage); 60 | } 61 | 62 | internal class Err : Exception { 63 | public Err (string msg) : base (msg) { } 64 | } 65 | #line default 66 | 67 | 68 | public static string CallerSourceLine (int skipFrames = 0) { 69 | #if UNITY_EDITOR 70 | var trace = new StackTrace (1 + skipFrames, true); 71 | var fr = trace.GetFrame (0); 72 | var line = fr.GetFileLineNumber () - 1; 73 | if (line < 0) 74 | return string.Empty; 75 | 76 | var fileName = fr.GetFileName (); 77 | if (!System.IO.File.Exists (fileName)) 78 | return string.Empty; 79 | 80 | var lines = System.IO.File.ReadAllLines (fileName); 81 | return lines[line].Trim (); 82 | #else 83 | return string.Empty; 84 | #endif 85 | } 86 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Asr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3e4a9fc7def99f4b8c1c7a1f381d1fc -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/CalledOnceGuard.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System.Diagnostics; 7 | 8 | namespace Mk.Routines { 9 | static class CalledOnceGuardApi { 10 | [Conditional (FLAGS.DEBUG)] 11 | public static void Assert (this ref CalledOnceGuard t) { 12 | UnityEngine.Assertions.Assert.IsFalse (t.Called, "Awaiter should be called once"); 13 | t.Called = true; 14 | } 15 | } 16 | 17 | struct CalledOnceGuard { 18 | public bool Called; 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/CalledOnceGuard.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 613776f193816994791fcc55d1966607 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/DebugFileInfo.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System.Collections.Generic; 7 | using System.Diagnostics; 8 | using System.IO; 9 | 10 | namespace Mk.Routines { 11 | class DebugFileInfo { 12 | Dictionary FrameToLine; 13 | Dictionary PathToLines; 14 | 15 | public DebugFileInfo () { 16 | FrameToLine = new (); 17 | PathToLines = new (); 18 | } 19 | 20 | // [Conditional("MK_TRACE")] 21 | public void SetDebugName (ref string target, int skipFrames) { 22 | var withoutFileInfo = new StackTrace (1 + skipFrames, fNeedFileInfo: false).GetFrame (0); 23 | if (TryGetLine (withoutFileInfo, out var line)) { 24 | target = line; 25 | return; 26 | } 27 | 28 | var fullFrame = new StackTrace (1 + skipFrames, fNeedFileInfo: true).GetFrame (0); 29 | GetLine (withoutFileInfo, fullFrame, out line); 30 | target = line; 31 | } 32 | 33 | public string GetDebugName (int skipFrames) { 34 | var withoutFileInfo = new StackTrace (1 + skipFrames, fNeedFileInfo: false).GetFrame (0); 35 | if (TryGetLine (withoutFileInfo, out var line)) { 36 | return line; 37 | } 38 | 39 | var fullFrame = new StackTrace (1 + skipFrames, fNeedFileInfo: true).GetFrame (0); 40 | GetLine (withoutFileInfo, fullFrame, out line); 41 | return line; 42 | } 43 | 44 | bool TryGetLine (StackFrame withoutFileInfo, out string line) { 45 | return FrameToLine.TryGetValue (withoutFileInfo, out line); 46 | } 47 | 48 | void GetLine (StackFrame withoutFileInfo, StackFrame withFileInfo, out string line) { 49 | var path = withFileInfo.GetFileName (); 50 | if (!PathToLines.TryGetValue (path, out var lines)) { 51 | if (!File.Exists (path)) { 52 | line = default; 53 | return; 54 | } 55 | 56 | lines = File.ReadAllLines (path); 57 | PathToLines.Add (path, lines); 58 | } 59 | 60 | var fileLineNumber = withFileInfo.GetFileLineNumber (); 61 | var s = lines[fileLineNumber - 1]; 62 | // line = $"{s.Trim()} | {Path.GetFileName(path)}:{fileLineNumber}"; 63 | var col = withFileInfo.GetFileColumnNumber (); 64 | line = $"{s.Substring (col - 1).Trim ()} [{Path.GetFileNameWithoutExtension (path)}:{fileLineNumber}]"; 65 | FrameToLine.Add (withoutFileInfo, line); 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/DebugFileInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a77393270132499bb81b92b99a5890fa 3 | timeCreated: 1590169571 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/InfLoopSafety.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Diagnostics; 8 | using System.Threading; 9 | 10 | class InfLoopSafety { 11 | readonly int _max; 12 | int _cachedFrameCount; 13 | int _timesPerFrame; 14 | int FrameCount () => UnityEngine.Time.frameCount; 15 | 16 | public InfLoopSafety (int max) { 17 | _max = max; 18 | } 19 | 20 | [Conditional ("PREVENT_INF_LOOP")] 21 | public void Check () { 22 | _timesPerFrame += 1; 23 | if (_timesPerFrame > _max) { 24 | throw new ("Inf loop detected"); 25 | } 26 | 27 | var curFrameCount = FrameCount (); 28 | if (curFrameCount > _cachedFrameCount) { 29 | _cachedFrameCount = curFrameCount; 30 | _timesPerFrame = 0; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/InfLoopSafety.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b096670aafef5a840b39bbc9cc3a5b76 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Option.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 888bee145db2d9942b551e0bd659bd82 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Pool.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | using System; 7 | using System.Collections.Generic; 8 | using JetBrains.Annotations; 9 | 10 | namespace Mk.Routines { 11 | class Pool : IDisposable where T : class { 12 | static Action Empty { get; } = _ => { }; 13 | Func _ctor; 14 | internal Stack _stack; 15 | 16 | // todo place asserts on app quit 17 | Action _onPush; 18 | Action _onPop; 19 | Action _destroy; 20 | 21 | 22 | public Pool(Func ctor, Action onPush, Action onDestroy = null, Action onPop = null) { 23 | _ctor = ctor; 24 | _onPush = onPush; 25 | _onPop = onPop; 26 | #if !M_DISABLE_POOLING 27 | _stack = new (); 28 | _destroy = onDestroy ?? Empty; 29 | #endif 30 | } 31 | 32 | public T Pop() { 33 | Pop(out var res); 34 | return res; 35 | } 36 | 37 | public void Pop(out T res) { 38 | #if M_DISABLE_POOLING 39 | return _ctor.Invoke(); 40 | #else 41 | if (_stack.Count == 0) { 42 | res = _ctor(); 43 | Asr.IsNotNull(res); 44 | } 45 | else 46 | res = _stack.Pop(); 47 | 48 | _onPop?.Invoke(res); 49 | #endif 50 | } 51 | 52 | public void PushRef(ref T element) { 53 | #if !M_DISABLE_POOLING 54 | Asr.IsFalse(_stack.Count > 0 && ReferenceEquals(_stack.Peek(), element), 55 | "Internal error. Trying to release object that is already released to pool. "); 56 | 57 | _stack.Push(element); 58 | #endif 59 | _onPush.Invoke(element); 60 | element = null; 61 | } 62 | 63 | public void Push(T element) { 64 | #if !M_DISABLE_POOLING 65 | Asr.IsFalse(_stack.Count > 0 && ReferenceEquals(_stack.Peek(), element), 66 | "Internal error. Trying to release object that is already released to pool. "); 67 | 68 | _stack.Push(element); 69 | #endif 70 | _onPush.Invoke(element); 71 | } 72 | 73 | public void Dispose() { 74 | #if !M_DISABLE_POOLING 75 | while (_stack.Count > 0) { 76 | var t = _stack.Pop(); 77 | _destroy.Invoke(t); 78 | } 79 | #endif 80 | } 81 | 82 | [MustUseReturnValue] 83 | public _Scope GetScoped(out T tmp) { 84 | Pop(out tmp); 85 | return new (this, ref tmp); 86 | } 87 | 88 | public struct _Scope : IDisposable { 89 | Pool _pool; 90 | T _val; 91 | 92 | internal _Scope(Pool pool, ref T val) { 93 | _pool = pool; 94 | _val = val; 95 | } 96 | 97 | public void Dispose() { 98 | _pool.PushRef(ref _val); 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Pool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48c09166f97748dcb6eec46aeef861c8 3 | timeCreated: 1591814570 -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Utils.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Async Routines framework https://github.com/korchoon/mk.routines 3 | // Copyright (c) 2016-2023 Mikhail Korchun 4 | // ---------------------------------------------------------------------------- 5 | 6 | namespace Mk.Routines { 7 | static class FLAGS { 8 | public const string DEBUG = "DEBUG"; 9 | public const string UNITY_EDITOR = "UNITY_EDITOR"; 10 | public const string UNITY_INCLUDE_TESTS = "UNITY_INCLUDE_TESTS"; 11 | } 12 | 13 | static class Utils { 14 | public static bool TrySetNull(ref T arg, out T buf) where T : class { 15 | if (arg == null) { 16 | buf = null; 17 | return false; 18 | } 19 | 20 | buf = arg; 21 | arg = null; 22 | return true; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Routines/Utils/Utils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c26a11cebe944c19bae6628c14edc38a 3 | timeCreated: 1602602851 -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b286bc35316c88e48b566ede6022ef28 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/ISafeScope.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // The MIT License 3 | // Rollback https://github.com/korchoon/rollback 4 | // Copyright (c) 2016-2025 Mikhail Korchun 5 | // ---------------------------------------------------------------------------- 6 | 7 | using System; 8 | 9 | namespace Mk.Scopes { 10 | /// 11 | /// A container for actions deferred until Dispose, used for resource cleanup or canceling side effects 12 | /// 13 | public interface ISafeScope { 14 | /// 15 | /// Tells if the scope is being disposed. 16 | /// 17 | bool IsDisposed { get; } 18 | 19 | /// 20 | /// Adds an action to be executed automatically when the Dispose method is invoked. 21 | /// Actions will be executed in the reverse order of their addition. 22 | /// 23 | /// The action to be executed upon disposal. 24 | void Add (Action action); 25 | 26 | /// 27 | /// Removes a previously added action to prevent its execution upon disposal. 28 | /// The provided action must be the same delegate instance as the one initially added. 29 | /// 30 | /// The action delegate to be removed. 31 | void Remove (Action action); 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/ISafeScope.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19f7e23f35b14922898c06d621593ac2 3 | timeCreated: 1736781288 -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/README_SCOPE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17da4714872bfaa43ae0a176229ca028 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/Scope.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // The MIT License 3 | // Rollback https://github.com/korchoon/rollback 4 | // Copyright (c) 2016-2025 Mikhail Korchun 5 | // ---------------------------------------------------------------------------- 6 | using System; 7 | 8 | namespace Mk.Scopes 9 | { 10 | /// 11 | /// A container for deferred actions executed upon Dispose, designed for resource cleanup or canceling side effects. 12 | /// To allow disposal, pass the Rollback. 13 | /// To prevent disposal, pass the IRollback. 14 | /// 15 | public sealed class Scope : ISafeScope, IDisposable 16 | { 17 | /// 18 | /// Tells if the rollback is being disposed. 19 | /// 20 | public bool IsDisposed { get; private set; } 21 | private readonly object lockObject; 22 | private Action deferredActions; 23 | 24 | public Scope() 25 | { 26 | lockObject = new object(); 27 | IsDisposed = false; 28 | } 29 | 30 | /// 31 | /// Adds an action to be executed automatically when the Dispose method is invoked. 32 | /// Actions will be executed in the reverse order of their addition. 33 | /// 34 | /// The action to be executed upon disposal. 35 | public void Add(Action action) 36 | { 37 | lock (lockObject) 38 | { 39 | if (IsDisposed) 40 | { 41 | #if DEBUG 42 | throw new Exception("The rollback is disposed. Cannot defer action"); 43 | #else 44 | return; 45 | #endif 46 | } 47 | 48 | deferredActions = action + deferredActions; // First In Last Out order 49 | } 50 | } 51 | 52 | /// 53 | /// Removes a previously added action to prevent its execution upon disposal. 54 | /// The provided action must be the same delegate instance as the one initially added. 55 | /// 56 | /// The action delegate to be removed. 57 | public void Remove(Action action) 58 | { 59 | lock (lockObject) 60 | { 61 | if (IsDisposed) 62 | { 63 | #if DEBUG 64 | throw new Exception("The rollback is disposed. Cannot remove deferred action."); 65 | #else 66 | return; 67 | #endif 68 | } 69 | #if DEBUG 70 | var countPrev = Length(); 71 | deferredActions -= action; 72 | if (Length() == countPrev) 73 | { 74 | throw new Exception("Trying to remove action which wasn't deferred"); 75 | } 76 | 77 | int Length() 78 | { 79 | if (deferredActions == null) return 0; 80 | return deferredActions.GetInvocationList().Length; 81 | } 82 | #else 83 | deferredActions -= action; 84 | #endif 85 | } 86 | } 87 | 88 | 89 | /// 90 | /// Executes deferred actions in the reverse order in which they were added 91 | /// 92 | public void Dispose() 93 | { 94 | lock (lockObject) 95 | { 96 | if (IsDisposed) 97 | { 98 | return; 99 | } 100 | 101 | IsDisposed = true; 102 | } 103 | 104 | if (deferredActions == null) 105 | { 106 | return; 107 | } 108 | 109 | foreach (var a in deferredActions.GetInvocationList()) 110 | { 111 | var action = (Action)a; 112 | try 113 | { 114 | action(); 115 | } 116 | catch (Exception e) 117 | { 118 | UnityEngine.Debug.LogException(e); 119 | } 120 | } 121 | 122 | deferredActions = null; 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/Scope.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d6dc6307a9022f344bfef3c259a769ae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/ScopeExtensions.cs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // The MIT License 3 | // scope https://github.com/korchoon/scope 4 | // Copyright (c) 2016-2025 Mikhail Korchun 5 | // ---------------------------------------------------------------------------- 6 | 7 | using System; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | namespace Mk.Scopes { 12 | public static class ScopeExtensions { 13 | /// 14 | /// Throws a TaskCanceledException if the scope instance has been disposed. 15 | /// This method is intended for use within or to ensure 16 | /// proper handling of disposal scenarios, similar to . 17 | /// 18 | /// The scope instance to check for disposal. 19 | /// Thrown if the scope instance has been disposed. 20 | /// 21 | /// 22 | /// public async Task PerformActionAsync(Iscope scope) 23 | /// { 24 | /// scope.ThrowIfDisposed(); 25 | /// await SomeAsyncOperation(); 26 | /// } 27 | /// 28 | /// 29 | public static void ThrowIfDisposed (this ISafeScope scope) { 30 | if (scope.IsDisposed) { 31 | throw new TaskCanceledException ("Cancellation from scope.ThrowIfDisposed()"); 32 | } 33 | } 34 | 35 | /// 36 | /// Creates a child CancellationTokenSource associated with the given scope. 37 | /// Disposing the CancellationTokenSource will not dispose the scope instance. 38 | /// 39 | /// The parent scope instance. 40 | /// A CancellationTokenSource linked to the provided scope. 41 | public static CancellationTokenSource GetCancellationTokenSource (this ISafeScope scope) { 42 | if (scope.IsDisposed) { 43 | throw new Exception ("Cannot get CancellationToken from scope that is disposed"); 44 | } 45 | 46 | var source = new CancellationTokenSource (); 47 | scope.Add (source.Dispose); 48 | scope.Add (source.Cancel); 49 | return source; 50 | } 51 | 52 | /// 53 | /// Cancellation token associated with scope 54 | /// 55 | /// 56 | /// 57 | public static CancellationToken GetCancellationToken (this ISafeScope scope) { 58 | var source = scope.GetCancellationTokenSource (); 59 | return source.Token; 60 | } 61 | 62 | /// 63 | /// Opens a child scope instance tied to the current one, enabling cascading disposal. 64 | /// Disposing the child does not dispose the parent, but disposing the parent will dispose both the parent and the child. 65 | /// 66 | /// A new child scope instance associated with the current parent scope. 67 | public static Scope NestedScope (this ISafeScope parentScope) { 68 | if (parentScope.IsDisposed) { 69 | throw new Exception ("Cannot open a child scope because the parent scope instance has already been disposed."); 70 | } 71 | 72 | var result = new Scope (); 73 | parentScope.Add (DisposeNested); 74 | result.Add (CancelDisposeNested); 75 | return result; 76 | 77 | void DisposeNested () { 78 | result.Dispose (); 79 | } 80 | 81 | void CancelDisposeNested () { 82 | if (!parentScope.IsDisposed) { 83 | parentScope.Remove (DisposeNested); 84 | } 85 | } 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /Assets/Code/Lib/Scope/ScopeExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b08ccbba617243faba9270a170776e43 3 | timeCreated: 1734968321 -------------------------------------------------------------------------------- /Assets/Code/SceneContext.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | class SceneContext : MonoBehaviour { 5 | public GameObject MenuRoot; 6 | public Button StartBtn; 7 | 8 | public GameObject GameRoot; 9 | public UnitView UnitPrefab; 10 | public Transform UnitSpawn; 11 | public Button ShootBtn; 12 | 13 | public GameObject GameOverRoot; 14 | public Button GameOverBtn; 15 | } -------------------------------------------------------------------------------- /Assets/Code/SceneContext.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d966c25804541819ab66f9e469ab0e8 3 | timeCreated: 1739714580 -------------------------------------------------------------------------------- /Assets/Code/Startup.cs: -------------------------------------------------------------------------------- 1 | using AsyncSystem.Utils; 2 | using Leopotam.EcsProto; 3 | using Leopotam.EcsProto.QoL; 4 | using UnityEngine; 5 | 6 | class Startup : MonoBehaviour { 7 | [SerializeField] SceneContext _sceneContext; 8 | ProtoSystems _systems; 9 | 10 | void InitModules (ProtoModules modules) { 11 | modules.AddModule (new AutoInjectModule (injectToServices: true)); 12 | modules.AddAspect (new GameAspect ()); 13 | modules.AddSystem (new SysInitGame ()); 14 | modules.AddSystem (new SysGameFlow ()); 15 | modules.AddSystem (new SysUnit ()); 16 | } 17 | 18 | void InitServices (IProtoSystems systems) { 19 | systems.AddService (_sceneContext); 20 | } 21 | 22 | void Awake () { 23 | var modules = new ProtoModules (); 24 | InitModules (modules); 25 | var world = new ProtoWorld (modules.BuildAspect ()); 26 | _systems = new ProtoSystems (world); 27 | _systems.AddModule (modules.BuildModule ()); 28 | InitServices (_systems); 29 | _systems.Init (); 30 | } 31 | 32 | void Update () { 33 | _systems.Run (); 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/Code/Startup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18195223c88d4149bcbb1384cf0753ae 3 | timeCreated: 1739715521 -------------------------------------------------------------------------------- /Assets/Code/SysGameFlow.cs: -------------------------------------------------------------------------------- 1 | using AsyncSystem; 2 | using AsyncSystem.Utils; 3 | using Leopotam.EcsProto; 4 | using Leopotam.EcsProto.QoL; 5 | using Mk.Routines; 6 | using Mk.Scopes; 7 | 8 | /// 9 | /// Основная игровая логика. Управляет активацией/деактивацией объектов и подписками на события через Scope. 10 | /// 11 | /// - Ожидает нажатия StartBtn для запуска игры. 12 | /// - Создает сущность с компонентом CUnit (Health = 100). 13 | /// - Включает кнопку атаки и подписывает логику в рамках using (unitAliveScope). 14 | /// - Завершает игру при отсутствии юнитов, показывает "Game Over" и ждет нажатия кнопки. 15 | /// - Повторяет процесс. 16 | /// 17 | class SysGameFlow : AsyncSystem { 18 | [DI] GameAspect _gameAspect = default; 19 | [DI] SceneContext _sceneContext = default; 20 | 21 | protected override IProtoIt GetProtoIt () => new ProtoIt (It.Inc ()); 22 | 23 | protected override async Routine Run (ProtoEntity entity) { 24 | _sceneContext.MenuRoot.SetActive (true); 25 | while (true) { 26 | using var roundScope = new Scope (); 27 | 28 | await _sceneContext.StartBtn.WaitForClick (); 29 | // game started 30 | _sceneContext.MenuRoot.SetActiveScoped (roundScope, false); 31 | _sceneContext.GameRoot.SetActiveScoped (roundScope, true); 32 | 33 | _gameAspect.CUnit.NewEntity () = new () { 34 | Health = 100 35 | }; 36 | 37 | using (var unitAliveScope = roundScope.NestedScope ()) { 38 | _sceneContext.ShootBtn.gameObject.SetActiveScoped (unitAliveScope, true); 39 | _sceneContext.ShootBtn.onClick.AddListenerScoped (unitAliveScope, Shoot); 40 | 41 | await Routine.When (() => _gameAspect.UnitIt.Len () == 0); 42 | // game over 43 | } 44 | 45 | _sceneContext.GameOverRoot.SetActiveScoped (roundScope, true); 46 | await _sceneContext.GameOverBtn.WaitForClick (); 47 | } 48 | } 49 | 50 | void Shoot () { 51 | foreach (var unitE in _gameAspect.UnitIt) { 52 | _gameAspect.CUnit.Get (unitE).Health -= 10; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Assets/Code/SysGameFlow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9f379b51e7240669e5453022857c753 3 | timeCreated: 1739718668 -------------------------------------------------------------------------------- /Assets/Code/SysInitGame.cs: -------------------------------------------------------------------------------- 1 | using Leopotam.EcsProto; 2 | using Leopotam.EcsProto.QoL; 3 | 4 | class SysInitGame : IProtoInitSystem { 5 | [DI] GameAspect _gameAspect = default; 6 | 7 | public void Init (IProtoSystems systems) { 8 | _gameAspect.CGame.NewEntity (); 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Code/SysInitGame.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f9977b399b64df39c978d4e5573acf0 3 | timeCreated: 1739896453 -------------------------------------------------------------------------------- /Assets/Code/SysUnit.cs: -------------------------------------------------------------------------------- 1 | using AsyncSystem; 2 | using Leopotam.EcsProto; 3 | using Leopotam.EcsProto.QoL; 4 | using Mk.Routines; 5 | using UnityEngine; 6 | 7 | /// 8 | /// Стейт-машина юнита, которая запускается при появлении компонента CUnit на сущности (см. GetProtoIt). 9 | /// Изменяет цвет в зависимости от уровня здоровья: 10 | /// - ≥ 50 — зеленый 11 | /// - > 0 — желтый 12 | /// - 0 — красный 13 | /// 14 | /// Параллельно обновляет health bar (слайдер и текстовое поле) (см. parallel). 15 | /// При достижении 0 здоровья ждет 3 секунды, затем удаляет компонент юнита. 16 | /// 17 | /// Scope используется для очистки View юнита после завершения async-логики. Сработает даже в случае Exception. 18 | /// 19 | class SysUnit : AsyncSystem { 20 | [DI] GameAspect _counterAspect = default; 21 | [DI] SceneContext _scene = default; 22 | 23 | protected override IProtoIt GetProtoIt () => new ProtoIt (It.Inc ()); 24 | 25 | protected override async Routine Run (ProtoEntity entity) { 26 | var scope = await Routine.GetScope (); 27 | 28 | var view = Object.Instantiate (_scene.UnitPrefab, _scene.UnitSpawn); 29 | scope.Add (() => Object.Destroy (view.gameObject)); 30 | 31 | var parallel = await Routine.GetParallel (); 32 | parallel.Attach (ObserveAmount ()); // change state 33 | 34 | // healthy state 35 | view.Image.color = Color.green; 36 | 37 | await Routine.When (() => _counterAspect.CUnit.Get (entity).Health < 50); 38 | // injured state 39 | view.Image.color = Color.yellow; 40 | 41 | await Routine.When (() => _counterAspect.CUnit.Get (entity).Health <= 0); 42 | // dead state 43 | view.Image.color = Color.red; 44 | 45 | var timer = 3f; 46 | await Routine.When (() => { 47 | timer -= Time.deltaTime; 48 | return timer < 0f; 49 | }); 50 | 51 | _counterAspect.CUnit.Del (entity); 52 | return; 53 | 54 | async Routine ObserveAmount () { 55 | while (true) { 56 | var cache = _counterAspect.CUnit.Get (entity).Health; 57 | view.Slider.value = cache; 58 | view.Text.text = cache.ToString (); 59 | await Routine.When (() => cache != _counterAspect.CUnit.Get (entity).Health); 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Assets/Code/SysUnit.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56814d26d15019a4383100d2c234127b -------------------------------------------------------------------------------- /Assets/Code/UnitView.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | class UnitView : MonoBehaviour { 5 | public Image Image; 6 | public Slider Slider; 7 | public Text Text; 8 | } -------------------------------------------------------------------------------- /Assets/Code/UnitView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcb6d98f620f4c03addfef5684f18508 3 | timeCreated: 1739718434 -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c53962885c2c4f449125a979d6ad240 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes/Unit.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d958b46fb1719b4fb4781e6382121d1 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f54d1bd14bd3ca042bd867b519fee8cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ab70aee4d56447429c680537fbf93ed 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt: -------------------------------------------------------------------------------- 1 | Digitized data copyright (c) 2010 Google Corporation 2 | with Reserved Font Arimo, Tinos and Cousine. 3 | Copyright (c) 2012 Red Hat, Inc. 4 | with Reserved Font Name Liberation. 5 | 6 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 7 | This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL 8 | 9 | ----------------------------------------------------------- 10 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 11 | ----------------------------------------------------------- 12 | 13 | PREAMBLE 14 | The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. 15 | 16 | The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. 17 | 18 | DEFINITIONS 19 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 20 | 21 | "Reserved Font Name" refers to any names specified as such after the copyright statement(s). 22 | 23 | "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). 24 | 25 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 26 | 27 | "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. 28 | 29 | PERMISSION & CONDITIONS 30 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 31 | 32 | 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 33 | 34 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 35 | 36 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 37 | 38 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 39 | 40 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. 41 | 42 | TERMINATION 43 | This license becomes null and void if any of the above conditions are not met. 44 | 45 | DISCLAIMER 46 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e59c59b81ab47f9b6ec5781fa725d2c 3 | timeCreated: 1484171296 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Fonts/LiberationSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korchoon/ecs-async/8730ae422dea6253d6672024969574bfc0ba2e4e/Assets/TextMesh Pro/Fonts/LiberationSans.ttf -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Fonts/LiberationSans.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3265ab4bf004d28a9537516768c1c75 3 | timeCreated: 1484171297 4 | licenseType: Pro 5 | TrueTypeFontImporter: 6 | serializedVersion: 2 7 | fontSize: 16 8 | forceTextureCase: -2 9 | characterSpacing: 1 10 | characterPadding: 0 11 | includeFontData: 1 12 | use2xBehaviour: 0 13 | fontNames: [] 14 | fallbackFontReferences: [] 15 | customCharacters: 16 | fontRenderingMode: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 243e06394e614e5d99fab26083b707fa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 731f1baa9d144a9897cb1d341c2092b8 3 | folderAsset: yes 4 | timeCreated: 1442040525 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: LiberationSans SDF - Drop Shadow 11 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 12 | m_ShaderKeywords: OUTLINE_ON UNDERLAY_ON 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Cube: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _FaceTex: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _MainTex: 35 | m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, 36 | type: 2} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _OutlineTex: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | m_Floats: 44 | - _Ambient: 0.5 45 | - _Bevel: 0.5 46 | - _BevelClamp: 0 47 | - _BevelOffset: 0 48 | - _BevelRoundness: 0 49 | - _BevelWidth: 0 50 | - _BumpFace: 0 51 | - _BumpOutline: 0 52 | - _ColorMask: 15 53 | - _Diffuse: 0.5 54 | - _DiffusePower: 1 55 | - _FaceDilate: 0.1 56 | - _FaceUVSpeedX: 0 57 | - _FaceUVSpeedY: 0 58 | - _GlowInner: 0.05 59 | - _GlowOffset: 0 60 | - _GlowOuter: 0.05 61 | - _GlowPower: 0.75 62 | - _GradientScale: 10 63 | - _LightAngle: 3.1416 64 | - _MaskSoftnessX: 0 65 | - _MaskSoftnessY: 0 66 | - _OutlineSoftness: 0 67 | - _OutlineUVSpeedX: 0 68 | - _OutlineUVSpeedY: 0 69 | - _OutlineWidth: 0.1 70 | - _PerspectiveFilter: 0.875 71 | - _Reflectivity: 10 72 | - _ScaleRatioA: 0.9 73 | - _ScaleRatioB: 0.73125 74 | - _ScaleRatioC: 0.64125 75 | - _ScaleX: 1 76 | - _ScaleY: 1 77 | - _ShaderFlags: 0 78 | - _Sharpness: 0 79 | - _SpecularPower: 2 80 | - _Stencil: 0 81 | - _StencilComp: 8 82 | - _StencilOp: 0 83 | - _StencilReadMask: 255 84 | - _StencilWriteMask: 255 85 | - _TextureHeight: 1024 86 | - _TextureWidth: 1024 87 | - _UnderlayDilate: 0 88 | - _UnderlayOffsetX: 0.5 89 | - _UnderlayOffsetY: -0.5 90 | - _UnderlaySoftness: 0.05 91 | - _VertexOffsetX: 0 92 | - _VertexOffsetY: 0 93 | - _WeightBold: 0.75 94 | - _WeightNormal: 0 95 | m_Colors: 96 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 97 | - _Color: {r: 1, g: 1, b: 1, a: 1} 98 | - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} 99 | - _FaceColor: {r: 1, g: 1, b: 1, a: 1} 100 | - _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} 101 | - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} 102 | - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} 103 | - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} 104 | - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} 105 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 106 | - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} 107 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Drop Shadow.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e73a58f6e2794ae7b1b7e50b7fb811b0 3 | timeCreated: 1484172806 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e498d1c8094910479dc3e1b768306a4 3 | timeCreated: 1484171803 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: LiberationSans SDF - Outline 11 | m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3} 12 | m_ShaderKeywords: OUTLINE_ON 13 | m_LightmapFlags: 5 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _Cube: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _FaceTex: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _MainTex: 35 | m_Texture: {fileID: 28684132378477856, guid: 8f586378b4e144a9851e7b34d9b748ee, 36 | type: 2} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _OutlineTex: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | m_Floats: 44 | - _Ambient: 0.5 45 | - _Bevel: 0.5 46 | - _BevelClamp: 0 47 | - _BevelOffset: 0 48 | - _BevelRoundness: 0 49 | - _BevelWidth: 0 50 | - _BumpFace: 0 51 | - _BumpOutline: 0 52 | - _ColorMask: 15 53 | - _Diffuse: 0.5 54 | - _FaceDilate: 0.1 55 | - _FaceUVSpeedX: 0 56 | - _FaceUVSpeedY: 0 57 | - _GlowInner: 0.05 58 | - _GlowOffset: 0 59 | - _GlowOuter: 0.05 60 | - _GlowPower: 0.75 61 | - _GradientScale: 10 62 | - _LightAngle: 3.1416 63 | - _MaskSoftnessX: 0 64 | - _MaskSoftnessY: 0 65 | - _OutlineSoftness: 0 66 | - _OutlineUVSpeedX: 0 67 | - _OutlineUVSpeedY: 0 68 | - _OutlineWidth: 0.1 69 | - _PerspectiveFilter: 0.875 70 | - _Reflectivity: 10 71 | - _ScaleRatioA: 0.9 72 | - _ScaleRatioB: 0.73125 73 | - _ScaleRatioC: 0.64125 74 | - _ScaleX: 1 75 | - _ScaleY: 1 76 | - _ShaderFlags: 0 77 | - _Sharpness: 0 78 | - _SpecularPower: 2 79 | - _Stencil: 0 80 | - _StencilComp: 8 81 | - _StencilOp: 0 82 | - _StencilReadMask: 255 83 | - _StencilWriteMask: 255 84 | - _TextureHeight: 1024 85 | - _TextureWidth: 1024 86 | - _UnderlayDilate: 0 87 | - _UnderlayOffsetX: 0 88 | - _UnderlayOffsetY: 0 89 | - _UnderlaySoftness: 0 90 | - _VertexOffsetX: 0 91 | - _VertexOffsetY: 0 92 | - _WeightBold: 0.75 93 | - _WeightNormal: 0 94 | m_Colors: 95 | - _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767} 96 | - _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0} 97 | - _FaceColor: {r: 1, g: 1, b: 1, a: 1} 98 | - _GlowColor: {r: 0, g: 1, b: 0, a: 0.5} 99 | - _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767} 100 | - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} 101 | - _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1} 102 | - _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1} 103 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 104 | - _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5} 105 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Outline.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79459efec17a4d00a321bdcc27bbc385 3 | timeCreated: 1484172856 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f586378b4e144a9851e7b34d9b748ee 3 | timeCreated: 1484171803 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt: -------------------------------------------------------------------------------- 1 | )]}〕〉》」』】〙〗〟’”⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、%,.:;。!?]):;=}¢°"†‡℃〆%,. -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Following Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fade42e8bc714b018fac513c043d323b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt: -------------------------------------------------------------------------------- 1 | ([{〔〈《「『【〘〖〝‘“⦅«$—…‥〳〴〵\[({£¥"々〇$¥₩ # -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/LineBreaking Leading Characters.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d82c1b31c7e74239bff1220585707d2b 3 | timeCreated: 1425440388 4 | licenseType: Store 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Sprite Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 512a49d95c0c4332bdd98131869c23c9 3 | folderAsset: yes 4 | timeCreated: 1441876896 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Sprite Assets/EmojiOne.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c41005c129ba4d66911b75229fd70b45 3 | timeCreated: 1480316912 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Style Sheets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4aecb92fff08436c8303b10eab8da368 3 | folderAsset: yes 4 | timeCreated: 1441876950 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/Style Sheets/Default Style Sheet.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f952c082cb03451daed3ee968ac6c63e 3 | timeCreated: 1432805430 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/TMP Settings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 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: 11500000, guid: 2705215ac5b84b70bacc50632be6e391, type: 3} 13 | m_Name: TMP Settings 14 | m_EditorClassIdentifier: 15 | assetVersion: 2 16 | m_TextWrappingMode: 1 17 | m_enableKerning: 1 18 | m_ActiveFontFeatures: 00000000 19 | m_enableExtraPadding: 0 20 | m_enableTintAllSprites: 0 21 | m_enableParseEscapeCharacters: 1 22 | m_EnableRaycastTarget: 1 23 | m_GetFontFeaturesAtRuntime: 1 24 | m_missingGlyphCharacter: 0 25 | m_ClearDynamicDataOnBuild: 1 26 | m_warningsDisabled: 0 27 | m_defaultFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} 28 | m_defaultFontAssetPath: Fonts & Materials/ 29 | m_defaultFontSize: 36 30 | m_defaultAutoSizeMinRatio: 0.5 31 | m_defaultAutoSizeMaxRatio: 2 32 | m_defaultTextMeshProTextContainerSize: {x: 20, y: 5} 33 | m_defaultTextMeshProUITextContainerSize: {x: 200, y: 50} 34 | m_autoSizeTextContainer: 0 35 | m_IsTextObjectScaleStatic: 0 36 | m_fallbackFontAssets: [] 37 | m_matchMaterialPreset: 1 38 | m_HideSubTextObjects: 0 39 | m_defaultSpriteAsset: {fileID: 11400000, guid: c41005c129ba4d66911b75229fd70b45, 40 | type: 2} 41 | m_defaultSpriteAssetPath: Sprite Assets/ 42 | m_enableEmojiSupport: 1 43 | m_MissingCharacterSpriteUnicode: 0 44 | m_EmojiFallbackTextAssets: [] 45 | m_defaultColorGradientPresetsPath: Color Gradient Presets/ 46 | m_defaultStyleSheet: {fileID: 11400000, guid: f952c082cb03451daed3ee968ac6c63e, 47 | type: 2} 48 | m_StyleSheetsResourcePath: 49 | m_leadingCharacters: {fileID: 4900000, guid: d82c1b31c7e74239bff1220585707d2b, type: 3} 50 | m_followingCharacters: {fileID: 4900000, guid: fade42e8bc714b018fac513c043d323b, 51 | type: 3} 52 | m_UseModernHangulLineBreakingRules: 0 53 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Resources/TMP Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f5b5dff67a942289a9defa416b206f3 3 | timeCreated: 1436653997 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9f693669af91aa45ad615fc681ed29f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/SDFFunctions.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96de908384869cd409c75efa351d5edf 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap-Custom-Atlas.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Bitmap Custom Atlas" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _FaceTex ("Font Texture", 2D) = "white" {} 6 | _FaceColor ("Text Color", Color) = (1,1,1,1) 7 | 8 | _VertexOffsetX ("Vertex OffsetX", float) = 0 9 | _VertexOffsetY ("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | _Padding ("Padding", float) = 0 15 | 16 | _StencilComp ("Stencil Comparison", Float) = 8 17 | _Stencil ("Stencil ID", Float) = 0 18 | _StencilOp ("Stencil Operation", Float) = 0 19 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 20 | _StencilReadMask ("Stencil Read Mask", Float) = 255 21 | 22 | _CullMode ("Cull Mode", Float) = 0 23 | _ColorMask ("Color Mask", Float) = 15 24 | } 25 | 26 | SubShader{ 27 | 28 | Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 29 | 30 | Stencil 31 | { 32 | Ref[_Stencil] 33 | Comp[_StencilComp] 34 | Pass[_StencilOp] 35 | ReadMask[_StencilReadMask] 36 | WriteMask[_StencilWriteMask] 37 | } 38 | 39 | 40 | Lighting Off 41 | Cull [_CullMode] 42 | ZTest [unity_GUIZTestMode] 43 | ZWrite Off 44 | Fog { Mode Off } 45 | Blend SrcAlpha OneMinusSrcAlpha 46 | ColorMask[_ColorMask] 47 | 48 | Pass { 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | 53 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 54 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 55 | 56 | 57 | #include "UnityCG.cginc" 58 | #include "UnityUI.cginc" 59 | 60 | struct appdata_t 61 | { 62 | float4 vertex : POSITION; 63 | fixed4 color : COLOR; 64 | float4 texcoord0 : TEXCOORD0; 65 | float2 texcoord1 : TEXCOORD1; 66 | }; 67 | 68 | struct v2f 69 | { 70 | float4 vertex : SV_POSITION; 71 | fixed4 color : COLOR; 72 | float2 texcoord0 : TEXCOORD0; 73 | float2 texcoord1 : TEXCOORD1; 74 | float4 mask : TEXCOORD2; 75 | }; 76 | 77 | uniform sampler2D _MainTex; 78 | uniform sampler2D _FaceTex; 79 | uniform float4 _FaceTex_ST; 80 | uniform fixed4 _FaceColor; 81 | 82 | uniform float _VertexOffsetX; 83 | uniform float _VertexOffsetY; 84 | uniform float4 _ClipRect; 85 | uniform float _MaskSoftnessX; 86 | uniform float _MaskSoftnessY; 87 | uniform float _UIMaskSoftnessX; 88 | uniform float _UIMaskSoftnessY; 89 | uniform int _UIVertexColorAlwaysGammaSpace; 90 | 91 | v2f vert (appdata_t v) 92 | { 93 | float4 vert = v.vertex; 94 | vert.x += _VertexOffsetX; 95 | vert.y += _VertexOffsetY; 96 | 97 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 98 | 99 | float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); 100 | 101 | if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace()) 102 | { 103 | v.color.rgb = UIGammaToLinear(v.color.rgb); 104 | } 105 | fixed4 faceColor = v.color; 106 | faceColor *= _FaceColor; 107 | 108 | v2f OUT; 109 | OUT.vertex = vPosition; 110 | OUT.color = faceColor; 111 | OUT.texcoord0 = v.texcoord0; 112 | OUT.texcoord1 = TRANSFORM_TEX(v.texcoord1, _FaceTex); 113 | float2 pixelSize = vPosition.w; 114 | pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 115 | 116 | // Clamp _ClipRect to 16bit. 117 | const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 118 | const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); 119 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy)); 120 | 121 | return OUT; 122 | } 123 | 124 | fixed4 frag (v2f IN) : SV_Target 125 | { 126 | fixed4 color = tex2D(_MainTex, IN.texcoord0) * tex2D(_FaceTex, IN.texcoord1) * IN.color; 127 | 128 | // Alternative implementation to UnityGet2DClipping with support for softness. 129 | #if UNITY_UI_CLIP_RECT 130 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 131 | color *= m.x * m.y; 132 | #endif 133 | 134 | #if UNITY_UI_ALPHACLIP 135 | clip(color.a - 0.001); 136 | #endif 137 | 138 | return color; 139 | } 140 | ENDCG 141 | } 142 | } 143 | 144 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 145 | } 146 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48bb5f55d8670e349b6e614913f9d910 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap-Mobile.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Mobile/Bitmap" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _Color ("Text Color", Color) = (1,1,1,1) 6 | _DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0 7 | 8 | _VertexOffsetX ("Vertex OffsetX", float) = 0 9 | _VertexOffsetY ("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | 15 | _StencilComp ("Stencil Comparison", Float) = 8 16 | _Stencil ("Stencil ID", Float) = 0 17 | _StencilOp ("Stencil Operation", Float) = 0 18 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 19 | _StencilReadMask ("Stencil Read Mask", Float) = 255 20 | 21 | _CullMode ("Cull Mode", Float) = 0 22 | _ColorMask ("Color Mask", Float) = 15 23 | } 24 | 25 | SubShader { 26 | 27 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 28 | 29 | Stencil 30 | { 31 | Ref[_Stencil] 32 | Comp[_StencilComp] 33 | Pass[_StencilOp] 34 | ReadMask[_StencilReadMask] 35 | WriteMask[_StencilWriteMask] 36 | } 37 | 38 | 39 | Lighting Off 40 | Cull [_CullMode] 41 | ZTest [unity_GUIZTestMode] 42 | ZWrite Off 43 | Fog { Mode Off } 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask[_ColorMask] 46 | 47 | Pass { 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | #pragma fragmentoption ARB_precision_hint_fastest 52 | 53 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 54 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 55 | 56 | 57 | #include "UnityCG.cginc" 58 | #include "UnityUI.cginc" 59 | 60 | struct appdata_t 61 | { 62 | float4 vertex : POSITION; 63 | fixed4 color : COLOR; 64 | float2 texcoord0 : TEXCOORD0; 65 | float2 texcoord1 : TEXCOORD1; 66 | }; 67 | 68 | struct v2f 69 | { 70 | float4 vertex : POSITION; 71 | fixed4 color : COLOR; 72 | float2 texcoord0 : TEXCOORD0; 73 | float4 mask : TEXCOORD2; 74 | }; 75 | 76 | sampler2D _MainTex; 77 | fixed4 _Color; 78 | float _DiffusePower; 79 | 80 | uniform float _VertexOffsetX; 81 | uniform float _VertexOffsetY; 82 | uniform float4 _ClipRect; 83 | uniform float _MaskSoftnessX; 84 | uniform float _MaskSoftnessY; 85 | uniform float _UIMaskSoftnessX; 86 | uniform float _UIMaskSoftnessY; 87 | uniform int _UIVertexColorAlwaysGammaSpace; 88 | 89 | v2f vert (appdata_t v) 90 | { 91 | v2f OUT; 92 | float4 vert = v.vertex; 93 | vert.x += _VertexOffsetX; 94 | vert.y += _VertexOffsetY; 95 | 96 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 97 | if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace()) 98 | { 99 | v.color.rgb = UIGammaToLinear(v.color.rgb); 100 | } 101 | OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert)); 102 | OUT.color = v.color; 103 | OUT.color *= _Color; 104 | OUT.color.rgb *= _DiffusePower; 105 | OUT.texcoord0 = v.texcoord0; 106 | 107 | float2 pixelSize = OUT.vertex.w; 108 | //pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 109 | 110 | // Clamp _ClipRect to 16bit. 111 | const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 112 | const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); 113 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy)); 114 | 115 | return OUT; 116 | } 117 | 118 | fixed4 frag (v2f IN) : COLOR 119 | { 120 | fixed4 color = fixed4(IN.color.rgb, IN.color.a * tex2D(_MainTex, IN.texcoord0).a); 121 | 122 | // Alternative implementation to UnityGet2DClipping with support for softness. 123 | #if UNITY_UI_CLIP_RECT 124 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 125 | color *= m.x * m.y; 126 | #endif 127 | 128 | #if UNITY_UI_ALPHACLIP 129 | clip(color.a - 0.001); 130 | #endif 131 | 132 | return color; 133 | } 134 | ENDCG 135 | } 136 | } 137 | 138 | SubShader { 139 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 140 | Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off } 141 | Blend SrcAlpha OneMinusSrcAlpha 142 | BindChannels { 143 | Bind "Color", color 144 | Bind "Vertex", vertex 145 | Bind "TexCoord", texcoord0 146 | } 147 | Pass { 148 | SetTexture [_MainTex] { 149 | constantColor [_Color] combine constant * primary, constant * texture 150 | } 151 | } 152 | } 153 | 154 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 155 | } 156 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e3b057af24249748ff873be7fafee47 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Bitmap" { 2 | 3 | Properties { 4 | _MainTex ("Font Atlas", 2D) = "white" {} 5 | _FaceTex ("Font Texture", 2D) = "white" {} 6 | _FaceColor ("Text Color", Color) = (1,1,1,1) 7 | 8 | _VertexOffsetX ("Vertex OffsetX", float) = 0 9 | _VertexOffsetY ("Vertex OffsetY", float) = 0 10 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 11 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 12 | 13 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 14 | 15 | _StencilComp ("Stencil Comparison", Float) = 8 16 | _Stencil ("Stencil ID", Float) = 0 17 | _StencilOp ("Stencil Operation", Float) = 0 18 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 19 | _StencilReadMask ("Stencil Read Mask", Float) = 255 20 | 21 | _CullMode ("Cull Mode", Float) = 0 22 | _ColorMask ("Color Mask", Float) = 15 23 | } 24 | 25 | SubShader{ 26 | 27 | Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" } 28 | 29 | Stencil 30 | { 31 | Ref[_Stencil] 32 | Comp[_StencilComp] 33 | Pass[_StencilOp] 34 | ReadMask[_StencilReadMask] 35 | WriteMask[_StencilWriteMask] 36 | } 37 | 38 | 39 | Lighting Off 40 | Cull [_CullMode] 41 | ZTest [unity_GUIZTestMode] 42 | ZWrite Off 43 | Fog { Mode Off } 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask[_ColorMask] 46 | 47 | Pass { 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | 52 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 53 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 54 | 55 | 56 | #include "UnityCG.cginc" 57 | #include "UnityUI.cginc" 58 | 59 | struct appdata_t 60 | { 61 | float4 vertex : POSITION; 62 | fixed4 color : COLOR; 63 | float4 texcoord0 : TEXCOORD0; 64 | float2 texcoord1 : TEXCOORD1; 65 | }; 66 | 67 | struct v2f 68 | { 69 | float4 vertex : SV_POSITION; 70 | fixed4 color : COLOR; 71 | float2 texcoord0 : TEXCOORD0; 72 | float2 texcoord1 : TEXCOORD1; 73 | float4 mask : TEXCOORD2; 74 | }; 75 | 76 | uniform sampler2D _MainTex; 77 | uniform sampler2D _FaceTex; 78 | uniform float4 _FaceTex_ST; 79 | uniform fixed4 _FaceColor; 80 | 81 | uniform float _VertexOffsetX; 82 | uniform float _VertexOffsetY; 83 | uniform float4 _ClipRect; 84 | uniform float _MaskSoftnessX; 85 | uniform float _MaskSoftnessY; 86 | uniform float _UIMaskSoftnessX; 87 | uniform float _UIMaskSoftnessY; 88 | uniform int _UIVertexColorAlwaysGammaSpace; 89 | 90 | v2f vert (appdata_t v) 91 | { 92 | float4 vert = v.vertex; 93 | vert.x += _VertexOffsetX; 94 | vert.y += _VertexOffsetY; 95 | 96 | vert.xy += (vert.w * 0.5) / _ScreenParams.xy; 97 | 98 | float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert)); 99 | 100 | if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace()) 101 | { 102 | v.color.rgb = UIGammaToLinear(v.color.rgb); 103 | } 104 | fixed4 faceColor = v.color; 105 | faceColor *= _FaceColor; 106 | 107 | v2f OUT; 108 | OUT.vertex = vPosition; 109 | OUT.color = faceColor; 110 | OUT.texcoord0 = v.texcoord0; 111 | OUT.texcoord1 = TRANSFORM_TEX(v.texcoord1, _FaceTex); 112 | float2 pixelSize = vPosition.w; 113 | pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1])); 114 | 115 | // Clamp _ClipRect to 16bit. 116 | const float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 117 | const half2 maskSoftness = half2(max(_UIMaskSoftnessX, _MaskSoftnessX), max(_UIMaskSoftnessY, _MaskSoftnessY)); 118 | OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * maskSoftness + pixelSize.xy)); 119 | 120 | return OUT; 121 | } 122 | 123 | fixed4 frag (v2f IN) : SV_Target 124 | { 125 | fixed4 color = tex2D(_MainTex, IN.texcoord0); 126 | color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, IN.color.a * color.a); 127 | 128 | // Alternative implementation to UnityGet2DClipping with support for softness. 129 | #if UNITY_UI_CLIP_RECT 130 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 131 | color *= m.x * m.y; 132 | #endif 133 | 134 | #if UNITY_UI_ALPHACLIP 135 | clip(color.a - 0.001); 136 | #endif 137 | 138 | return color; 139 | } 140 | ENDCG 141 | } 142 | } 143 | 144 | CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI" 145 | } 146 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Bitmap.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 128e987d567d4e2c824d754223b3f3b0 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd89cf5b9246416f84610a006f916af7 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF SSD.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14eb328de4b8eb245bb7cea29e4ac00b 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-HDRP LIT.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca2ed216f98028c4dae6c5224a952b3c 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-HDRP UNLIT.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f63d574838ccfb44f84acc05fed0af48 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile Masking.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc1ede39bf3643ee8e493720e4259791 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02a7d8c237544f1962732b55a9aebf1 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile SSD.shader: -------------------------------------------------------------------------------- 1 | // Simplified SDF shader: 2 | // - No Shading Option (bevel / bump / env map) 3 | // - No Glow Option 4 | // - Softness is applied on both side of the outline 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field SSD" { 7 | 8 | Properties { 9 | _FaceColor ("Face Color", Color) = (1,1,1,1) 10 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 11 | 12 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 13 | _OutlineWidth ("Outline Thickness", Range(0,1)) = 0 14 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 15 | 16 | _UnderlayColor ("Border Color", Color) = (0,0,0,.5) 17 | _UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0 18 | _UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0 19 | _UnderlayDilate ("Border Dilate", Range(-1,1)) = 0 20 | _UnderlaySoftness ("Border Softness", Range(0,1)) = 0 21 | 22 | _WeightNormal ("Weight Normal", float) = 0 23 | _WeightBold ("Weight Bold", float) = .5 24 | 25 | _ShaderFlags ("Flags", float) = 0 26 | _ScaleRatioA ("Scale RatioA", float) = 1 27 | _ScaleRatioB ("Scale RatioB", float) = 1 28 | _ScaleRatioC ("Scale RatioC", float) = 1 29 | 30 | _MainTex ("Font Atlas", 2D) = "white" {} 31 | _TextureWidth ("Texture Width", float) = 512 32 | _TextureHeight ("Texture Height", float) = 512 33 | _GradientScale ("Gradient Scale", float) = 5 34 | _ScaleX ("Scale X", float) = 1 35 | _ScaleY ("Scale Y", float) = 1 36 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 37 | _Sharpness ("Sharpness", Range(-1,1)) = 0 38 | 39 | _VertexOffsetX ("Vertex OffsetX", float) = 0 40 | _VertexOffsetY ("Vertex OffsetY", float) = 0 41 | 42 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 43 | _MaskSoftnessX ("Mask SoftnessX", float) = 0 44 | _MaskSoftnessY ("Mask SoftnessY", float) = 0 45 | _MaskTex ("Mask Texture", 2D) = "white" {} 46 | _MaskInverse ("Inverse", float) = 0 47 | _MaskEdgeColor ("Edge Color", Color) = (1,1,1,1) 48 | _MaskEdgeSoftness ("Edge Softness", Range(0, 1)) = 0.01 49 | _MaskWipeControl ("Wipe Position", Range(0, 1)) = 0.5 50 | 51 | _StencilComp ("Stencil Comparison", Float) = 8 52 | _Stencil ("Stencil ID", Float) = 0 53 | _StencilOp ("Stencil Operation", Float) = 0 54 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 55 | _StencilReadMask ("Stencil Read Mask", Float) = 255 56 | 57 | _CullMode ("Cull Mode", Float) = 0 58 | _ColorMask ("Color Mask", Float) = 15 59 | } 60 | 61 | SubShader { 62 | Tags { 63 | "Queue"="Transparent" 64 | "IgnoreProjector"="True" 65 | "RenderType"="Transparent" 66 | } 67 | 68 | Stencil 69 | { 70 | Ref [_Stencil] 71 | Comp [_StencilComp] 72 | Pass [_StencilOp] 73 | ReadMask [_StencilReadMask] 74 | WriteMask [_StencilWriteMask] 75 | } 76 | 77 | Cull [_CullMode] 78 | ZWrite Off 79 | Lighting Off 80 | Fog { Mode Off } 81 | ZTest [unity_GUIZTestMode] 82 | Blend One OneMinusSrcAlpha 83 | ColorMask [_ColorMask] 84 | 85 | Pass { 86 | CGPROGRAM 87 | #pragma vertex VertShader 88 | #pragma fragment PixShader 89 | #pragma shader_feature __ OUTLINE_ON 90 | #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER 91 | 92 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 93 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 94 | 95 | #include "UnityCG.cginc" 96 | #include "UnityUI.cginc" 97 | #include "TMPro_Properties.cginc" 98 | 99 | #include "TMPro_Mobile.cginc" 100 | 101 | ENDCG 102 | } 103 | } 104 | 105 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 106 | } 107 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile SSD.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8d12adcee749c344b8117cf7c7eb912 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile-2-Pass.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0178fcb869bafef4690d177d31d17db8 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe393ace9b354375a9cb14cdbbc28be4 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Surface-Mobile.shader: -------------------------------------------------------------------------------- 1 | // Simplified version of the SDF Surface shader : 2 | // - No support for Bevel, Bump or envmap 3 | // - Diffuse only lighting 4 | // - Fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 5 | 6 | Shader "TextMeshPro/Mobile/Distance Field (Surface)" { 7 | 8 | Properties { 9 | _FaceTex ("Fill Texture", 2D) = "white" {} 10 | _FaceColor ("Fill Color", Color) = (1,1,1,1) 11 | _FaceDilate ("Face Dilate", Range(-1,1)) = 0 12 | 13 | _OutlineColor ("Outline Color", Color) = (0,0,0,1) 14 | _OutlineTex ("Outline Texture", 2D) = "white" {} 15 | _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0 16 | _OutlineSoftness ("Outline Softness", Range(0,1)) = 0 17 | 18 | _GlowColor ("Color", Color) = (0, 1, 0, 0.5) 19 | _GlowOffset ("Offset", Range(-1,1)) = 0 20 | _GlowInner ("Inner", Range(0,1)) = 0.05 21 | _GlowOuter ("Outer", Range(0,1)) = 0.05 22 | _GlowPower ("Falloff", Range(1, 0)) = 0.75 23 | 24 | _WeightNormal ("Weight Normal", float) = 0 25 | _WeightBold ("Weight Bold", float) = 0.5 26 | 27 | // Should not be directly exposed to the user 28 | _ShaderFlags ("Flags", float) = 0 29 | _ScaleRatioA ("Scale RatioA", float) = 1 30 | _ScaleRatioB ("Scale RatioB", float) = 1 31 | _ScaleRatioC ("Scale RatioC", float) = 1 32 | 33 | _MainTex ("Font Atlas", 2D) = "white" {} 34 | _TextureWidth ("Texture Width", float) = 512 35 | _TextureHeight ("Texture Height", float) = 512 36 | _GradientScale ("Gradient Scale", float) = 5.0 37 | _ScaleX ("Scale X", float) = 1.0 38 | _ScaleY ("Scale Y", float) = 1.0 39 | _PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875 40 | _Sharpness ("Sharpness", Range(-1,1)) = 0 41 | 42 | _VertexOffsetX ("Vertex OffsetX", float) = 0 43 | _VertexOffsetY ("Vertex OffsetY", float) = 0 44 | 45 | _CullMode ("Cull Mode", Float) = 0 46 | //_MaskCoord ("Mask Coords", vector) = (0,0,0,0) 47 | //_MaskSoftness ("Mask Softness", float) = 0 48 | } 49 | 50 | SubShader { 51 | 52 | Tags { 53 | "Queue"="Transparent" 54 | "IgnoreProjector"="True" 55 | "RenderType"="Transparent" 56 | } 57 | 58 | LOD 300 59 | Cull [_CullMode] 60 | 61 | CGPROGRAM 62 | #pragma surface PixShader Lambert alpha:blend vertex:VertShader noforwardadd nolightmap nodirlightmap 63 | #pragma target 3.0 64 | #pragma shader_feature __ GLOW_ON 65 | 66 | #include "TMPro_Properties.cginc" 67 | #include "TMPro.cginc" 68 | 69 | half _FaceShininess; 70 | half _OutlineShininess; 71 | 72 | struct Input 73 | { 74 | fixed4 color : COLOR; 75 | float2 uv_MainTex; 76 | float2 uv2_FaceTex; 77 | float2 uv2_OutlineTex; 78 | float2 param; // Weight, Scale 79 | float3 viewDirEnv; 80 | }; 81 | 82 | #include "TMPro_Surface.cginc" 83 | 84 | ENDCG 85 | 86 | // Pass to render object as a shadow caster 87 | Pass 88 | { 89 | Name "Caster" 90 | Tags { "LightMode" = "ShadowCaster" } 91 | Offset 1, 1 92 | 93 | Fog {Mode Off} 94 | ZWrite On ZTest LEqual Cull Off 95 | 96 | CGPROGRAM 97 | #pragma vertex vert 98 | #pragma fragment frag 99 | #pragma multi_compile_shadowcaster 100 | #include "UnityCG.cginc" 101 | 102 | struct v2f 103 | { 104 | V2F_SHADOW_CASTER; 105 | float2 uv : TEXCOORD1; 106 | float2 uv2 : TEXCOORD3; 107 | float alphaClip : TEXCOORD2; 108 | }; 109 | 110 | uniform float4 _MainTex_ST; 111 | uniform float4 _OutlineTex_ST; 112 | float _OutlineWidth; 113 | float _FaceDilate; 114 | float _ScaleRatioA; 115 | 116 | v2f vert( appdata_base v ) 117 | { 118 | v2f o; 119 | TRANSFER_SHADOW_CASTER(o) 120 | o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); 121 | o.uv2 = TRANSFORM_TEX(v.texcoord, _OutlineTex); 122 | o.alphaClip = o.alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _FaceDilate * _ScaleRatioA) / 2; 123 | return o; 124 | } 125 | 126 | uniform sampler2D _MainTex; 127 | 128 | float4 frag(v2f i) : COLOR 129 | { 130 | fixed4 texcol = tex2D(_MainTex, i.uv).a; 131 | clip(texcol.a - i.alphaClip); 132 | SHADOW_CASTER_FRAGMENT(i) 133 | } 134 | ENDCG 135 | } 136 | } 137 | 138 | CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI" 139 | } 140 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Surface-Mobile.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85187c2149c549c5b33f0cdb02836b17 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-Surface.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7ada0af4f174f0694ca6a487b8f543d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-URP Lit.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3d800b099a06e0478fb790c5e79057a 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF-URP Unlit.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 124c112a6e8f1a54e8b0870e881b56d8 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_SDF.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68e6db2ebdc24f95958faec2be5558d6 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Sprite.shader: -------------------------------------------------------------------------------- 1 | Shader "TextMeshPro/Sprite" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _CullMode ("Cull Mode", Float) = 0 15 | _ColorMask ("Color Mask", Float) = 15 16 | _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767) 17 | 18 | [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0 19 | } 20 | 21 | SubShader 22 | { 23 | Tags 24 | { 25 | "Queue"="Transparent" 26 | "IgnoreProjector"="True" 27 | "RenderType"="Transparent" 28 | "PreviewType"="Plane" 29 | "CanUseSpriteAtlas"="True" 30 | } 31 | 32 | Stencil 33 | { 34 | Ref [_Stencil] 35 | Comp [_StencilComp] 36 | Pass [_StencilOp] 37 | ReadMask [_StencilReadMask] 38 | WriteMask [_StencilWriteMask] 39 | } 40 | 41 | Cull [_CullMode] 42 | Lighting Off 43 | ZWrite Off 44 | ZTest [unity_GUIZTestMode] 45 | Blend SrcAlpha OneMinusSrcAlpha 46 | ColorMask [_ColorMask] 47 | 48 | Pass 49 | { 50 | Name "Default" 51 | CGPROGRAM 52 | #pragma vertex vert 53 | #pragma fragment frag 54 | #pragma target 2.0 55 | 56 | #include "UnityCG.cginc" 57 | #include "UnityUI.cginc" 58 | 59 | #pragma multi_compile __ UNITY_UI_CLIP_RECT 60 | #pragma multi_compile __ UNITY_UI_ALPHACLIP 61 | 62 | struct appdata_t 63 | { 64 | float4 vertex : POSITION; 65 | float4 color : COLOR; 66 | float2 texcoord : TEXCOORD0; 67 | UNITY_VERTEX_INPUT_INSTANCE_ID 68 | }; 69 | 70 | struct v2f 71 | { 72 | float4 vertex : SV_POSITION; 73 | fixed4 color : COLOR; 74 | float2 texcoord : TEXCOORD0; 75 | float4 worldPosition : TEXCOORD1; 76 | float4 mask : TEXCOORD2; 77 | UNITY_VERTEX_OUTPUT_STEREO 78 | }; 79 | 80 | sampler2D _MainTex; 81 | fixed4 _Color; 82 | fixed4 _TextureSampleAdd; 83 | float4 _ClipRect; 84 | float4 _MainTex_ST; 85 | float _UIMaskSoftnessX; 86 | float _UIMaskSoftnessY; 87 | int _UIVertexColorAlwaysGammaSpace; 88 | 89 | v2f vert(appdata_t v) 90 | { 91 | v2f OUT; 92 | UNITY_SETUP_INSTANCE_ID(v); 93 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT); 94 | float4 vPosition = UnityObjectToClipPos(v.vertex); 95 | OUT.worldPosition = v.vertex; 96 | OUT.vertex = vPosition; 97 | 98 | float2 pixelSize = vPosition.w; 99 | pixelSize /= abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy)); 100 | 101 | float4 clampedRect = clamp(_ClipRect, -2e10, 2e10); 102 | OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 103 | OUT.mask = half4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); 104 | 105 | if (_UIVertexColorAlwaysGammaSpace && !IsGammaSpace()) 106 | { 107 | v.color.rgb = UIGammaToLinear(v.color.rgb); 108 | } 109 | OUT.color = v.color * _Color; 110 | return OUT; 111 | } 112 | 113 | fixed4 frag(v2f IN) : SV_Target 114 | { 115 | half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color; 116 | 117 | #if UNITY_UI_CLIP_RECT 118 | half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw); 119 | color *= m.x * m.y; 120 | #endif 121 | 122 | #ifdef UNITY_UI_ALPHACLIP 123 | clip (color.a - 0.001); 124 | #endif 125 | 126 | return color; 127 | } 128 | ENDCG 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMP_Sprite.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf81c85f95fe47e1a27f6ae460cf182c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro.cginc: -------------------------------------------------------------------------------- 1 | float2 UnpackUV(float uv) 2 | { 3 | float2 output; 4 | output.x = floor(uv / 4096); 5 | output.y = uv - 4096 * output.x; 6 | 7 | return output * 0.001953125; 8 | } 9 | 10 | fixed4 GetColor(half d, fixed4 faceColor, fixed4 outlineColor, half outline, half softness) 11 | { 12 | half faceAlpha = 1-saturate((d - outline * 0.5 + softness * 0.5) / (1.0 + softness)); 13 | half outlineAlpha = saturate((d + outline * 0.5)) * sqrt(min(1.0, outline)); 14 | 15 | faceColor.rgb *= faceColor.a; 16 | outlineColor.rgb *= outlineColor.a; 17 | 18 | faceColor = lerp(faceColor, outlineColor, outlineAlpha); 19 | 20 | faceColor *= faceAlpha; 21 | 22 | return faceColor; 23 | } 24 | 25 | float3 GetSurfaceNormal(float4 h, float bias) 26 | { 27 | bool raisedBevel = step(1, fmod(_ShaderFlags, 2)); 28 | 29 | h += bias+_BevelOffset; 30 | 31 | float bevelWidth = max(.01, _OutlineWidth+_BevelWidth); 32 | 33 | // Track outline 34 | h -= .5; 35 | h /= bevelWidth; 36 | h = saturate(h+.5); 37 | 38 | if(raisedBevel) h = 1 - abs(h*2.0 - 1.0); 39 | h = lerp(h, sin(h*3.141592/2.0), _BevelRoundness); 40 | h = min(h, 1.0-_BevelClamp); 41 | h *= _Bevel * bevelWidth * _GradientScale * -2.0; 42 | 43 | float3 va = normalize(float3(1.0, 0.0, h.y - h.x)); 44 | float3 vb = normalize(float3(0.0, -1.0, h.w - h.z)); 45 | 46 | return cross(va, vb); 47 | } 48 | 49 | float3 GetSurfaceNormal(float2 uv, float bias, float3 delta) 50 | { 51 | // Read "height field" 52 | float4 h = {tex2D(_MainTex, uv - delta.xz).a, 53 | tex2D(_MainTex, uv + delta.xz).a, 54 | tex2D(_MainTex, uv - delta.zy).a, 55 | tex2D(_MainTex, uv + delta.zy).a}; 56 | 57 | return GetSurfaceNormal(h, bias); 58 | } 59 | 60 | float3 GetSpecular(float3 n, float3 l) 61 | { 62 | float spec = pow(max(0.0, dot(n, l)), _Reflectivity); 63 | return _SpecularColor.rgb * spec * _SpecularPower; 64 | } 65 | 66 | float4 GetGlowColor(float d, float scale) 67 | { 68 | float glow = d - (_GlowOffset*_ScaleRatioB) * 0.5 * scale; 69 | float t = lerp(_GlowInner, (_GlowOuter * _ScaleRatioB), step(0.0, glow)) * 0.5 * scale; 70 | glow = saturate(abs(glow/(1.0 + t))); 71 | glow = 1.0-pow(glow, _GlowPower); 72 | glow *= sqrt(min(1.0, t)); // Fade off glow thinner than 1 screen pixel 73 | return float4(_GlowColor.rgb, saturate(_GlowColor.a * glow * 2)); 74 | } 75 | 76 | float4 BlendARGB(float4 overlying, float4 underlying) 77 | { 78 | overlying.rgb *= overlying.a; 79 | underlying.rgb *= underlying.a; 80 | float3 blended = overlying.rgb + ((1-overlying.a)*underlying.rgb); 81 | float alpha = underlying.a + (1-underlying.a)*overlying.a; 82 | return float4(blended, alpha); 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 407bc68d299748449bbf7f48ee690f8d 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: Version 2.0 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro_Mobile.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c334973cef89a9840b0b0c507e0377ab 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc: -------------------------------------------------------------------------------- 1 | // UI Editable properties 2 | uniform sampler2D _FaceTex; // Alpha : Signed Distance 3 | uniform float _FaceUVSpeedX; 4 | uniform float _FaceUVSpeedY; 5 | uniform fixed4 _FaceColor; // RGBA : Color + Opacity 6 | uniform float _FaceDilate; // v[ 0, 1] 7 | uniform float _OutlineSoftness; // v[ 0, 1] 8 | 9 | uniform sampler2D _OutlineTex; // RGBA : Color + Opacity 10 | uniform float _OutlineUVSpeedX; 11 | uniform float _OutlineUVSpeedY; 12 | uniform fixed4 _OutlineColor; // RGBA : Color + Opacity 13 | uniform float _OutlineWidth; // v[ 0, 1] 14 | 15 | uniform float _Bevel; // v[ 0, 1] 16 | uniform float _BevelOffset; // v[-1, 1] 17 | uniform float _BevelWidth; // v[-1, 1] 18 | uniform float _BevelClamp; // v[ 0, 1] 19 | uniform float _BevelRoundness; // v[ 0, 1] 20 | 21 | uniform sampler2D _BumpMap; // Normal map 22 | uniform float _BumpOutline; // v[ 0, 1] 23 | uniform float _BumpFace; // v[ 0, 1] 24 | 25 | uniform samplerCUBE _Cube; // Cube / sphere map 26 | uniform fixed4 _ReflectFaceColor; // RGB intensity 27 | uniform fixed4 _ReflectOutlineColor; 28 | //uniform float _EnvTiltX; // v[-1, 1] 29 | //uniform float _EnvTiltY; // v[-1, 1] 30 | uniform float3 _EnvMatrixRotation; 31 | uniform float4x4 _EnvMatrix; 32 | 33 | uniform fixed4 _SpecularColor; // RGB intensity 34 | uniform float _LightAngle; // v[ 0,Tau] 35 | uniform float _SpecularPower; // v[ 0, 1] 36 | uniform float _Reflectivity; // v[ 5, 15] 37 | uniform float _Diffuse; // v[ 0, 1] 38 | uniform float _Ambient; // v[ 0, 1] 39 | 40 | uniform fixed4 _UnderlayColor; // RGBA : Color + Opacity 41 | uniform float _UnderlayOffsetX; // v[-1, 1] 42 | uniform float _UnderlayOffsetY; // v[-1, 1] 43 | uniform float _UnderlayDilate; // v[-1, 1] 44 | uniform float _UnderlaySoftness; // v[ 0, 1] 45 | 46 | uniform fixed4 _GlowColor; // RGBA : Color + Intesity 47 | uniform float _GlowOffset; // v[-1, 1] 48 | uniform float _GlowOuter; // v[ 0, 1] 49 | uniform float _GlowInner; // v[ 0, 1] 50 | uniform float _GlowPower; // v[ 1, 1/(1+4*4)] 51 | 52 | // API Editable properties 53 | uniform float _ShaderFlags; 54 | uniform float _WeightNormal; 55 | uniform float _WeightBold; 56 | 57 | uniform float _ScaleRatioA; 58 | uniform float _ScaleRatioB; 59 | uniform float _ScaleRatioC; 60 | 61 | uniform float _VertexOffsetX; 62 | uniform float _VertexOffsetY; 63 | 64 | //uniform float _UseClipRect; 65 | uniform float _MaskID; 66 | uniform sampler2D _MaskTex; 67 | uniform float4 _MaskCoord; 68 | uniform float4 _ClipRect; // bottom left(x,y) : top right(z,w) 69 | uniform float _MaskSoftnessX; 70 | uniform float _MaskSoftnessY; 71 | 72 | // Font Atlas properties 73 | uniform sampler2D _MainTex; 74 | uniform float _TextureWidth; 75 | uniform float _TextureHeight; 76 | uniform float _GradientScale; 77 | uniform float _ScaleX; 78 | uniform float _ScaleY; 79 | uniform float _PerspectiveFilter; 80 | uniform float _Sharpness; 81 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3997e2241185407d80309a82f9148466 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro_Surface.cginc: -------------------------------------------------------------------------------- 1 | void VertShader(inout appdata_full v, out Input data) 2 | { 3 | v.vertex.x += _VertexOffsetX; 4 | v.vertex.y += _VertexOffsetY; 5 | 6 | UNITY_INITIALIZE_OUTPUT(Input, data); 7 | 8 | float bold = step(v.texcoord.w, 0); 9 | 10 | // Generate normal for backface 11 | float3 view = ObjSpaceViewDir(v.vertex); 12 | v.normal *= sign(dot(v.normal, view)); 13 | 14 | #if USE_DERIVATIVE 15 | data.param.y = 1; 16 | #else 17 | float4 vert = v.vertex; 18 | float4 vPosition = UnityObjectToClipPos(vert); 19 | float2 pixelSize = vPosition.w; 20 | 21 | pixelSize /= float2(_ScaleX, _ScaleY) * mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy); 22 | float scale = rsqrt(dot(pixelSize, pixelSize)); 23 | scale *= abs(v.texcoord.w) * _GradientScale * (_Sharpness + 1); 24 | scale = lerp(scale * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(v.normal.xyz), normalize(WorldSpaceViewDir(vert))))); 25 | data.param.y = scale; 26 | #endif 27 | 28 | data.param.x = (lerp(_WeightNormal, _WeightBold, bold) / 4.0 + _FaceDilate) * _ScaleRatioA * 0.5; // 29 | data.viewDirEnv = mul((float3x3)_EnvMatrix, WorldSpaceViewDir(v.vertex)); 30 | } 31 | 32 | void PixShader(Input input, inout SurfaceOutput o) 33 | { 34 | 35 | #if USE_DERIVATIVE 36 | float2 pixelSize = float2(ddx(input.uv_MainTex.y), ddy(input.uv_MainTex.y)); 37 | pixelSize *= _TextureWidth * .75; 38 | float scale = rsqrt(dot(pixelSize, pixelSize)) * _GradientScale * (_Sharpness + 1); 39 | #else 40 | float scale = input.param.y; 41 | #endif 42 | 43 | // Signed distance 44 | float c = tex2D(_MainTex, input.uv_MainTex).a; 45 | float sd = (.5 - c - input.param.x) * scale + .5; 46 | float outline = _OutlineWidth*_ScaleRatioA * scale; 47 | float softness = _OutlineSoftness*_ScaleRatioA * scale; 48 | 49 | // Color & Alpha 50 | float4 faceColor = _FaceColor; 51 | float4 outlineColor = _OutlineColor; 52 | faceColor *= input.color; 53 | outlineColor.a *= input.color.a; 54 | faceColor *= tex2D(_FaceTex, float2(input.uv2_FaceTex.x + _FaceUVSpeedX * _Time.y, input.uv2_FaceTex.y + _FaceUVSpeedY * _Time.y)); 55 | outlineColor *= tex2D(_OutlineTex, float2(input.uv2_OutlineTex.x + _OutlineUVSpeedX * _Time.y, input.uv2_OutlineTex.y + _OutlineUVSpeedY * _Time.y)); 56 | faceColor = GetColor(sd, faceColor, outlineColor, outline, softness); 57 | faceColor.rgb /= max(faceColor.a, 0.0001); 58 | 59 | #if BEVEL_ON 60 | float3 delta = float3(1.0 / _TextureWidth, 1.0 / _TextureHeight, 0.0); 61 | 62 | float4 smp4x = {tex2D(_MainTex, input.uv_MainTex - delta.xz).a, 63 | tex2D(_MainTex, input.uv_MainTex + delta.xz).a, 64 | tex2D(_MainTex, input.uv_MainTex - delta.zy).a, 65 | tex2D(_MainTex, input.uv_MainTex + delta.zy).a }; 66 | 67 | // Face Normal 68 | float3 n = GetSurfaceNormal(smp4x, input.param.x); 69 | 70 | // Bumpmap 71 | float3 bump = UnpackNormal(tex2D(_BumpMap, input.uv2_FaceTex.xy)).xyz; 72 | bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5)); 73 | bump = lerp(float3(0, 0, 1), bump, faceColor.a); 74 | n = normalize(n - bump); 75 | 76 | // Cubemap reflection 77 | fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDirEnv, mul((float3x3)unity_ObjectToWorld, n))); 78 | float3 emission = reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a; 79 | #else 80 | float3 n = float3(0, 0, -1); 81 | float3 emission = float3(0, 0, 0); 82 | #endif 83 | 84 | #if GLOW_ON 85 | float4 glowColor = GetGlowColor(sd, scale); 86 | glowColor.a *= input.color.a; 87 | emission += glowColor.rgb*glowColor.a; 88 | faceColor = BlendARGB(glowColor, faceColor); 89 | faceColor.rgb /= max(faceColor.a, 0.0001); 90 | #endif 91 | 92 | // Set Standard output structure 93 | o.Albedo = faceColor.rgb; 94 | o.Normal = -n; 95 | o.Emission = emission; 96 | o.Specular = lerp(_FaceShininess, _OutlineShininess, saturate(sd + outline * 0.5)); 97 | o.Gloss = 1; 98 | o.Alpha = faceColor.a; 99 | } 100 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Shaders/TMPro_Surface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d930090c0cd643c7b55f19a38538c162 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0603b6d5186471b96c778c3949c7ce2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt: -------------------------------------------------------------------------------- 1 | This sample of beautiful emojis are provided by EmojiOne https://www.emojione.com/ 2 | 3 | Please visit their website to view the complete set of their emojis and review their licensing terms. -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne Attribution.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 381dcb09d5029d14897e55f98031fca5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.json: -------------------------------------------------------------------------------- 1 | {"frames": [ 2 | 3 | { 4 | "filename": "1f60a.png", 5 | "frame": {"x":0,"y":0,"w":128,"h":128}, 6 | "rotated": false, 7 | "trimmed": false, 8 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 9 | "sourceSize": {"w":128,"h":128}, 10 | "pivot": {"x":0.5,"y":0.5} 11 | }, 12 | { 13 | "filename": "1f60b.png", 14 | "frame": {"x":128,"y":0,"w":128,"h":128}, 15 | "rotated": false, 16 | "trimmed": false, 17 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 18 | "sourceSize": {"w":128,"h":128}, 19 | "pivot": {"x":0.5,"y":0.5} 20 | }, 21 | { 22 | "filename": "1f60d.png", 23 | "frame": {"x":256,"y":0,"w":128,"h":128}, 24 | "rotated": false, 25 | "trimmed": false, 26 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 27 | "sourceSize": {"w":128,"h":128}, 28 | "pivot": {"x":0.5,"y":0.5} 29 | }, 30 | { 31 | "filename": "1f60e.png", 32 | "frame": {"x":384,"y":0,"w":128,"h":128}, 33 | "rotated": false, 34 | "trimmed": false, 35 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 36 | "sourceSize": {"w":128,"h":128}, 37 | "pivot": {"x":0.5,"y":0.5} 38 | }, 39 | { 40 | "filename": "1f600.png", 41 | "frame": {"x":0,"y":128,"w":128,"h":128}, 42 | "rotated": false, 43 | "trimmed": false, 44 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 45 | "sourceSize": {"w":128,"h":128}, 46 | "pivot": {"x":0.5,"y":0.5} 47 | }, 48 | { 49 | "filename": "1f601.png", 50 | "frame": {"x":128,"y":128,"w":128,"h":128}, 51 | "rotated": false, 52 | "trimmed": false, 53 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 54 | "sourceSize": {"w":128,"h":128}, 55 | "pivot": {"x":0.5,"y":0.5} 56 | }, 57 | { 58 | "filename": "1f602.png", 59 | "frame": {"x":256,"y":128,"w":128,"h":128}, 60 | "rotated": false, 61 | "trimmed": false, 62 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 63 | "sourceSize": {"w":128,"h":128}, 64 | "pivot": {"x":0.5,"y":0.5} 65 | }, 66 | { 67 | "filename": "1f603.png", 68 | "frame": {"x":384,"y":128,"w":128,"h":128}, 69 | "rotated": false, 70 | "trimmed": false, 71 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 72 | "sourceSize": {"w":128,"h":128}, 73 | "pivot": {"x":0.5,"y":0.5} 74 | }, 75 | { 76 | "filename": "1f604.png", 77 | "frame": {"x":0,"y":256,"w":128,"h":128}, 78 | "rotated": false, 79 | "trimmed": false, 80 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 81 | "sourceSize": {"w":128,"h":128}, 82 | "pivot": {"x":0.5,"y":0.5} 83 | }, 84 | { 85 | "filename": "1f605.png", 86 | "frame": {"x":128,"y":256,"w":128,"h":128}, 87 | "rotated": false, 88 | "trimmed": false, 89 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 90 | "sourceSize": {"w":128,"h":128}, 91 | "pivot": {"x":0.5,"y":0.5} 92 | }, 93 | { 94 | "filename": "1f606.png", 95 | "frame": {"x":256,"y":256,"w":128,"h":128}, 96 | "rotated": false, 97 | "trimmed": false, 98 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 99 | "sourceSize": {"w":128,"h":128}, 100 | "pivot": {"x":0.5,"y":0.5} 101 | }, 102 | { 103 | "filename": "1f609.png", 104 | "frame": {"x":384,"y":256,"w":128,"h":128}, 105 | "rotated": false, 106 | "trimmed": false, 107 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 108 | "sourceSize": {"w":128,"h":128}, 109 | "pivot": {"x":0.5,"y":0.5} 110 | }, 111 | { 112 | "filename": "1f618.png", 113 | "frame": {"x":0,"y":384,"w":128,"h":128}, 114 | "rotated": false, 115 | "trimmed": false, 116 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 117 | "sourceSize": {"w":128,"h":128}, 118 | "pivot": {"x":0.5,"y":0.5} 119 | }, 120 | { 121 | "filename": "1f923.png", 122 | "frame": {"x":128,"y":384,"w":128,"h":128}, 123 | "rotated": false, 124 | "trimmed": false, 125 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 126 | "sourceSize": {"w":128,"h":128}, 127 | "pivot": {"x":0.5,"y":0.5} 128 | }, 129 | { 130 | "filename": "263a.png", 131 | "frame": {"x":256,"y":384,"w":128,"h":128}, 132 | "rotated": false, 133 | "trimmed": false, 134 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 135 | "sourceSize": {"w":128,"h":128}, 136 | "pivot": {"x":0.5,"y":0.5} 137 | }, 138 | { 139 | "filename": "2639.png", 140 | "frame": {"x":384,"y":384,"w":128,"h":128}, 141 | "rotated": false, 142 | "trimmed": false, 143 | "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, 144 | "sourceSize": {"w":128,"h":128}, 145 | "pivot": {"x":0.5,"y":0.5} 146 | }], 147 | "meta": { 148 | "app": "http://www.codeandweb.com/texturepacker", 149 | "version": "1.0", 150 | "image": "EmojiOne.png", 151 | "format": "RGBA8888", 152 | "size": {"w":512,"h":512}, 153 | "scale": "1", 154 | "smartupdate": "$TexturePacker:SmartUpdate:196a26a2e149d875b91ffc8fa3581e76:fc928c7e275404b7e0649307410475cb:424723c3774975ddb2053fd5c4b85f6e$" 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f05276190cf498a8153f6cbe761d4e6 3 | timeCreated: 1480316860 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TextMesh Pro/Sprites/EmojiOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korchoon/ecs-async/8730ae422dea6253d6672024969574bfc0ba2e4e/Assets/TextMesh Pro/Sprites/EmojiOne.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Mikhail Korchun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.rider": "3.0.31", 4 | "com.unity.ide.visualstudio": "2.0.22", 5 | "com.unity.timeline": "1.8.7", 6 | "com.unity.ugui": "2.0.0", 7 | "com.unity.modules.accessibility": "1.0.0", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.androidjni": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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: 13 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.1 18 | m_ClothInterCollisionStiffness: 0.2 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_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 50 37 | -------------------------------------------------------------------------------- /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 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | - enabled: 1 12 | path: Assets/Scenes/SampleScene 1.unity 13 | guid: a794d12f6f4d2ec469d13541efdf27ef 14 | m_configObjects: 15 | com.unity.adaptiveperformance.simulator.provider_settings: {fileID: 11400000, guid: 9227e98e4b6e046c5b175924d7b5d070, type: 2} 16 | com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} 17 | m_UseUCBPForAssetBundles: 0 18 | -------------------------------------------------------------------------------- /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: 13 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 1 28 | m_EnterPlayModeOptions: 0 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_AssetPipelineMode: 1 37 | m_RefreshImportMode: 0 38 | m_CacheServerMode: 0 39 | m_CacheServerEndpoint: 40 | m_CacheServerNamespacePrefix: default 41 | m_CacheServerEnableDownload: 1 42 | m_CacheServerEnableUpload: 1 43 | m_CacheServerEnableAuth: 0 44 | m_CacheServerEnableTls: 0 45 | m_CacheServerValidationMode: 2 46 | m_CacheServerDownloadBatchSize: 128 47 | m_EnableEnlightenBakedGI: 0 48 | m_ReferencedClipsExactNaming: 1 49 | -------------------------------------------------------------------------------- /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: 16 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_DepthNormals: 17 | m_Mode: 1 18 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 19 | m_MotionVectors: 20 | m_Mode: 1 21 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 22 | m_LightHalo: 23 | m_Mode: 1 24 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LensFlare: 26 | m_Mode: 1 27 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 28 | m_VideoShadersIncludeMode: 2 29 | m_AlwaysIncludedShaders: 30 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 31 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 32 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 37 | m_PreloadedShaders: [] 38 | m_PreloadShadersBatchTimeLimit: -1 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 40 | m_CustomRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd, type: 2} 41 | m_TransparencySortMode: 0 42 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 43 | m_DefaultRenderingPath: 1 44 | m_DefaultMobileRenderingPath: 1 45 | m_TierSettings: [] 46 | m_LightmapStripping: 0 47 | m_FogStripping: 0 48 | m_InstancingStripping: 0 49 | m_BrgStripping: 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_RenderPipelineGlobalSettingsMap: 61 | UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, type: 2} 62 | m_LightsUseLinearIntensity: 1 63 | m_LightsUseColorTemperature: 1 64 | m_LogWhenShaderIsCompiled: 0 65 | m_LightProbeOutsideHullStrategy: 0 66 | m_CameraRelativeLightCulling: 0 67 | m_CameraRelativeShadowCulling: 0 68 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_StrippingTypes: {} 8 | -------------------------------------------------------------------------------- /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/NotificationsSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "m_Enabled": true, 4 | "m_EditorHideFlags": 0, 5 | "m_Name": "", 6 | "m_EditorClassIdentifier": "", 7 | "ToolbarIndex": 0, 8 | "m_iOSNotificationSettingsValues": { 9 | "m_Keys": [ 10 | "UnityNotificationRequestAuthorizationOnAppLaunch", 11 | "UnityNotificationDefaultAuthorizationOptions", 12 | "UnityAddRemoteNotificationCapability", 13 | "UnityNotificationRequestAuthorizationForRemoteNotificationsOnAppLaunch", 14 | "UnityRemoteNotificationForegroundPresentationOptions", 15 | "UnityUseAPSReleaseEnvironment", 16 | "UnityUseLocationNotificationTrigger" 17 | ], 18 | "m_Values": [ 19 | "True", 20 | "7", 21 | "False", 22 | "False", 23 | "-1", 24 | "False", 25 | "False" 26 | ] 27 | }, 28 | "m_AndroidNotificationSettingsValues": { 29 | "m_Keys": [ 30 | "UnityNotificationAndroidRescheduleOnDeviceRestart", 31 | "UnityNotificationAndroidUseCustomActivity", 32 | "UnityNotificationAndroidCustomActivityString" 33 | ], 34 | "m_Values": [ 35 | "False", 36 | "False", 37 | "com.unity3d.player.UnityPlayerActivity" 38 | ] 39 | }, 40 | "DrawableResources": [] 41 | } 42 | } -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 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_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | oneTimeDeprecatedPopUpShown: 0 22 | m_Registries: 23 | - m_Id: main 24 | m_Name: 25 | m_Url: https://packages.unity.com 26 | m_Scopes: [] 27 | m_IsDefault: 1 28 | m_Capabilities: 7 29 | m_ConfigSource: 0 30 | m_UserSelectedRegistryName: 31 | m_UserAddingNewScopedRegistry: 0 32 | m_RegistryInfoDraft: 33 | m_Modified: 0 34 | m_ErrorMessage: 35 | m_UserModificationsInstanceId: -888 36 | m_OriginalInstanceId: -890 37 | m_LoadAssets: 0 38 | -------------------------------------------------------------------------------- /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: 0 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/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 6000.0.28f1 2 | m_EditorVersionWithRevision: 6000.0.28f1 (f336aca0cab5) 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: 0 8 | m_QualitySettings: 9 | - serializedVersion: 4 10 | name: Mobile 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 1 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 40 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 2 22 | globalTextureMipmapLimit: 0 23 | textureMipmapLimitSettings: [] 24 | anisotropicTextures: 1 25 | antiAliasing: 0 26 | softParticles: 0 27 | softVegetation: 1 28 | realtimeReflectionProbes: 0 29 | billboardsFaceCameraPosition: 1 30 | useLegacyDetailDistribution: 1 31 | adaptiveVsync: 0 32 | vSyncCount: 0 33 | realtimeGICPUUsage: 100 34 | adaptiveVsyncExtraA: 0 35 | adaptiveVsyncExtraB: 0 36 | lodBias: 1 37 | maximumLODLevel: 0 38 | enableLODCrossFade: 1 39 | streamingMipmapsActive: 0 40 | streamingMipmapsAddAllCameras: 1 41 | streamingMipmapsMemoryBudget: 512 42 | streamingMipmapsRenderersPerFrame: 512 43 | streamingMipmapsMaxLevelReduction: 2 44 | streamingMipmapsMaxFileIORequests: 1024 45 | particleRaycastBudget: 256 46 | asyncUploadTimeSlice: 2 47 | asyncUploadBufferSize: 16 48 | asyncUploadPersistentBuffer: 1 49 | resolutionScalingFixedDPIFactor: 1 50 | customRenderPipeline: {fileID: 11400000, guid: 5e6cbd92db86f4b18aec3ed561671858, type: 2} 51 | terrainQualityOverrides: 0 52 | terrainPixelError: 1 53 | terrainDetailDensityScale: 1 54 | terrainBasemapDistance: 1000 55 | terrainDetailDistance: 80 56 | terrainTreeDistance: 5000 57 | terrainBillboardStart: 50 58 | terrainFadeLength: 5 59 | terrainMaxTrees: 50 60 | excludedTargetPlatforms: 61 | - Standalone 62 | - serializedVersion: 4 63 | name: PC 64 | pixelLightCount: 2 65 | shadows: 2 66 | shadowResolution: 1 67 | shadowProjection: 1 68 | shadowCascades: 2 69 | shadowDistance: 40 70 | shadowNearPlaneOffset: 3 71 | shadowCascade2Split: 0.33333334 72 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 73 | shadowmaskMode: 1 74 | skinWeights: 4 75 | globalTextureMipmapLimit: 0 76 | textureMipmapLimitSettings: [] 77 | anisotropicTextures: 2 78 | antiAliasing: 0 79 | softParticles: 0 80 | softVegetation: 1 81 | realtimeReflectionProbes: 0 82 | billboardsFaceCameraPosition: 1 83 | useLegacyDetailDistribution: 1 84 | adaptiveVsync: 0 85 | vSyncCount: 0 86 | realtimeGICPUUsage: 100 87 | adaptiveVsyncExtraA: 0 88 | adaptiveVsyncExtraB: 0 89 | lodBias: 2 90 | maximumLODLevel: 0 91 | enableLODCrossFade: 1 92 | streamingMipmapsActive: 0 93 | streamingMipmapsAddAllCameras: 1 94 | streamingMipmapsMemoryBudget: 512 95 | streamingMipmapsRenderersPerFrame: 512 96 | streamingMipmapsMaxLevelReduction: 2 97 | streamingMipmapsMaxFileIORequests: 1024 98 | particleRaycastBudget: 256 99 | asyncUploadTimeSlice: 2 100 | asyncUploadBufferSize: 16 101 | asyncUploadPersistentBuffer: 1 102 | resolutionScalingFixedDPIFactor: 1 103 | customRenderPipeline: {fileID: 11400000, guid: 4b83569d67af61e458304325a23e5dfd, type: 2} 104 | terrainQualityOverrides: 0 105 | terrainPixelError: 1 106 | terrainDetailDensityScale: 1 107 | terrainBasemapDistance: 1000 108 | terrainDetailDistance: 80 109 | terrainTreeDistance: 5000 110 | terrainBillboardStart: 50 111 | terrainFadeLength: 5 112 | terrainMaxTrees: 50 113 | excludedTargetPlatforms: 114 | - Android 115 | - iPhone 116 | m_TextureMipmapLimitGroupNames: [] 117 | m_PerPlatformDefaultQuality: 118 | Android: 2 119 | GameCoreScarlett: 1 120 | GameCoreXboxOne: 1 121 | Lumin: 0 122 | Nintendo Switch: 1 123 | PS4: 1 124 | PS5: 1 125 | Server: 0 126 | Stadia: 0 127 | Standalone: 1 128 | WebGL: 0 129 | Windows Store Apps: 0 130 | XboxOne: 0 131 | iPhone: 2 132 | tvOS: 2 133 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "defaultInstantiationMode": 0 8 | }, 9 | { 10 | "userAdded": false, 11 | "type": "UnityEditor.Animations.AnimatorController", 12 | "defaultInstantiationMode": 0 13 | }, 14 | { 15 | "userAdded": false, 16 | "type": "UnityEngine.AnimatorOverrideController", 17 | "defaultInstantiationMode": 0 18 | }, 19 | { 20 | "userAdded": false, 21 | "type": "UnityEditor.Audio.AudioMixerController", 22 | "defaultInstantiationMode": 0 23 | }, 24 | { 25 | "userAdded": false, 26 | "type": "UnityEngine.ComputeShader", 27 | "defaultInstantiationMode": 1 28 | }, 29 | { 30 | "userAdded": false, 31 | "type": "UnityEngine.Cubemap", 32 | "defaultInstantiationMode": 0 33 | }, 34 | { 35 | "userAdded": false, 36 | "type": "UnityEngine.GameObject", 37 | "defaultInstantiationMode": 0 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEditor.LightingDataAsset", 42 | "defaultInstantiationMode": 0 43 | }, 44 | { 45 | "userAdded": false, 46 | "type": "UnityEngine.LightingSettings", 47 | "defaultInstantiationMode": 0 48 | }, 49 | { 50 | "userAdded": false, 51 | "type": "UnityEngine.Material", 52 | "defaultInstantiationMode": 0 53 | }, 54 | { 55 | "userAdded": false, 56 | "type": "UnityEditor.MonoScript", 57 | "defaultInstantiationMode": 1 58 | }, 59 | { 60 | "userAdded": false, 61 | "type": "UnityEngine.PhysicsMaterial", 62 | "defaultInstantiationMode": 0 63 | }, 64 | { 65 | "userAdded": false, 66 | "type": "UnityEngine.PhysicsMaterial2D", 67 | "defaultInstantiationMode": 0 68 | }, 69 | { 70 | "userAdded": false, 71 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 72 | "defaultInstantiationMode": 0 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 77 | "defaultInstantiationMode": 0 78 | }, 79 | { 80 | "userAdded": false, 81 | "type": "UnityEngine.Rendering.VolumeProfile", 82 | "defaultInstantiationMode": 0 83 | }, 84 | { 85 | "userAdded": false, 86 | "type": "UnityEditor.SceneAsset", 87 | "defaultInstantiationMode": 1 88 | }, 89 | { 90 | "userAdded": false, 91 | "type": "UnityEngine.Shader", 92 | "defaultInstantiationMode": 1 93 | }, 94 | { 95 | "userAdded": false, 96 | "type": "UnityEngine.ShaderVariantCollection", 97 | "defaultInstantiationMode": 1 98 | }, 99 | { 100 | "userAdded": false, 101 | "type": "UnityEngine.Texture", 102 | "defaultInstantiationMode": 0 103 | }, 104 | { 105 | "userAdded": false, 106 | "type": "UnityEngine.Texture2D", 107 | "defaultInstantiationMode": 0 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Timeline.TimelineAsset", 112 | "defaultInstantiationMode": 0 113 | } 114 | ], 115 | "defaultDependencyTypeInfo": { 116 | "userAdded": false, 117 | "type": "", 118 | "defaultInstantiationMode": 1 119 | }, 120 | "newSceneOverride": 0 121 | } -------------------------------------------------------------------------------- /ProjectSettings/ShaderGraphSettings.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: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | shaderVariantLimit: 128 16 | customInterpolatorErrorThreshold: 32 17 | customInterpolatorWarningThreshold: 16 18 | customHeatmapValues: {fileID: 0} 19 | -------------------------------------------------------------------------------- /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 | m_RenderingLayers: 45 | - Default 46 | - Light Layer 1 47 | - Light Layer 2 48 | - Light Layer 3 49 | - Light Layer 4 50 | - Light Layer 5 51 | - Light Layer 6 52 | - Light Layer 7 53 | - 54 | - 55 | - 56 | - 57 | - 58 | - 59 | - 60 | - 61 | - 62 | - 63 | - 64 | - 65 | - 66 | - 67 | - 68 | - 69 | - 70 | - 71 | - 72 | - 73 | - 74 | - 75 | - 76 | - 77 | -------------------------------------------------------------------------------- /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/URPProjectSettings.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: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 9 16 | -------------------------------------------------------------------------------- /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 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /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 | } --------------------------------------------------------------------------------