Compare commits
5 Commits
f75695bc43
...
d5ea686f2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5ea686f2c | ||
|
|
fd75d7e2d2 | ||
|
|
73a23861a4 | ||
|
|
748fdc3cb0 | ||
|
|
db828be164 |
158
Assets/# Prototype/Scripts/TestGroundMorion.cs
Normal file
158
Assets/# Prototype/Scripts/TestGroundMorion.cs
Normal file
@ -0,0 +1,158 @@
|
||||
using Intrepid.Core.Grounding;
|
||||
using Intrepid.Utilities;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace __Prototype.Scripts
|
||||
{
|
||||
public class TestGroundMorion : GroundProfileMotion
|
||||
{
|
||||
[GroupConfigurations, SerializeField] private Vector3 localDirection = Vector3.right;
|
||||
[GroupConfigurations, SerializeField] private float speed = 2f;
|
||||
[GroupConfigurations, SerializeField] private float maxDistance = 4f;
|
||||
[GroupConfigurations, SerializeField] private bool pingPong = true;
|
||||
[GroupConfigurations, SerializeField] private bool moveOnStart;
|
||||
|
||||
public override Vector3 Velocity { get; protected set; }
|
||||
public override Vector3 DeltaPosition { get; protected set; }
|
||||
public override bool IsMoving { get; protected set; }
|
||||
public override bool IsStatic { get; protected set; } = false;
|
||||
|
||||
private Vector3 _startPosition;
|
||||
private Vector3 _lastPosition;
|
||||
private int _directionSign = 1;
|
||||
private bool _initialized;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Snap();
|
||||
|
||||
if (moveOnStart)
|
||||
{
|
||||
Move();
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (!IsMoving)
|
||||
{
|
||||
ClearFrameMotion();
|
||||
return;
|
||||
}
|
||||
|
||||
var current = transform.position;
|
||||
|
||||
var worldDirection = transform.TransformDirection(localDirection.normalized);
|
||||
var next = current + worldDirection * (_directionSign * speed * Time.fixedDeltaTime);
|
||||
|
||||
if (maxDistance > 0f)
|
||||
{
|
||||
var distanceFromStart = Vector3.Dot(
|
||||
next - _startPosition,
|
||||
worldDirection
|
||||
);
|
||||
|
||||
if (Mathf.Abs(distanceFromStart) >= maxDistance)
|
||||
{
|
||||
if (pingPong)
|
||||
{
|
||||
_directionSign *= -1;
|
||||
|
||||
var clampedDistance = Mathf.Clamp(
|
||||
distanceFromStart,
|
||||
-maxDistance,
|
||||
maxDistance
|
||||
);
|
||||
|
||||
next = _startPosition + worldDirection * clampedDistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
next = _startPosition + worldDirection * Mathf.Sign(distanceFromStart) * maxDistance;
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
transform.position = next;
|
||||
|
||||
DeltaPosition = transform.position - _lastPosition;
|
||||
Velocity = DeltaPosition / Time.fixedDeltaTime;
|
||||
|
||||
_lastPosition = transform.position;
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void Move()
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
Snap();
|
||||
}
|
||||
|
||||
IsMoving = true;
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void Stop()
|
||||
{
|
||||
IsMoving = false;
|
||||
ClearFrameMotion();
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void Reverse()
|
||||
{
|
||||
_directionSign *= -1;
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void Snap()
|
||||
{
|
||||
_startPosition = transform.position;
|
||||
_lastPosition = transform.position;
|
||||
_directionSign = 1;
|
||||
ClearFrameMotion();
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void ResetToStart()
|
||||
{
|
||||
transform.position = _startPosition;
|
||||
_lastPosition = transform.position;
|
||||
_directionSign = 1;
|
||||
ClearFrameMotion();
|
||||
}
|
||||
|
||||
private void ClearFrameMotion()
|
||||
{
|
||||
DeltaPosition = Vector3.zero;
|
||||
Velocity = Vector3.zero;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
var origin = _initialized ? _startPosition : transform.position;
|
||||
var worldDirection = transform.TransformDirection(localDirection.normalized);
|
||||
|
||||
Gizmos.color = Color.green;
|
||||
Gizmos.DrawLine(
|
||||
origin - worldDirection * maxDistance,
|
||||
origin + worldDirection * maxDistance
|
||||
);
|
||||
|
||||
Gizmos.DrawSphere(origin - worldDirection * maxDistance, 0.08f);
|
||||
Gizmos.DrawSphere(origin + worldDirection * maxDistance, 0.08f);
|
||||
|
||||
Gizmos.color = Color.cyan;
|
||||
Gizmos.DrawLine(
|
||||
transform.position,
|
||||
transform.position + Velocity
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
3
Assets/# Prototype/Scripts/TestGroundMorion.cs.meta
Normal file
3
Assets/# Prototype/Scripts/TestGroundMorion.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52f9a25d1be7481baf4085a7b34ef8bb
|
||||
timeCreated: 1781278946
|
||||
@ -36,8 +36,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 10}
|
||||
m_SizeDelta: {x: -20, y: 30}
|
||||
m_AnchoredPosition: {x: 45, y: 30}
|
||||
m_SizeDelta: {x: -110, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!222 &3109608898981227386
|
||||
CanvasRenderer:
|
||||
@ -111,7 +111,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 125, y: 175}
|
||||
m_SizeDelta: {x: 90, y: 125}
|
||||
m_Pivot: {x: 1, y: 0}
|
||||
--- !u!1 &1210064884852877568
|
||||
GameObject:
|
||||
@ -152,7 +152,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 20}
|
||||
m_SizeDelta: {x: 750, y: 175}
|
||||
m_SizeDelta: {x: 474, y: 126}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!225 &5362238856615007216
|
||||
CanvasGroup:
|
||||
@ -359,7 +359,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 500, y: 175}
|
||||
m_SizeDelta: {x: 300, y: 125}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!1 &2169731595684440506
|
||||
GameObject:
|
||||
@ -655,10 +655,10 @@ RectTransform:
|
||||
- {fileID: 8639643552490286096}
|
||||
m_Father: {fileID: 8347068417609933848}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -135, y: -5}
|
||||
m_SizeDelta: {x: 225, y: 50}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 5}
|
||||
m_SizeDelta: {x: 270, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &4797126571072361863
|
||||
GameObject:
|
||||
@ -694,7 +694,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 125, y: 175}
|
||||
m_SizeDelta: {x: 90, y: 125}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!1 &5379922815610353284
|
||||
GameObject:
|
||||
@ -805,8 +805,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 60, y: 20}
|
||||
m_SizeDelta: {x: -140, y: 50}
|
||||
m_AnchoredPosition: {x: 45, y: 20}
|
||||
m_SizeDelta: {x: -110, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1510678006662779526
|
||||
CanvasRenderer:
|
||||
@ -863,8 +863,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 36
|
||||
m_fontSizeBase: 36
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@ -1380,7 +1380,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 10, y: -10}
|
||||
m_SizeDelta: {x: 110, y: 110}
|
||||
m_SizeDelta: {x: 80, y: 80}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &7932382647549546298
|
||||
CanvasRenderer:
|
||||
@ -1596,7 +1596,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4122311943219390533, guid: 18f44b986d2754181a3a9695f6898774, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 110
|
||||
value: 80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4122311943219390533, guid: 18f44b986d2754181a3a9695f6898774, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
@ -1968,7 +1968,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4122311943219390533, guid: 18f44b986d2754181a3a9695f6898774, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 110
|
||||
value: 80
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4122311943219390533, guid: 18f44b986d2754181a3a9695f6898774, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 671522e89c004981804e95c2e4772ba4, type: 3}
|
||||
m_Name: action-belt.window.data
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowData
|
||||
id: 69910a851d784149bbba17e5e0dd026a
|
||||
id: a35f38b0d2af466c9b0557c538c1f733
|
||||
shouldBeKeptAlwaysEnabled: 1
|
||||
onEntry: {fileID: 11400000, guid: b12d41919e089475da15bef8808f80b8, type: 2}
|
||||
onExit: {fileID: 11400000, guid: 86176d631377e4d5fba70988ef37e9d9, type: 2}
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
||||
m_Name: action-belt.window.enter
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
||||
mode: 1
|
||||
mode: 0
|
||||
direction: 0
|
||||
soundEffect: {fileID: 0}
|
||||
animationSpeed: 5
|
||||
animationSpeed: 2
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
||||
m_Name: action-belt.window.exit
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
||||
mode: 1
|
||||
mode: 0
|
||||
direction: 1
|
||||
soundEffect: {fileID: 0}
|
||||
animationSpeed: 5
|
||||
animationSpeed: 2
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 671522e89c004981804e95c2e4772ba4, type: 3}
|
||||
m_Name: world-overlay.window.data
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowData
|
||||
id: d9f8d3559eb2489cb94739ed883d3360
|
||||
id: f37754ed82f84d13b3ff890b11fc7c83
|
||||
shouldBeKeptAlwaysEnabled: 0
|
||||
onEntry: {fileID: 11400000, guid: 82f061381bd6041e89c7a94e57153999, type: 2}
|
||||
onExit: {fileID: 11400000, guid: 645c3f5b37b664fe2be06cdff30c678a, type: 2}
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
||||
m_Name: world-overlay.window.enter
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
||||
mode: 1
|
||||
mode: 3
|
||||
direction: 0
|
||||
soundEffect: {fileID: 0}
|
||||
animationSpeed: 5
|
||||
animationSpeed: 2
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 6f2337b04d5e44dba892ac6b72ae7e44, type: 3}
|
||||
m_Name: world-overlay.window.exit
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.Data.WindowAnimationData
|
||||
mode: 1
|
||||
mode: 2
|
||||
direction: 1
|
||||
soundEffect: {fileID: 0}
|
||||
animationSpeed: 5
|
||||
animationSpeed: 10
|
||||
|
||||
@ -1270,6 +1270,11 @@ Transform:
|
||||
- {fileID: 1383643367}
|
||||
m_Father: {fileID: 1187971236}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &67093088 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 6524376507900539265, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
m_PrefabInstance: {fileID: 1977728341}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &115233784
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1437,9 +1442,8 @@ GameObject:
|
||||
- component: {fileID: 152751379}
|
||||
- component: {fileID: 152751382}
|
||||
- component: {fileID: 152751381}
|
||||
- component: {fileID: 152751380}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas 1024 x 720
|
||||
m_Name: Canvas 1024 x 576
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@ -1466,21 +1470,6 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!114 &152751380
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 152751378}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d8d6bcfd7fe44d6c89229eb87c0a3296, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.WindowController
|
||||
subscriptionId: 384b1ac19e1a4cbfb6313e530996fd76
|
||||
initialWindows: []
|
||||
firstFocusItem: {fileID: 0}
|
||||
--- !u!114 &152751381
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1496,7 +1485,7 @@ MonoBehaviour:
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 64
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 1024, y: 720}
|
||||
m_ReferenceResolution: {x: 1024, y: 576}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0.5
|
||||
m_PhysicalUnit: 3
|
||||
@ -1767,7 +1756,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 23906060}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 331
|
||||
value: 337
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -2177,7 +2166,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 1485618350}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 276
|
||||
value: 282
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -2682,8 +2671,41 @@ Transform:
|
||||
- {fileID: 1629937738}
|
||||
- {fileID: 1501201613}
|
||||
- {fileID: 651339733}
|
||||
- {fileID: 332227168}
|
||||
m_Father: {fileID: 1187971236}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &332227167
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 332227168}
|
||||
m_Layer: 0
|
||||
m_Name: Platforms
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &332227168
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 332227167}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1977728342}
|
||||
m_Father: {fileID: 320298439}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &347886466
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3057,7 +3079,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 7028820}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 309
|
||||
value: 315
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -4497,7 +4519,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 48094519}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 331
|
||||
value: 337
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -5187,7 +5209,7 @@ Camera:
|
||||
near clip plane: 0.1
|
||||
far clip plane: 5000
|
||||
field of view: 40
|
||||
orthographic: 1
|
||||
orthographic: 0
|
||||
orthographic size: 7
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
@ -5671,7 +5693,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 1367132531}
|
||||
- target: {fileID: 4461476242845816847, guid: d5f09e3d9ca134424b1900c7865fca19, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 503
|
||||
value: 509
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4461476242845816847, guid: d5f09e3d9ca134424b1900c7865fca19, type: 3}
|
||||
propertyPath: m_Faces.Array.size
|
||||
@ -6813,7 +6835,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 929953728}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 276
|
||||
value: 282
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -7157,8 +7179,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 20}
|
||||
m_SizeDelta: {x: 750, y: 175}
|
||||
m_AnchoredPosition: {x: 0, y: 50}
|
||||
m_SizeDelta: {x: 474, y: 126}
|
||||
m_Pivot: {x: 0.5, y: 0}
|
||||
--- !u!1001 &1143872955
|
||||
PrefabInstance:
|
||||
@ -7182,7 +7204,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 487086061}
|
||||
- target: {fileID: 4461476242845816847, guid: d5f09e3d9ca134424b1900c7865fca19, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 423
|
||||
value: 429
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4461476242845816847, guid: d5f09e3d9ca134424b1900c7865fca19, type: 3}
|
||||
propertyPath: m_Faces.Array.size
|
||||
@ -12554,7 +12576,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 1769321392}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 276
|
||||
value: 282
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -22057,6 +22079,7 @@ MonoBehaviour:
|
||||
KnockoutTimeMultiplier: 0.1
|
||||
knockdownTime: 0.1
|
||||
recoverTime: 0.5
|
||||
maxKnockdown: 15
|
||||
--- !u!1 &1450430340
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -22328,6 +22351,10 @@ MonoBehaviour:
|
||||
groundMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 2147483648
|
||||
inheritGroundMotionY: 0
|
||||
preserveGroundVelocityWhenUngrounded: 1
|
||||
inheritedGroundVelocityDuration: 0.18
|
||||
inheritedGroundVelocityDecay: 30
|
||||
groundCheckHeight: 1
|
||||
groundCheckDistance: 3
|
||||
groundOffset: 0
|
||||
@ -22577,7 +22604,6 @@ GameObject:
|
||||
- component: {fileID: 1497838090}
|
||||
- component: {fileID: 1497838091}
|
||||
- component: {fileID: 1497838092}
|
||||
- component: {fileID: 1497838093}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas 1920 x 1080
|
||||
m_TagString: Untagged
|
||||
@ -22651,22 +22677,6 @@ MonoBehaviour:
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!114 &1497838093
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1497838089}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d8d6bcfd7fe44d6c89229eb87c0a3296, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.WindowController
|
||||
subscriptionId: 02a717f284a84688bbee601879230537
|
||||
initialWindows:
|
||||
- {fileID: 1953131096}
|
||||
firstFocusItem: {fileID: 0}
|
||||
--- !u!1 &1501201612
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -24135,6 +24145,184 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Entities.Sentinel.StateMachine.SentinelStateMachine
|
||||
currentState: 0
|
||||
lastState: 0
|
||||
--- !u!43 &1854535944
|
||||
Mesh:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: pb_Mesh-57142
|
||||
serializedVersion: 12
|
||||
m_SubMeshes:
|
||||
- serializedVersion: 2
|
||||
firstByte: 0
|
||||
indexCount: 36
|
||||
topology: 0
|
||||
baseVertex: 0
|
||||
firstVertex: 0
|
||||
vertexCount: 24
|
||||
localAABB:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 4, y: 0.25, z: 4}
|
||||
m_Shapes:
|
||||
vertices: []
|
||||
shapes: []
|
||||
channels: []
|
||||
fullWeights: []
|
||||
m_BindPose: []
|
||||
m_BoneNameHashes:
|
||||
m_RootBoneNameHash: 0
|
||||
m_BonesAABB: []
|
||||
m_VariableBoneCountWeights:
|
||||
m_Data:
|
||||
m_MeshCompression: 0
|
||||
m_IsReadable: 1
|
||||
m_KeepVertices: 1
|
||||
m_KeepIndices: 1
|
||||
m_IndexFormat: 0
|
||||
m_IndexBuffer: 000001000200010003000200040005000600050007000600080009000a0009000b000a000c000d000e000d000f000e00100011001200110013001200140015001600150017001600
|
||||
m_VertexData:
|
||||
serializedVersion: 3
|
||||
m_VertexCount: 24
|
||||
m_Channels:
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 3
|
||||
- stream: 0
|
||||
offset: 12
|
||||
format: 0
|
||||
dimension: 3
|
||||
- stream: 0
|
||||
offset: 24
|
||||
format: 0
|
||||
dimension: 4
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 40
|
||||
format: 0
|
||||
dimension: 2
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
- stream: 0
|
||||
offset: 0
|
||||
format: 0
|
||||
dimension: 0
|
||||
m_DataSize: 1152
|
||||
_typelessdata: 000080c0000080be0000804000000000000000000000803f000080bf0000000000000000000080bf000000410000003f00008040000080be0000804000000000000000000000803f000080bf0000000000000000000080bf000000000000003f000080c00000803e0000804000000000000000000000803f000080bf0000000000000000000080bf000000410000803f000080400000803e0000804000000000000000000000803f000080bf0000000000000000000080bf000000000000803f00008040000080be000080400000803f000000000000000000000000000000000000803f000080bf000000410000003f00008040000080be000080c00000803f000000000000000000000000000000000000803f000080bf000000000000003f000080400000803e000080400000803f000000000000000000000000000000000000803f000080bf000000410000803f000080400000803e000080c00000803f000000000000000000000000000000000000803f000080bf000000000000803f00008040000080be000080c00000000000000000000080bf0000803f0000000000000000000080bf000000410000003f000080c0000080be000080c00000000000000000000080bf0000803f0000000000000000000080bf000000000000003f000080400000803e000080c00000000000000000000080bf0000803f0000000000000000000080bf000000410000803f000080c00000803e000080c00000000000000000000080bf0000803f0000000000000000000080bf000000000000803f000080c0000080be000080c0000080bf00000000000000000000000000000000000080bf000080bf000000410000003f000080c0000080be00008040000080bf00000000000000000000000000000000000080bf000080bf000000000000003f000080c00000803e000080c0000080bf00000000000000000000000000000000000080bf000080bf000000410000803f000080c00000803e00008040000080bf00000000000000000000000000000000000080bf000080bf000000000000803f000080c00000803e00008040000000000000803f000000000000803f0000000000000000000080bf000000000000803f000080400000803e00008040000000000000803f000000000000803f0000000000000000000080bf000000410000803f000080c00000803e000080c0000000000000803f000000000000803f0000000000000000000080bf000000000000e0c0000080400000803e000080c0000000000000803f000000000000803f0000000000000000000080bf000000410000e0c0000080c0000080be000080c000000000000080bf00000000000080bf0000000000000000000080bf000000410000e0c000008040000080be000080c000000000000080bf00000000000080bf0000000000000000000080bf000000000000e0c0000080c0000080be0000804000000000000080bf00000000000080bf0000000000000000000080bf000000410000803f00008040000080be0000804000000000000080bf00000000000080bf0000000000000000000080bf000000000000803f
|
||||
m_CompressedMesh:
|
||||
m_Vertices:
|
||||
m_NumItems: 0
|
||||
m_Range: 0
|
||||
m_Start: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_UV:
|
||||
m_NumItems: 0
|
||||
m_Range: 0
|
||||
m_Start: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_Normals:
|
||||
m_NumItems: 0
|
||||
m_Range: 0
|
||||
m_Start: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_Tangents:
|
||||
m_NumItems: 0
|
||||
m_Range: 0
|
||||
m_Start: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_Weights:
|
||||
m_NumItems: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_NormalSigns:
|
||||
m_NumItems: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_TangentSigns:
|
||||
m_NumItems: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_FloatColors:
|
||||
m_NumItems: 0
|
||||
m_Range: 0
|
||||
m_Start: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_BoneIndices:
|
||||
m_NumItems: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_Triangles:
|
||||
m_NumItems: 0
|
||||
m_Data:
|
||||
m_BitSize: 0
|
||||
m_UVInfo: 0
|
||||
m_LocalAABB:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 4, y: 0.25, z: 4}
|
||||
m_MeshUsageFlags: 0
|
||||
m_CookingOptions: 30
|
||||
m_BakedConvexCollisionMesh:
|
||||
m_BakedTriangleCollisionMesh:
|
||||
'm_MeshMetrics[0]': 1
|
||||
'm_MeshMetrics[1]': 1
|
||||
m_MeshOptimizationFlags: 1
|
||||
m_StreamData:
|
||||
serializedVersion: 2
|
||||
offset: 0
|
||||
size: 0
|
||||
path:
|
||||
m_MeshLodInfo:
|
||||
serializedVersion: 2
|
||||
m_LodSelectionCurve:
|
||||
serializedVersion: 1
|
||||
m_LodSlope: 0
|
||||
m_LodBias: 0
|
||||
m_NumLevels: 1
|
||||
m_SubMeshes:
|
||||
- serializedVersion: 2
|
||||
m_Levels:
|
||||
- serializedVersion: 1
|
||||
m_IndexStart: 0
|
||||
m_IndexCount: 0
|
||||
--- !u!1 &1869388369
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -24402,7 +24590,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 571221644}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 320
|
||||
value: 326
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -24827,6 +25015,153 @@ CanvasGroup:
|
||||
m_Interactable: 1
|
||||
m_BlocksRaycasts: 1
|
||||
m_IgnoreParentGroups: 0
|
||||
--- !u!1001 &1977728341
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 332227168}
|
||||
m_Modifications:
|
||||
- target: {fileID: 101776470001583037, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: groundProfileMotion
|
||||
value:
|
||||
objectReference: {fileID: 1977728344}
|
||||
- target: {fileID: 1597087542051609407, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: sizeX
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1597087542051609407, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: sizeZ
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -27.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Mesh
|
||||
value:
|
||||
objectReference: {fileID: 1854535944}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 265
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
value: 24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Textures0.Array.size
|
||||
value: 24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[0].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[1].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[2].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[3].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[4].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Faces.Array.data[5].m_Uv.m_Anchor
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6392326082573612157, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6392326082573612157, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Size.z
|
||||
value: 8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6524376507900539265, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Ground_Slab_Prototype
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7186094041257591047, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Mesh
|
||||
value:
|
||||
objectReference: {fileID: 1854535944}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 6524376507900539265, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1977728344}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
--- !u!4 &1977728342 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2109134711161568785, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
m_PrefabInstance: {fileID: 1977728341}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1977728344
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 67093088}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 52f9a25d1be7481baf4085a7b34ef8bb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::__Prototype.Scripts.TestGroundMorion
|
||||
id: 72244c182c1b4b7f8026c837d732ae79
|
||||
localDirection: {x: 1, y: 0, z: 0}
|
||||
speed: 2
|
||||
maxDistance: 16
|
||||
pingPong: 1
|
||||
moveOnStart: 1
|
||||
--- !u!1001 &1981541173
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -25127,7 +25462,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 36345656}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_VersionIndex
|
||||
value: 331
|
||||
value: 337
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2212457409070270700, guid: 28468bc4d76574c58b20f1a932bdaf62, type: 3}
|
||||
propertyPath: m_Tangents.Array.size
|
||||
@ -25721,6 +26056,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2018333464}
|
||||
- component: {fileID: 2018333465}
|
||||
m_Layer: 0
|
||||
m_Name: UI
|
||||
m_TagString: Untagged
|
||||
@ -25745,6 +26081,22 @@ Transform:
|
||||
- {fileID: 1497838090}
|
||||
m_Father: {fileID: 559238034}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2018333465
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2018333463}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d8d6bcfd7fe44d6c89229eb87c0a3296, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Intrepid General Utilities::Intrepid.Window.WindowController
|
||||
subscriptionId: e9b0a5efbf1449f887292c2d59c7919a
|
||||
initialWindows:
|
||||
- {fileID: 1953131096}
|
||||
firstFocusItem: {fileID: 0}
|
||||
--- !u!95 &2042901331 stripped
|
||||
Animator:
|
||||
m_CorrespondingSourceObject: {fileID: 5866666021909216657, guid: 208cb7d0ce6444ed7b55f4c4b4e632aa, type: 3}
|
||||
|
||||
@ -30,13 +30,13 @@ namespace Intrepid.Core.Camera
|
||||
|
||||
protected override void OnBootstrap()
|
||||
{
|
||||
var stack = CameraSystem.Instance.CurrentCameraStreamStack;
|
||||
if (stack.IsNotNull())
|
||||
{
|
||||
var lens = stack.TopCameraStream.VCamera.Lens;
|
||||
lens.OrthographicSize = startOrthographicSize;
|
||||
stack.TopCameraStream.VCamera.Lens = lens;
|
||||
}
|
||||
// var stack = CameraSystem.Instance.CurrentCameraStreamStack;
|
||||
// if (stack.IsNotNull())
|
||||
// {
|
||||
// var lens = stack.TopCameraStream.VCamera.Lens;
|
||||
// lens.OrthographicSize = startOrthographicSize;
|
||||
// stack.TopCameraStream.VCamera.Lens = lens;
|
||||
// }
|
||||
}
|
||||
|
||||
protected override void Subscriptions()
|
||||
|
||||
@ -14,42 +14,58 @@ namespace Intrepid.Core.Entities
|
||||
[GroupInjections, SerializeField] private Entity entity;
|
||||
[GroupConfigurations, SerializeField] private LayerMask groundMask;
|
||||
|
||||
[GroupConfigurations, SerializeField] private bool inheritGroundMotionY;
|
||||
[GroupConfigurations, SerializeField] private bool preserveGroundVelocityWhenUngrounded = true;
|
||||
[GroupConfigurations, SerializeField] private float inheritedGroundVelocityDuration = 0.18f;
|
||||
[GroupConfigurations, SerializeField] private float inheritedGroundVelocityDecay = 30f;
|
||||
[GroupConfigurations, SerializeField] private float groundCheckHeight = 1.0f;
|
||||
[GroupConfigurations, SerializeField] private float groundCheckDistance = 3.0f;
|
||||
[GroupConfigurations, SerializeField] private float groundOffset;
|
||||
[GroupConfigurations, SerializeField] private float maxSlopeAngle = 45f;
|
||||
[GroupConfigurations, SerializeField] private float groundProbeRadiusGrounded = 0.5f;
|
||||
[GroupConfigurations, SerializeField] private float groundProbeRadiusFalling = 0.2f;
|
||||
[GroupConfigurations, SerializeField] private float fallingGroundCheckDistance = 20f;
|
||||
[GroupConfigurations, SerializeField] private float fallingGroundCheckDistance = 150f;
|
||||
[GroupConfigurations, SerializeField] private float minFallHeight = 0.25f;
|
||||
[GroupConfigurations, SerializeField] private float fallAcceleration = 35f;
|
||||
[GroupConfigurations, SerializeField] private float maxFallSpeed = 18f;
|
||||
|
||||
|
||||
private Vector3 Origin { get; set; }
|
||||
private Vector3 End { get; set; }
|
||||
private bool HasHit { get; set; }
|
||||
|
||||
private Vector3 _inheritedGroundVelocity;
|
||||
private float _fallVerticalSpeed;
|
||||
private RaycastHit _groundHit;
|
||||
private float GroundProbeRadius => IsFalling || IsFallingToAbyss
|
||||
? groundProbeRadiusFalling
|
||||
: groundProbeRadiusGrounded;
|
||||
|
||||
|
||||
public GroundProfiles CurrentGroundProfiles { get; private set; } = GroundProfiles.None;
|
||||
public float MaxSlopeAngle => maxSlopeAngle;
|
||||
[GroupDebug, ShowInInspector, ReadOnly] public Vector3 LastSafeGroundPosition { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public Vector3 LastSafeGroundPosition { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public bool HasStableGroundNormal { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public Vector3 StableGroundNormal { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public bool IsFalling { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public bool IsFallingToAbyss { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public bool IsGrounded { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public Vector3 InheritedGroundVelocity => _inheritedGroundVelocity;
|
||||
[GroupDebug, ShowInInspector, ReadOnly]
|
||||
public float InheritedGroundVelocityTimer { get; private set; }
|
||||
|
||||
public void ResetFallingToAbyss()
|
||||
{
|
||||
IsFalling = false;
|
||||
IsFallingToAbyss = false;
|
||||
CurrentGroundProfiles = GroundProfiles.None;
|
||||
ClearInheritedGroundVelocity();
|
||||
}
|
||||
|
||||
|
||||
public void Move(
|
||||
Rigidbody body,
|
||||
Vector3 velocity,
|
||||
@ -60,9 +76,9 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
if (IsFallingToAbyss)
|
||||
{
|
||||
return; // there is no movement from here....
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (IsFalling)
|
||||
{
|
||||
var nextFalling = ResolveFallingPosition(current, deltaTime);
|
||||
@ -71,39 +87,45 @@ namespace Intrepid.Core.Entities
|
||||
}
|
||||
|
||||
var movementVelocity = ResolveMovementVelocity(velocity);
|
||||
var next = current + movementVelocity * deltaTime;
|
||||
if (TryGetGroundSurfaceAt(next, out _groundHit, out var nextNormal))
|
||||
var groundMotionDelta = ResolveGroundMotionDelta(deltaTime);
|
||||
|
||||
var next = current
|
||||
+ groundMotionDelta
|
||||
+ movementVelocity * deltaTime;
|
||||
|
||||
if (TryGetGroundSurfaceAt(next, out _groundHit, out var nextNormal, out var groundProfiles))
|
||||
{
|
||||
IsGrounded = true;
|
||||
IsFallingToAbyss = false;
|
||||
|
||||
|
||||
CurrentGroundProfiles = groundProfiles;
|
||||
|
||||
RegisterStableGroundNormal(nextNormal);
|
||||
RefreshInheritedGroundVelocityFrom(groundProfiles);
|
||||
|
||||
next.y = _groundHit.point.y + groundOffset;
|
||||
LastSafeGroundPosition = new Vector3(
|
||||
next.x,
|
||||
_groundHit.point.y + groundOffset,
|
||||
next.z
|
||||
);
|
||||
if (IsFalling)
|
||||
|
||||
if (CurrentGroundProfiles.IsSafe)
|
||||
{
|
||||
IsFalling = false;
|
||||
Proxy.Instance.EventBus.Raise(new EntityRecoverStableGroundEvent
|
||||
{
|
||||
EntityId = entity.Id,
|
||||
});
|
||||
LastSafeGroundPosition = new Vector3(
|
||||
next.x,
|
||||
next.y,
|
||||
next.z
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (options.KeepHeightWhenNoGround) // that is probable an ability like sentinel dash, or enemy jump...
|
||||
else if (options.KeepHeightWhenNoGround)
|
||||
{
|
||||
IsGrounded = false;
|
||||
IsFalling = false;
|
||||
IsFallingToAbyss = false;
|
||||
|
||||
// Important:
|
||||
// Do not set next.y = current.y here.
|
||||
// The Y value has already been produced by the velocity projected onto the last stable ground normal.
|
||||
// While crossing gaps, the entity keeps moving along the last GroundSurface plane.
|
||||
// We are no longer grounded, so the current ground profile must be cleared.
|
||||
// But inherited ground velocity is intentionally preserved for game feel.
|
||||
CurrentGroundProfiles = GroundProfiles.None;
|
||||
}
|
||||
else if (TryAnyGroundSurfaceBelowAt(next, out var fallHit, out _)
|
||||
else if (TryAnyGroundSurfaceBelowAt(next, out var fallHit, out _, out _)
|
||||
&& IsGroundMeaningfullyBelow(current, fallHit))
|
||||
{
|
||||
BeginFall();
|
||||
@ -117,24 +139,117 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
ApplyMove(body, next);
|
||||
}
|
||||
|
||||
|
||||
private Vector3 ResolveGroundMotionDelta(float deltaTime)
|
||||
{
|
||||
if (IsGrounded && CurrentGroundProfiles.TryGetGroundProfileMotion(out var motion))
|
||||
{
|
||||
var delta = motion.DeltaPosition;
|
||||
|
||||
CaptureInheritedGroundVelocity(motion.Velocity);
|
||||
|
||||
if (inheritGroundMotionY)
|
||||
{
|
||||
return delta;
|
||||
}
|
||||
|
||||
return new Vector3(delta.x, 0f, delta.z);
|
||||
}
|
||||
|
||||
return ResolveInheritedGroundMotionDelta(deltaTime);
|
||||
}
|
||||
|
||||
private Vector3 ResolveInheritedGroundMotionDelta(float deltaTime)
|
||||
{
|
||||
if (!preserveGroundVelocityWhenUngrounded)
|
||||
{
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
if (InheritedGroundVelocityTimer <= 0f
|
||||
|| _inheritedGroundVelocity.sqrMagnitude <= GonConstants.CommonZeroSqrt)
|
||||
{
|
||||
ClearInheritedGroundVelocity();
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
var delta = _inheritedGroundVelocity * deltaTime;
|
||||
|
||||
InheritedGroundVelocityTimer = Mathf.Max(
|
||||
0f,
|
||||
InheritedGroundVelocityTimer - deltaTime
|
||||
);
|
||||
|
||||
_inheritedGroundVelocity = Vector3.MoveTowards(
|
||||
_inheritedGroundVelocity,
|
||||
Vector3.zero,
|
||||
inheritedGroundVelocityDecay * deltaTime
|
||||
);
|
||||
|
||||
if (inheritGroundMotionY)
|
||||
{
|
||||
return delta;
|
||||
}
|
||||
|
||||
return new Vector3(delta.x, 0f, delta.z);
|
||||
}
|
||||
|
||||
private void CaptureInheritedGroundVelocity(Vector3 velocity)
|
||||
{
|
||||
if (!preserveGroundVelocityWhenUngrounded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inheritGroundMotionY)
|
||||
{
|
||||
velocity.y = 0f;
|
||||
}
|
||||
|
||||
_inheritedGroundVelocity = velocity;
|
||||
InheritedGroundVelocityTimer = inheritedGroundVelocityDuration;
|
||||
}
|
||||
|
||||
private void RefreshInheritedGroundVelocityFrom(GroundProfiles groundProfiles)
|
||||
{
|
||||
if (groundProfiles.TryGetGroundProfileMotion(out var motion))
|
||||
{
|
||||
CaptureInheritedGroundVelocity(motion.Velocity);
|
||||
return;
|
||||
}
|
||||
|
||||
ClearInheritedGroundVelocity();
|
||||
}
|
||||
|
||||
private void ClearInheritedGroundVelocity()
|
||||
{
|
||||
_inheritedGroundVelocity = Vector3.zero;
|
||||
InheritedGroundVelocityTimer = 0f;
|
||||
}
|
||||
|
||||
private Vector3 ResolveFallingPosition(Vector3 current, float deltaTime)
|
||||
{
|
||||
IsGrounded = false;
|
||||
IsFallingToAbyss = false;
|
||||
|
||||
var inheritedMotionDelta = ResolveInheritedGroundMotionDelta(deltaTime);
|
||||
|
||||
_fallVerticalSpeed = Mathf.Min(
|
||||
_fallVerticalSpeed + fallAcceleration * deltaTime,
|
||||
maxFallSpeed
|
||||
);
|
||||
|
||||
var next = current;
|
||||
var next = current + inheritedMotionDelta;
|
||||
next.y -= _fallVerticalSpeed * deltaTime;
|
||||
|
||||
if (!TryAnyGroundSurfaceBelowAt(next, out var fallHit, out var fallNormal))
|
||||
if (!TryAnyGroundSurfaceBelowAt(
|
||||
next,
|
||||
out var fallHit,
|
||||
out var fallNormal,
|
||||
out var fallProfiles))
|
||||
{
|
||||
BeginFallToAbyss();
|
||||
return current; // or next?
|
||||
return current;
|
||||
}
|
||||
|
||||
var targetY = fallHit.point.y + groundOffset;
|
||||
@ -148,17 +263,23 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
RegisterStableGroundNormal(fallNormal);
|
||||
|
||||
// LastSafeGroundPosition = new Vector3(
|
||||
// next.x,
|
||||
// targetY,
|
||||
// next.z
|
||||
// );
|
||||
|
||||
IsGrounded = true;
|
||||
IsFalling = false;
|
||||
IsFallingToAbyss = false;
|
||||
_fallVerticalSpeed = 0f;
|
||||
|
||||
CurrentGroundProfiles = fallProfiles;
|
||||
RefreshInheritedGroundVelocityFrom(fallProfiles);
|
||||
|
||||
if (CurrentGroundProfiles.IsSafe)
|
||||
{
|
||||
LastSafeGroundPosition = new Vector3(
|
||||
next.x,
|
||||
next.y,
|
||||
next.z
|
||||
);
|
||||
}
|
||||
|
||||
Proxy.Instance.EventBus.Raise(new EntityRecoverStableGroundEvent
|
||||
{
|
||||
EntityId = entity.Id,
|
||||
@ -166,7 +287,7 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
|
||||
private void BeginFall()
|
||||
{
|
||||
if (IsFalling)
|
||||
@ -179,6 +300,10 @@ namespace Intrepid.Core.Entities
|
||||
IsFallingToAbyss = false;
|
||||
_fallVerticalSpeed = 0f;
|
||||
|
||||
// We clear the contact, but not the inherited velocity.
|
||||
// This gives a short carry from the moving platform after leaving it.
|
||||
CurrentGroundProfiles = GroundProfiles.None;
|
||||
|
||||
Proxy.Instance.EventBus.Raise(new EntityLeaveStableGroundEvent
|
||||
{
|
||||
EntityId = entity.Id,
|
||||
@ -191,14 +316,17 @@ namespace Intrepid.Core.Entities
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DLogger.LogDebug("Real abyss fall");
|
||||
|
||||
|
||||
IsGrounded = false;
|
||||
IsFalling = false;
|
||||
IsFallingToAbyss = true;
|
||||
_fallVerticalSpeed = 0f;
|
||||
|
||||
|
||||
CurrentGroundProfiles = GroundProfiles.None;
|
||||
ClearInheritedGroundVelocity();
|
||||
|
||||
Proxy.Instance.EventBus.Raise(new EntityFaillingToAbyssEvent
|
||||
{
|
||||
EntityId = entity.Id,
|
||||
@ -219,12 +347,15 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
public void RefreshStableGroundNormalAt(Vector3 position)
|
||||
{
|
||||
if (!TryGetGroundSurfaceAt(position, out _, out var normal))
|
||||
if (!TryGetGroundSurfaceAt(position, out _, out var normal, out var groundProfiles))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterStableGroundNormal(normal);
|
||||
if (groundProfiles.IsSafe)
|
||||
{
|
||||
RegisterStableGroundNormal(normal);
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 ResolveMovementVelocity(Vector3 velocity)
|
||||
@ -258,15 +389,17 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
public bool HasGroundSurfaceAt(Vector3 position)
|
||||
{
|
||||
return TryGetGroundSurfaceAt(position, out _, out _);
|
||||
return TryGetGroundSurfaceAt(position, out _, out _, out _);
|
||||
}
|
||||
|
||||
private bool TryGetGroundSurfaceAt(
|
||||
Vector3 position,
|
||||
out RaycastHit hit,
|
||||
out Vector3 normal)
|
||||
out Vector3 normal,
|
||||
out GroundProfiles groundProfiles)
|
||||
{
|
||||
normal = default;
|
||||
groundProfiles = GroundProfiles.None;
|
||||
|
||||
if (!TryGetGroundAt(position, out hit))
|
||||
{
|
||||
@ -287,6 +420,8 @@ namespace Intrepid.Core.Entities
|
||||
return false;
|
||||
}
|
||||
|
||||
groundProfiles = surface.GroundProfiles;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -311,9 +446,11 @@ namespace Intrepid.Core.Entities
|
||||
private bool TryAnyGroundSurfaceBelowAt(
|
||||
Vector3 position,
|
||||
out RaycastHit hit,
|
||||
out Vector3 normal)
|
||||
out Vector3 normal,
|
||||
out GroundProfiles groundProfiles)
|
||||
{
|
||||
normal = default;
|
||||
groundProfiles = GroundProfiles.None;
|
||||
|
||||
var origin = position + Vector3.up * groundCheckHeight;
|
||||
|
||||
@ -341,7 +478,14 @@ namespace Intrepid.Core.Entities
|
||||
|
||||
normal = surface.Normal;
|
||||
|
||||
return IsWalkable(normal);
|
||||
if (!IsWalkable(normal))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
groundProfiles = surface.GroundProfiles;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsWalkable(Vector3 normal)
|
||||
@ -422,6 +566,15 @@ namespace Intrepid.Core.Entities
|
||||
transform.position + StableGroundNormal * 1.25f
|
||||
);
|
||||
}
|
||||
|
||||
if (_inheritedGroundVelocity.sqrMagnitude > GonConstants.CommonZeroSqrt)
|
||||
{
|
||||
Gizmos.color = Color.green;
|
||||
Gizmos.DrawLine(
|
||||
transform.position,
|
||||
transform.position + _inheritedGroundVelocity.normalized * 1.5f
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
9
Assets/Scripts/Intrepid/Core/Grounding/GroundProfile.cs
Normal file
9
Assets/Scripts/Intrepid/Core/Grounding/GroundProfile.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using Intrepid.Utilities;
|
||||
|
||||
namespace Intrepid.Core.Grounding
|
||||
{
|
||||
public abstract class GroundProfile : Identification
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fdc7306926734d3bb5b74cc1107abb58
|
||||
timeCreated: 1781275820
|
||||
@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Intrepid.Core.Grounding
|
||||
{
|
||||
public abstract class GroundProfileMotion : GroundProfile
|
||||
{
|
||||
public abstract Vector3 Velocity { get; protected set; }
|
||||
public abstract Vector3 DeltaPosition { get; protected set; }
|
||||
public abstract bool IsMoving { get; protected set; }
|
||||
public abstract bool IsStatic { get; protected set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0bf2067f5ce4269a39772ba51ee47e2
|
||||
timeCreated: 1781275853
|
||||
46
Assets/Scripts/Intrepid/Core/Grounding/GroundProfiles.cs
Normal file
46
Assets/Scripts/Intrepid/Core/Grounding/GroundProfiles.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Intrepid.Core.Grounding
|
||||
{
|
||||
public readonly struct GroundProfiles
|
||||
{
|
||||
public static readonly GroundProfiles None = new(false);
|
||||
|
||||
private readonly bool _isSafe;
|
||||
private GroundProfileMotion GroundProfileMotion { get; }
|
||||
public bool IsSafe => CheckIfThisProfileIsSafe();
|
||||
|
||||
public GroundProfiles(bool isSafe, GroundProfileMotion groundProfileMotion = null)
|
||||
{
|
||||
_isSafe = isSafe;
|
||||
GroundProfileMotion = groundProfileMotion;
|
||||
}
|
||||
|
||||
private bool CheckIfThisProfileIsSafe()
|
||||
{
|
||||
if (GroundProfileMotion.IsNull())
|
||||
{
|
||||
return _isSafe;
|
||||
}
|
||||
|
||||
return GroundProfileMotion.IsStatic;
|
||||
}
|
||||
|
||||
private bool TryGet<T>(T value, out T profile) where T: GroundProfile
|
||||
{
|
||||
if (value.IsNull())
|
||||
{
|
||||
profile = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
profile = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryGetGroundProfileMotion(out GroundProfileMotion profile)
|
||||
{
|
||||
return TryGet(GroundProfileMotion, out profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bcaf8255e9847b8b25727c33769f037
|
||||
timeCreated: 1781276176
|
||||
@ -12,21 +12,33 @@ namespace Intrepid.Core.Grounding
|
||||
public class GroundSurface : MonoBehaviour
|
||||
{
|
||||
[GroupInjections, SerializeField] private BoxCollider boxCollider;
|
||||
[GroupConfigurations("Profiles"), SerializeField] private bool safe = true;
|
||||
[GroupConfigurations("Profiles"), SerializeField] private GroundProfileMotion groundProfileMotion;
|
||||
|
||||
|
||||
[GroupDebug, ShowInInspector, ReadOnly] public Vector3 Position { get; private set; }
|
||||
[GroupDebug, ShowInInspector, ReadOnly] public Vector3 Normal { get; private set; }
|
||||
public GroundProfiles GroundProfiles { get; private set; } = GroundProfiles.None;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
if (boxCollider.IsNull()) return;
|
||||
DetectPosition();
|
||||
DetectNormal();
|
||||
RefreshProfiles();
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
DetectPosition();
|
||||
DetectNormal();
|
||||
RefreshProfiles();
|
||||
}
|
||||
|
||||
[GroupDebug, Button(ButtonSizes.Medium)]
|
||||
private void RefreshProfiles()
|
||||
{
|
||||
GroundProfiles = new GroundProfiles(safe, groundProfileMotion);
|
||||
}
|
||||
|
||||
[Button(ButtonSizes.Medium)]
|
||||
|
||||
@ -4,6 +4,7 @@ using Intrepid.Core;
|
||||
using Intrepid.Core.Camera;
|
||||
using Intrepid.Core.Entities;
|
||||
using Intrepid.Core.Entities.Messages;
|
||||
using Intrepid.Core.Grounding;
|
||||
using Intrepid.Core.TimeControl;
|
||||
using Intrepid.Gameplay.Entities.Player.ActionBelt;
|
||||
using Intrepid.Gameplay.Entities.Player.Sentinel;
|
||||
@ -73,16 +74,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
|
||||
StateMachine.UpdateStateMachine();
|
||||
|
||||
InputResolver.Sentinel.CaptureAndPrune(TimeSimulation.Instance.ScaledElapsedTime);
|
||||
|
||||
// that is the right place?
|
||||
if (Controls.OnCadence)
|
||||
{
|
||||
TimeSimulation.Instance.AsBreathMotion(.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeSimulation.Instance.AsNormalMotion(.5f);
|
||||
}
|
||||
|
||||
if (StateFirstFrame)
|
||||
{
|
||||
|
||||
@ -16,12 +16,12 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
|
||||
|
||||
protected override void InitializeVariables()
|
||||
{
|
||||
CameraStreamStack.Transform = Brain.Entity.RigidBodyTransform;
|
||||
CameraStreamStack.Push(follow, true);
|
||||
}
|
||||
|
||||
protected override void OnBootstrap()
|
||||
{
|
||||
CameraStreamStack.Transform = Brain.Entity.RigidBodyTransform;
|
||||
CameraStreamStack.Push(follow, true);
|
||||
}
|
||||
|
||||
protected override void Subscriptions()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Intrepid.Core.Entities;
|
||||
using Intrepid.Core.Grounding;
|
||||
using Intrepid.GameManagers;
|
||||
using Intrepid.Gameplay.Messages.Events;
|
||||
using Intrepid.Utilities;
|
||||
@ -30,6 +31,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
|
||||
public Vector3 LinearVelocity { get; private set; }
|
||||
public Vector2 Forward => new Vector2(_desiredForward.x, _desiredForward.z).normalized;
|
||||
public bool IsGrounded => MotorTopDown.IsGrounded;
|
||||
public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles;
|
||||
|
||||
public override void DeployEntity(Vector2 position)
|
||||
{
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using Intrepid.Core.TimeControl;
|
||||
using Intrepid.Structures;
|
||||
using Intrepid.Utilities;
|
||||
using UnityEngine;
|
||||
@ -27,11 +28,16 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
||||
protected override void RunOnEnter(ParameterStore parameterStore)
|
||||
{
|
||||
Brain.Entity.ModelAnimation.CrossFade(dashRecovery, 0.05f);
|
||||
if (Brain.Controls.OnCadence)
|
||||
{
|
||||
TimeSimulation.Instance.AsBreathMotion();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void RunOnExit()
|
||||
{
|
||||
Timer.Stop();
|
||||
TimeSimulation.Instance.AsNormalMotion();
|
||||
}
|
||||
|
||||
public override void RunOnFirstFrameOnly()
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using Intrepid.Diagnostics;
|
||||
using Intrepid.Structures;
|
||||
using Intrepid.Utilities;
|
||||
using UnityEngine;
|
||||
@ -11,6 +12,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
||||
[GroupConfigurations, SerializeField] private float KnockoutTimeMultiplier = 0.1f;
|
||||
[GroupConfigurations, SerializeField, Range(0, 3)] private float knockdownTime = .1f;
|
||||
[GroupConfigurations, SerializeField, Range(0, 3)] private float recoverTime = .5f;
|
||||
[GroupConfigurations, SerializeField] private float maxKnockdown = 15f;
|
||||
|
||||
private Vector2 KnockdownForce { get; set; }
|
||||
private float KnockoutTime { get; set; }
|
||||
@ -33,7 +35,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
||||
KnockdownForce = ps.Get<Vector2>(SentinelConstants.Parameters.KnockdownForce);
|
||||
Brain.Entity.ChangeOrientation(-KnockdownForce.normalized);
|
||||
KnockoutTime = KnockdownForce.sqrMagnitude * KnockoutTimeMultiplier;
|
||||
Brain.Entity.DesiredVelocity = KnockdownForce;
|
||||
Brain.Entity.DesiredVelocity = Vector2.ClampMagnitude(KnockdownForce, maxKnockdown);
|
||||
KnockdownTimer.Start();
|
||||
KnockoutTimer.Stop();
|
||||
RecoverTimer.Stop();
|
||||
|
||||
@ -38,7 +38,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
|
||||
});
|
||||
Proxy.Instance.EventBus.Raise(new WindowOpenEvent
|
||||
{
|
||||
ShouldStack = false,
|
||||
ShouldStack = true,
|
||||
WindowDataList = new List<WindowData>
|
||||
{
|
||||
pdaWindowData
|
||||
|
||||
3
Assets/Scripts/Intrepid/Utilities/Structures.meta
Normal file
3
Assets/Scripts/Intrepid/Utilities/Structures.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d317b4205069414bab2594af1367a7cd
|
||||
timeCreated: 1781273885
|
||||
3
Assets/Scripts/Intrepid/Utilities/Structures/Traits.meta
Normal file
3
Assets/Scripts/Intrepid/Utilities/Structures/Traits.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 036b53ea50a747568a81067ed062ab63
|
||||
timeCreated: 1781273890
|
||||
@ -0,0 +1,8 @@
|
||||
namespace Intrepid.Utilities.Structures.Traits
|
||||
{
|
||||
public interface IMutableTraits<in T> where T : ITrait
|
||||
{
|
||||
void Declare<TT>(TT trait) where TT : T;
|
||||
bool Discard<TT>() where TT : T;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60e2f3c521b5464c99572ec85a79b49c
|
||||
timeCreated: 1781274068
|
||||
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Intrepid.Structures;
|
||||
|
||||
namespace Intrepid.Utilities.Structures.Traits
|
||||
{
|
||||
public interface IReadOnlyTraits<T> where T : ITrait
|
||||
{
|
||||
IEnumerable<SKey> TraitKeys { get; }
|
||||
IEnumerable<T> AllTraits { get; }
|
||||
public bool Has<TT>() where TT : T;
|
||||
bool HasNot<TT>() where TT : T;
|
||||
int Count<TT>() where TT : T;
|
||||
int Count();
|
||||
bool TryGet<TT>(out TT trait) where TT : T;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6152bfba97d417aa80a378af0f845b6
|
||||
timeCreated: 1755750583
|
||||
@ -0,0 +1,9 @@
|
||||
using Intrepid.Structures;
|
||||
|
||||
namespace Intrepid.Utilities.Structures.Traits
|
||||
{
|
||||
public interface ITrait
|
||||
{
|
||||
public SKey Key { get; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df822f6ba3df45d59124ca029e2bfa68
|
||||
timeCreated: 1755154881
|
||||
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Intrepid.Structures;
|
||||
|
||||
namespace Intrepid.Utilities.Structures.Traits
|
||||
{
|
||||
public sealed class Traits<T> : IReadOnlyTraits<T>, IMutableTraits<T> where T : ITrait
|
||||
{
|
||||
private Dictionary<string, T> Holder { get; } = new();
|
||||
private static string KeyFor<P>() => typeof(P).AssemblyQualifiedName;
|
||||
|
||||
public IEnumerable<SKey> TraitKeys => Holder.Values.Select(v => v.Key);
|
||||
public IEnumerable<Type> TraitTypes => AllTraits.Select(t => t.GetType());
|
||||
public IEnumerable<T> AllTraits => Holder.Values;
|
||||
public TraitsQuery<T> Querying() => new(this);
|
||||
|
||||
public void Declare<TT>(TT trait) where TT : T
|
||||
{
|
||||
Holder[KeyFor<TT>()] = trait;
|
||||
}
|
||||
|
||||
public bool Discard<TT>() where TT : T => Holder.Remove(KeyFor<TT>());
|
||||
|
||||
public bool Has<TT>() where TT : T => Holder.ContainsKey(KeyFor<TT>());
|
||||
|
||||
public bool HasNot<TT>() where TT : T => !Has<TT>();
|
||||
|
||||
public int Count<TT>() where TT : T => AllTraits.Count(t => t is TT);
|
||||
|
||||
public int Count() => AllTraits.Count();
|
||||
|
||||
public bool TryGet<TT>(out TT trait) where TT : T
|
||||
{
|
||||
if (Holder.TryGetValue(KeyFor<TT>(), out var t))
|
||||
{
|
||||
trait = (TT)t;
|
||||
return true;
|
||||
}
|
||||
|
||||
trait = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryFindFirst<TT>(out TT tt) where TT : T
|
||||
{
|
||||
if (AllTraits.Any(t => t is TT))
|
||||
{
|
||||
tt = (TT)AllTraits.First(t => t is TT);
|
||||
return true;
|
||||
}
|
||||
|
||||
tt = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da823f94589947afa622262ed259dc94
|
||||
timeCreated: 1755154734
|
||||
@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Intrepid.Utilities.Structures.Traits
|
||||
{
|
||||
public sealed class TraitsQuery<T> where T : ITrait
|
||||
{
|
||||
public IReadOnlyTraits<T> Source { get; }
|
||||
private List<Func<IEnumerable<T>, IEnumerable<T>>> Operations { get; } = new();
|
||||
private Func<T, float> OrderKey { get; set; }
|
||||
private bool OrderDesc { get; set; } = true;
|
||||
private int? _skip;
|
||||
private int? _take;
|
||||
|
||||
public TraitsQuery(IReadOnlyTraits<T> source)
|
||||
{
|
||||
Source = source;
|
||||
}
|
||||
|
||||
public TraitsQuery<T> Has<TT>() where TT : T
|
||||
{
|
||||
Operations.Add(seq => seq.Where(_ => Source.Has<TT>()));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TraitsQuery<T> Where<TT>(Func<TT, bool> filter = null) where TT : T
|
||||
{
|
||||
filter ??= _ => true;
|
||||
Operations.Add(seq => seq.Where(_ => Source.TryGet<TT>(out var tt) && filter(tt)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TraitsQuery<T> OrderBy(Func<T, float> keySelector, bool descending = true)
|
||||
{
|
||||
OrderKey = keySelector;
|
||||
OrderDesc = descending;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TraitsQuery<T> Skip(int count)
|
||||
{
|
||||
if (count < 0)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
_skip = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TraitsQuery<T> Take(int count)
|
||||
{
|
||||
if (count < 0)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
_take = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IReadOnlyList<T> ToList() => Materialize().ToList();
|
||||
public T FirstOrDefault() => Materialize().FirstOrDefault();
|
||||
public bool Any() => Materialize().Any();
|
||||
|
||||
public bool TryGet<TT>(out TT trait) where TT : T
|
||||
{
|
||||
return Source.TryGet(out trait);
|
||||
}
|
||||
|
||||
private IEnumerable<T> Materialize()
|
||||
{
|
||||
var query = Source.AllTraits;
|
||||
foreach (var operation in Operations)
|
||||
{
|
||||
query = operation(query);
|
||||
}
|
||||
|
||||
if (OrderKey is not null)
|
||||
{
|
||||
query = OrderDesc
|
||||
? query.OrderByDescending(OrderKey)
|
||||
: query.OrderBy(OrderKey);
|
||||
}
|
||||
|
||||
if (_skip is > 0)
|
||||
{
|
||||
query = query.Skip(_skip.Value);
|
||||
}
|
||||
|
||||
if (_take is > 0)
|
||||
{
|
||||
query = query.Take(_take.Value);
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e35096794b4c41948c8c03c8009b7322
|
||||
timeCreated: 1755757808
|
||||
@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 950aecf629064624ba1c60498dddcb8d
|
||||
timeCreated: 1779168408
|
||||
Loading…
x
Reference in New Issue
Block a user