-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
166 additions
and
90 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
Explorer/Assets/AddressableAssetsData/ProfileDataSourceSettings.asset.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Explorer/Assets/DCL/CharacterMotion/Components/PlayerTeleportIntent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using UnityEngine; | ||
|
||
namespace DCL.CharacterMotion.Components | ||
{ | ||
public struct PlayerTeleportIntent | ||
{ | ||
public Vector3 Position; | ||
|
||
public PlayerTeleportIntent(Vector3 position) | ||
{ | ||
Position = position; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Explorer/Assets/DCL/CharacterMotion/Components/PlayerTeleportIntent.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
Explorer/Assets/DCL/CharacterMotion/Platforms/PlatformRaycast.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using CrdtEcsBridge.Physics; | ||
using DCL.CharacterMotion.Components; | ||
using DCL.CharacterMotion.Settings; | ||
using System.Runtime.CompilerServices; | ||
using UnityEngine; | ||
|
||
namespace DCL.CharacterMotion.Platforms | ||
{ | ||
public static class PlatformRaycast | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static void Execute(CharacterPlatformComponent platformComponent, float radius, Transform transform, ICharacterControllerSettings settings) | ||
{ | ||
float rayDistance = settings.PlatformRaycastLength; | ||
float halfDistance = (rayDistance * 0.5f) + radius; | ||
|
||
var ray = new Ray | ||
{ | ||
origin = transform.position + (Vector3.up * halfDistance), | ||
direction = Vector3.down, | ||
}; | ||
|
||
bool hasHit = Physics.SphereCast(ray, radius, out RaycastHit hitInfo, rayDistance + radius, PhysicsLayers.CHARACTER_ONLY_MASK); | ||
|
||
if (hasHit) | ||
{ | ||
if (platformComponent.CurrentPlatform != hitInfo.collider.transform) | ||
{ | ||
platformComponent.CurrentPlatform = hitInfo.collider.transform; | ||
platformComponent.LastPosition = platformComponent.CurrentPlatform.InverseTransformPoint(transform.position); | ||
platformComponent.LastRotation = platformComponent.CurrentPlatform.InverseTransformDirection(transform.forward); | ||
} | ||
} | ||
else | ||
platformComponent.CurrentPlatform = null; | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Explorer/Assets/DCL/CharacterMotion/Platforms/PlatformRaycast.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 25 additions & 24 deletions
49
Explorer/Assets/DCL/ParcelsService/DCL.ParcelsService.asmdef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
{ | ||
"name": "DCL.ParcelsService", | ||
"rootNamespace": "", | ||
"references": [ | ||
"GUID:f51ebe6a0ceec4240a699833d6309b23", | ||
"GUID:1d2c76eb8b48e0b40940e8b31a679ce1", | ||
"GUID:8322ea9340a544c59ddc56d4793eac74", | ||
"GUID:4794e238ed0f65142a4aea5848b513e5", | ||
"GUID:fa7b3fdbb04d67549916da7bd2af58ab", | ||
"GUID:e0eedfa2deb9406daf86fd8368728e39", | ||
"GUID:d8b63aba1907145bea998dd612889d6b", | ||
"GUID:9e314663ce958b746873cb22d57ede55", | ||
"GUID:c80c82a8f4e04453b85fbab973d6774a", | ||
"GUID:4725c02394ab4ce19f889e4e8001f989", | ||
"GUID:3640f3c0b42946b0b8794a1ed8e06ca5" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
"name": "DCL.ParcelsService", | ||
"rootNamespace": "", | ||
"references": [ | ||
"GUID:f51ebe6a0ceec4240a699833d6309b23", | ||
"GUID:1d2c76eb8b48e0b40940e8b31a679ce1", | ||
"GUID:8322ea9340a544c59ddc56d4793eac74", | ||
"GUID:4794e238ed0f65142a4aea5848b513e5", | ||
"GUID:fa7b3fdbb04d67549916da7bd2af58ab", | ||
"GUID:e0eedfa2deb9406daf86fd8368728e39", | ||
"GUID:d8b63aba1907145bea998dd612889d6b", | ||
"GUID:9e314663ce958b746873cb22d57ede55", | ||
"GUID:c80c82a8f4e04453b85fbab973d6774a", | ||
"GUID:4725c02394ab4ce19f889e4e8001f989", | ||
"GUID:3640f3c0b42946b0b8794a1ed8e06ca5", | ||
"GUID:007bff6000804d90ac597452fb69a4ee" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.