[Feature] Made text move
This commit is contained in:
@@ -158,6 +158,7 @@ MonoBehaviour:
|
|||||||
m_ObjectRadius: 0.1
|
m_ObjectRadius: 0.1
|
||||||
m_SpinSpeed: 0.1
|
m_SpinSpeed: 0.1
|
||||||
m_DistanceFromCentre: 0
|
m_DistanceFromCentre: 0
|
||||||
|
<ObjectRadiusMultiplier>k__BackingField: 1
|
||||||
<IsAttachedToRings>k__BackingField: 1
|
<IsAttachedToRings>k__BackingField: 1
|
||||||
m_Renderer: {fileID: 104400500}
|
m_Renderer: {fileID: 104400500}
|
||||||
m_ScoreText: {fileID: 1501855168}
|
m_ScoreText: {fileID: 1501855168}
|
||||||
@@ -554,7 +555,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
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_RaycastTarget: 1
|
||||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
m_Maskable: 1
|
m_Maskable: 1
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ public class PlayerController : OrbitalBehaviour
|
|||||||
private IEnumerator OnModiferPickup()
|
private IEnumerator OnModiferPickup()
|
||||||
{
|
{
|
||||||
Vector3 start = TranslateToVector3();
|
Vector3 start = TranslateToVector3();
|
||||||
Vector3 end = Vector3.zero;
|
Vector3 direction = Vector3.zero - start;
|
||||||
Vector3 direction = start - end;
|
direction.Normalize();
|
||||||
|
direction *= 3;
|
||||||
|
Vector3 end = start + direction;
|
||||||
|
|
||||||
m_ModifierText.transform.position = start;
|
m_ModifierText.transform.position = start;
|
||||||
|
|
||||||
@@ -117,9 +119,10 @@ public class PlayerController : OrbitalBehaviour
|
|||||||
Color endColor = m_ModifierText.color;
|
Color endColor = m_ModifierText.color;
|
||||||
endColor.a = 0;
|
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.color = Color.Lerp(startColor, endColor, lerp);
|
||||||
|
m_ModifierText.transform.position = Vector3.Lerp(start, end, lerp);
|
||||||
yield return new WaitForEndOfFrame();
|
yield return new WaitForEndOfFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user