diff --git a/Assets/Resources/Games/lumbearjack.prefab b/Assets/Resources/Games/lumbearjack.prefab index 3f2cf0c67..de6016722 100644 --- a/Assets/Resources/Games/lumbearjack.prefab +++ b/Assets/Resources/Games/lumbearjack.prefab @@ -61915,10 +61915,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -62244,10 +62252,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -62577,10 +62593,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -62728,10 +62752,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -62879,10 +62911,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63030,10 +63070,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63181,10 +63229,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63332,10 +63388,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63483,10 +63547,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63634,10 +63706,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63785,10 +63865,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 @@ -63936,10 +64024,18 @@ PrefabInstance: propertyPath: m_FlipY value: 1 objectReference: {fileID: 0} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _usePoint + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _otherPoint value: objectReference: {fileID: 3502128156805934089} + - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} + propertyPath: _slideOffset + value: 5 + objectReference: {fileID: 0} - target: {fileID: 8767186862898821743, guid: e2e08f4bea037a14da41e5490ce6d393, type: 3} propertyPath: _startAtOther value: 1 diff --git a/Assets/Scripts/Games/LumBEARjack/LBJCatMove.cs b/Assets/Scripts/Games/LumBEARjack/LBJCatMove.cs index f114c845c..60fcbbf71 100644 --- a/Assets/Scripts/Games/LumBEARjack/LBJCatMove.cs +++ b/Assets/Scripts/Games/LumBEARjack/LBJCatMove.cs @@ -12,15 +12,26 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack [Header("Properties")] [SerializeField] private bool _startAtOther; + [SerializeField] private bool _usePoint = true; + [SerializeField] private float _slideOffset = 0f; private Vector3 _thisPosition; + private Vector3 _otherPosition; private Coroutine _currentMove; private void Awake() { _thisPosition = transform.position; - if (_startAtOther) transform.position = _otherPoint.position; + if (_usePoint) + { + _otherPosition = _otherPoint.position; + } + else + { + _otherPosition = _thisPosition += new Vector3(_slideOffset, 0); + } + if (_startAtOther) transform.position = _otherPosition; } public void Move(double beat, double length, bool inToScene) @@ -33,14 +44,14 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack { if (length <= 0) { - transform.position = inToScene ? _thisPosition : _otherPoint.position; + transform.position = inToScene ? _thisPosition : _otherPosition; yield break; } float normalized = Conductor.instance.GetPositionFromBeat(beat, length, false); while (normalized <= 1f) { normalized = Conductor.instance.GetPositionFromBeat(beat, length); - Vector3 newPos = Vector3.Lerp(inToScene ? _otherPoint.position : _thisPosition, inToScene ? _thisPosition : _otherPoint.position, normalized); + Vector3 newPos = Vector3.Lerp(inToScene ? _otherPosition : _thisPosition, inToScene ? _thisPosition : _otherPosition, normalized); transform.position = newPos; yield return null; }