small bug in elevator

This commit is contained in:
2023-05-16 08:14:34 +02:00
parent c9d1717acc
commit b9bfeda9b6
4 changed files with 32 additions and 19 deletions

View File

@@ -1475,9 +1475,6 @@ Transform:
- {fileID: 1532540192886921385} - {fileID: 1532540192886921385}
- {fileID: 3750376657174321754} - {fileID: 3750376657174321754}
- {fileID: 2343402481646314946} - {fileID: 2343402481646314946}
- {fileID: 1853180256}
- {fileID: 675198211105780961}
- {fileID: 538618498}
- {fileID: 9336441} - {fileID: 9336441}
- {fileID: 1976313343} - {fileID: 1976313343}
m_Father: {fileID: 1340421038} m_Father: {fileID: 1340421038}
@@ -1911,7 +1908,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 411421604} m_TransformParent: {fileID: 1340421038}
m_Modifications: m_Modifications:
- target: {fileID: 1478369497145927568, guid: ceec192b57a11254eae63f938fbd3eb8, - target: {fileID: 1478369497145927568, guid: ceec192b57a11254eae63f938fbd3eb8,
type: 3} type: 3}
@@ -3253,7 +3250,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &1340421038 --- !u!4 &1340421038
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -3266,6 +3263,9 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
- {fileID: 1853180256}
- {fileID: 675198211105780961}
- {fileID: 538618498}
- {fileID: 411421604} - {fileID: 411421604}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 4
@@ -4273,7 +4273,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 411421604} m_TransformParent: {fileID: 1340421038}
m_Modifications: m_Modifications:
- target: {fileID: 3645814314867400154, guid: 056f81ef6ccf57645b24b2b317a578e7, - target: {fileID: 3645814314867400154, guid: 056f81ef6ccf57645b24b2b317a578e7,
type: 3} type: 3}
@@ -4948,7 +4948,7 @@ PrefabInstance:
serializedVersion: 2 serializedVersion: 2
m_Modification: m_Modification:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 411421604} m_TransformParent: {fileID: 1340421038}
m_Modifications: m_Modifications:
- target: {fileID: 5820700980591386288, guid: 97cc1523ce05b9544bccb2e3be7f024d, - target: {fileID: 5820700980591386288, guid: 97cc1523ce05b9544bccb2e3be7f024d,
type: 3} type: 3}

View File

@@ -80,7 +80,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2efb4119000540cca1ccfab69c8abf9c, type: 3} m_Script: {fileID: 11500000, guid: 2efb4119000540cca1ccfab69c8abf9c, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_button: {fileID: 7139244772581621169} button: {fileID: 7139244772581621169}
--- !u!95 &2841556225424433569 --- !u!95 &2841556225424433569
Animator: Animator:
serializedVersion: 5 serializedVersion: 5
@@ -294,7 +294,7 @@ Transform:
- {fileID: 6915102081068721723} - {fileID: 6915102081068721723}
- {fileID: 4453669748914392433} - {fileID: 4453669748914392433}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6525843738508825059 --- !u!114 &6525843738508825059
MonoBehaviour: MonoBehaviour:

View File

@@ -20,7 +20,7 @@ namespace Station46.Modules.Elevated_Platform.Scripts
AscendHash = Animator.StringToHash("Ascend"), AscendHash = Animator.StringToHash("Ascend"),
DescendHash = Animator.StringToHash("Descend"); DescendHash = Animator.StringToHash("Descend");
[BoxGroup("Internal")] [SerializeField] private Button _button; [BoxGroup("Internal")] [SerializeField] private HoloButton button;
[ShowNativeProperty] [ShowNativeProperty]
internal Status ElevatorStatus internal Status ElevatorStatus
@@ -34,14 +34,21 @@ namespace Station46.Modules.Elevated_Platform.Scripts
case Status.Bottom: case Status.Bottom:
case Status.Top: case Status.Top:
ReleasePlayer(); ReleasePlayer();
if (!_leftElevatorWhileMoving) if (_leftElevatorWhileMoving)
{ {
_button.Enable(); button.hideWhenDisabled = true;
button.Enable();
button.Disable();
}
else
{
button.Enable();
} }
_leftElevatorWhileMoving = false; _leftElevatorWhileMoving = false;
break; break;
case Status.Moving: case Status.Moving:
_button.Disable(); button.hideWhenDisabled = false;
button.Disable();
CapturePlayer(); CapturePlayer();
break; break;
default: default:
@@ -62,7 +69,7 @@ namespace Station46.Modules.Elevated_Platform.Scripts
private void Start() private void Start()
{ {
_button.ButtonEvent += (_, type) => button.ButtonEvent += (_, type) =>
{ {
if (type == ButtonEventType.Pressed) if (type == ButtonEventType.Pressed)
{ {
@@ -112,9 +119,16 @@ namespace Station46.Modules.Elevated_Platform.Scripts
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
if (_status != Status.Moving && other.CompareTag("MainCamera")) if (other.CompareTag("MainCamera"))
{ {
_button.Enable(); if (_status == Status.Moving)
{
_leftElevatorWhileMoving = false;
}
else
{
button.Enable();
}
} }
} }
@@ -128,7 +142,8 @@ namespace Station46.Modules.Elevated_Platform.Scripts
} }
else else
{ {
_button.Disable(); button.hideWhenDisabled = true;
button.Disable();
} }
} }
} }

View File

@@ -33,6 +33,4 @@ MonoBehaviour:
- {fileID: 11400000, guid: 83d6800536b1df14287ff2cd8e0d58ce, type: 2} - {fileID: 11400000, guid: 83d6800536b1df14287ff2cd8e0d58ce, type: 2}
puzzleCount: {x: 1, y: 1} puzzleCount: {x: 1, y: 1}
puzzleTypes: puzzleTypes:
- {fileID: 11400000, guid: 1b21332d2a4da2d4d9f8a105d1e24980, type: 2}
- {fileID: 11400000, guid: ee5a44432e80cd64689be3ff34750339, type: 2}
- {fileID: 11400000, guid: 010a967ecaf566041a0e12459806bd04, type: 2} - {fileID: 11400000, guid: 010a967ecaf566041a0e12459806bd04, type: 2}