diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1123c0f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "dotrush.roslyn.projectOrSolutionFiles": [ + "e:\\_Programming\\Unity\\UnityGames\\project-entity\\project-entity.sln" + ] +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Teleport/Systems/FindRandomPointForTeleportSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Teleport/Systems/FindRandomPointForTeleportSystem.cs index 52b180e..6b83542 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Teleport/Systems/FindRandomPointForTeleportSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Teleport/Systems/FindRandomPointForTeleportSystem.cs @@ -9,37 +9,42 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Teleport.Systems { public class FindRandomPointForTeleportSystem : IInitializableSystem, IDisposableSystem { + private Transform _target; private Transform _toPoint; private ReactiveEvent _findPointRequest; private ReactiveEvent _findPointEvent; - + private ReactiveVariable _radius; private IDisposable _findPointRequestDisposable; - + public void OnInit(Entity entity) { + _target = entity.TeleportTarget; _toPoint = entity.TeleportToPoint; _radius = entity.TeleportSearchRadius; _findPointRequest = entity.FindTeleportPointRequest; _findPointEvent = entity.FindTeleportPointEvent; - + _findPointRequestDisposable = _findPointRequest.Subscribe(OnFindPointRequest); } - + public void OnDispose() { _findPointRequestDisposable.Dispose(); } - + private void OnFindPointRequest() { - _toPoint.position = GetRandomPointByRadius(_radius.Value); + _toPoint.position = GetRandomPointInRadius(_target.position, _radius.Value); _findPointEvent.Invoke(); } - - private Vector3 GetRandomPointByRadius(float radius) - => new(Random.Range(0, radius), 0, Random.Range(0, radius)); + + private Vector3 GetRandomPointInRadius(Vector3 center, float radius) + { + Vector2 randomPoint = Random.insideUnitCircle * radius; + return center + new Vector3(randomPoint.x, 0f, randomPoint.y); + } } } \ No newline at end of file diff --git a/Packages/manifest.json b/Packages/manifest.json index 9b7025f..7f98173 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,10 +1,9 @@ { "dependencies": { - "com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity", "com.unity.2d.sprite": "1.0.0", "com.unity.collab-proxy": "2.8.2", "com.unity.ide.rider": "3.0.27", - "com.unity.ide.visualstudio": "2.0.22", + "com.unity.ide.visualstudio": "2.0.27", "com.unity.ide.vscode": "1.2.5", "com.unity.inputsystem": "1.7.0", "com.unity.render-pipelines.universal": "14.0.9", @@ -45,4 +44,4 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" } -} +} \ No newline at end of file diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 48a4981..b601fb5 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,12 +1,5 @@ { "dependencies": { - "com.github-glitchenzo.nugetforunity": { - "version": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity", - "depth": 0, - "source": "git", - "dependencies": {}, - "hash": "c2af83c9d4f8cdaada9d4a0e94de2f195d8e1d01" - }, "com.unity.2d.sprite": { "version": "1.0.0", "depth": 0, @@ -46,11 +39,11 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.22", + "version": "2.0.27", "depth": 0, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.9" + "com.unity.test-framework": "1.1.33" }, "url": "https://packages.unity.com" }, diff --git a/ProjectSettings/BurstAotSettings_Android.json b/ProjectSettings/BurstAotSettings_Android.json new file mode 100644 index 0000000..ce2d8aa --- /dev/null +++ b/ProjectSettings/BurstAotSettings_Android.json @@ -0,0 +1,17 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "DebugDataKind": 1, + "EnableArmv9SecurityFeatures": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "CpuTargetsArm64": 512, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/BurstAotSettings_StandaloneWindows.json b/ProjectSettings/BurstAotSettings_StandaloneWindows.json index 2144f6d..36e6a2c 100644 --- a/ProjectSettings/BurstAotSettings_StandaloneWindows.json +++ b/ProjectSettings/BurstAotSettings_StandaloneWindows.json @@ -1,16 +1,18 @@ { "MonoBehaviour": { - "Version": 3, + "Version": 4, "EnableBurstCompilation": true, "EnableOptimisations": true, "EnableSafetyChecks": false, "EnableDebugInAllBuilds": false, - "UsePlatformSDKLinker": false, + "DebugDataKind": 0, + "EnableArmv9SecurityFeatures": false, "CpuMinTargetX32": 0, "CpuMaxTargetX32": 0, "CpuMinTargetX64": 0, "CpuMaxTargetX64": 0, "CpuTargetsX32": 6, - "CpuTargetsX64": 72 + "CpuTargetsX64": 72, + "OptimizeFor": 0 } } diff --git a/ProjectSettings/BurstAotSettings_WebGL.json b/ProjectSettings/BurstAotSettings_WebGL.json new file mode 100644 index 0000000..eed54c3 --- /dev/null +++ b/ProjectSettings/BurstAotSettings_WebGL.json @@ -0,0 +1,16 @@ +{ + "MonoBehaviour": { + "Version": 4, + "EnableBurstCompilation": true, + "EnableOptimisations": true, + "EnableSafetyChecks": false, + "EnableDebugInAllBuilds": false, + "DebugDataKind": 1, + "EnableArmv9SecurityFeatures": false, + "CpuMinTargetX32": 0, + "CpuMaxTargetX32": 0, + "CpuMinTargetX64": 0, + "CpuMaxTargetX64": 0, + "OptimizeFor": 0 + } +} diff --git a/ProjectSettings/CommonBurstAotSettings.json b/ProjectSettings/CommonBurstAotSettings.json index 3dffdba..0293daf 100644 --- a/ProjectSettings/CommonBurstAotSettings.json +++ b/ProjectSettings/CommonBurstAotSettings.json @@ -1,6 +1,6 @@ { "MonoBehaviour": { - "Version": 3, + "Version": 4, "DisabledWarnings": "" } } diff --git a/ProjectSettings/TimelineSettings.asset b/ProjectSettings/TimelineSettings.asset new file mode 100644 index 0000000..b21943a --- /dev/null +++ b/ProjectSettings/TimelineSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 53 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} + m_Name: + m_EditorClassIdentifier: + assetDefaultFramerate: 60 + m_DefaultFrameRate: 60