small bug in elevator
This commit is contained in:
@@ -80,7 +80,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2efb4119000540cca1ccfab69c8abf9c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_button: {fileID: 7139244772581621169}
|
||||
button: {fileID: 7139244772581621169}
|
||||
--- !u!95 &2841556225424433569
|
||||
Animator:
|
||||
serializedVersion: 5
|
||||
@@ -294,7 +294,7 @@ Transform:
|
||||
- {fileID: 6915102081068721723}
|
||||
- {fileID: 4453669748914392433}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &6525843738508825059
|
||||
MonoBehaviour:
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Station46.Modules.Elevated_Platform.Scripts
|
||||
AscendHash = Animator.StringToHash("Ascend"),
|
||||
DescendHash = Animator.StringToHash("Descend");
|
||||
|
||||
[BoxGroup("Internal")] [SerializeField] private Button _button;
|
||||
[BoxGroup("Internal")] [SerializeField] private HoloButton button;
|
||||
|
||||
[ShowNativeProperty]
|
||||
internal Status ElevatorStatus
|
||||
@@ -34,14 +34,21 @@ namespace Station46.Modules.Elevated_Platform.Scripts
|
||||
case Status.Bottom:
|
||||
case Status.Top:
|
||||
ReleasePlayer();
|
||||
if (!_leftElevatorWhileMoving)
|
||||
if (_leftElevatorWhileMoving)
|
||||
{
|
||||
_button.Enable();
|
||||
button.hideWhenDisabled = true;
|
||||
button.Enable();
|
||||
button.Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
button.Enable();
|
||||
}
|
||||
_leftElevatorWhileMoving = false;
|
||||
break;
|
||||
case Status.Moving:
|
||||
_button.Disable();
|
||||
button.hideWhenDisabled = false;
|
||||
button.Disable();
|
||||
CapturePlayer();
|
||||
break;
|
||||
default:
|
||||
@@ -62,7 +69,7 @@ namespace Station46.Modules.Elevated_Platform.Scripts
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_button.ButtonEvent += (_, type) =>
|
||||
button.ButtonEvent += (_, type) =>
|
||||
{
|
||||
if (type == ButtonEventType.Pressed)
|
||||
{
|
||||
@@ -112,9 +119,16 @@ namespace Station46.Modules.Elevated_Platform.Scripts
|
||||
|
||||
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
|
||||
{
|
||||
_button.Disable();
|
||||
button.hideWhenDisabled = true;
|
||||
button.Disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user