Improved detective board system
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Unheimlich.Gameplay.Items
|
||||
private Rigidbody _rigidbody;
|
||||
private bool _isAnimationPlaying = false;
|
||||
private ObjectDescriptionTrigger _objectDescriptionTrigger;
|
||||
private LevitatingObject _levitatingObject;
|
||||
|
||||
public bool IsAnimationPlaying => _isAnimationPlaying;
|
||||
|
||||
@@ -37,6 +38,7 @@ namespace Unheimlich.Gameplay.Items
|
||||
_originalParent = transform.parent;
|
||||
|
||||
_objectDescriptionTrigger = GetComponent<ObjectDescriptionTrigger>();
|
||||
_levitatingObject = GetComponent<LevitatingObject>();
|
||||
}
|
||||
|
||||
public override void Interact(GameObject interactor)
|
||||
@@ -75,7 +77,12 @@ namespace Unheimlich.Gameplay.Items
|
||||
_rigidbody.isKinematic = true;
|
||||
transform.SetParent(holdPoint);
|
||||
transform.localPosition = Vector3.forward * _inspectionDistance;
|
||||
transform.localRotation = Quaternion.identity;
|
||||
transform.localRotation = Quaternion.identity;
|
||||
|
||||
if (_levitatingObject != null)
|
||||
{
|
||||
_levitatingObject.UpdateBasePosition();
|
||||
}
|
||||
}
|
||||
|
||||
public void Release()
|
||||
@@ -85,6 +92,11 @@ namespace Unheimlich.Gameplay.Items
|
||||
transform.rotation = _originalRotation;
|
||||
|
||||
_rigidbody.isKinematic = true;
|
||||
|
||||
if (_levitatingObject != null)
|
||||
{
|
||||
_levitatingObject.UpdateBasePosition();
|
||||
}
|
||||
}
|
||||
|
||||
public float RotationSpeed => _rotationSpeed;
|
||||
|
||||
Reference in New Issue
Block a user