[Feature] Made text move

This commit is contained in:
Pasha Bibko
2025-12-02 15:35:31 +00:00
parent 28280d87cc
commit df1a1c145e
2 changed files with 8 additions and 4 deletions

View File

@@ -158,6 +158,7 @@ MonoBehaviour:
m_ObjectRadius: 0.1
m_SpinSpeed: 0.1
m_DistanceFromCentre: 0
<ObjectRadiusMultiplier>k__BackingField: 1
<IsAttachedToRings>k__BackingField: 1
m_Renderer: {fileID: 104400500}
m_ScoreText: {fileID: 1501855168}
@@ -554,7 +555,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 0, g: 0, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

View File

@@ -108,8 +108,10 @@ public class PlayerController : OrbitalBehaviour
private IEnumerator OnModiferPickup()
{
Vector3 start = TranslateToVector3();
Vector3 end = Vector3.zero;
Vector3 direction = start - end;
Vector3 direction = Vector3.zero - start;
direction.Normalize();
direction *= 3;
Vector3 end = start + direction;
m_ModifierText.transform.position = start;
@@ -117,9 +119,10 @@ public class PlayerController : OrbitalBehaviour
Color endColor = m_ModifierText.color;
endColor.a = 0;
for (float lerp = 0f; lerp < 1f; lerp += Time.deltaTime)
for (float lerp = 0f; lerp < 1f; lerp += Time.deltaTime / 2f)
{
m_ModifierText.color = Color.Lerp(startColor, endColor, lerp);
m_ModifierText.transform.position = Vector3.Lerp(start, end, lerp);
yield return new WaitForEndOfFrame();
}