Skip to content

Commit 2082fd8

Browse files
committed
Update Trail class names, lengths
1 parent 7aeb8a9 commit 2082fd8

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:41e131901aa16f91a8065c8e15a700da1561831565bd41a84edac92844e7e082
3+
size 4124
File renamed without changes.

Assets/_Project/Prefabs/TrailColor.prefab

Lines changed: 0 additions & 3 deletions
This file was deleted.

Assets/_Project/Scripts/Effects/TrailController.cs renamed to Assets/_Project/Scripts/Effects/Trail.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5-
public class TrailController : MonoBehaviour {
5+
public class Trail : MonoBehaviour {
66

77
public GameObject avatar;
88
public TrailRenderer trailRenderer;
99
public int siblingCount;
1010
public int trailIndex;
11+
12+
// SIZE & POSITION
13+
1114
public float trailWidth;
1215
float [] positionsByIndex = { -1f, -0.5f, 0, .5f, 1f };
1316
// Maximum position for overall trail edge
@@ -16,6 +19,12 @@ public class TrailController : MonoBehaviour {
1619
public float positionMin = -1.5f;
1720
// Extra amount added to width to hide background
1821
public float widthExtra = 0.01f;
22+
// length scale
23+
public float lengthScale = 0.9f;
24+
25+
26+
// COLOR
27+
1928
public string trailColor;
2029
Color color;
2130

@@ -75,7 +84,7 @@ public void Init ()
7584
trailWidth = trailsRange + widthExtra;
7685

7786
// how long trail lasts, a.k.a. its length
78-
trailRenderer.time = siblingCount;
87+
trailRenderer.time = siblingCount * lengthScale;
7988

8089
// set offset based on index
8190
transform.localPosition = new Vector3 (0, positionsByIndex [trailIndex], 0);
File renamed without changes.

Assets/_Project/Scripts/Effects/TrailsManager.cs renamed to Assets/_Project/Scripts/Effects/TrailManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5-
public class TrailsManager : MonoBehaviour {
5+
public class TrailManager : MonoBehaviour {
66

77
public int minTrailCount = 3;
88
public int maxTrailCount = 10;
@@ -75,7 +75,7 @@ IEnumerator UpdateTrails (float wait)
7575
yield return new WaitForSeconds (wait);
7676

7777
foreach (string t in trailDict.Keys) {
78-
trailDict [t].GetComponent<TrailController> ().Init ();
78+
trailDict [t].GetComponent<Trail> ().Init ();
7979
}
8080

8181
}
File renamed without changes.

0 commit comments

Comments
 (0)