Rough warehouse browsing by grabbing warehouse items with trigger
This commit is contained in:
@@ -8,7 +8,7 @@ public class WarehouseColumn : MonoBehaviour {
|
||||
private BezierCurve curve;
|
||||
private Transform rows;
|
||||
|
||||
private float offset = 0.0f;
|
||||
public float Offset { get; set; }
|
||||
|
||||
void Awake() {
|
||||
curve = transform.Find("Curve").GetComponent<BezierCurve>();
|
||||
@@ -21,12 +21,12 @@ public class WarehouseColumn : MonoBehaviour {
|
||||
|
||||
void Update() {
|
||||
if (Application.isPlaying) {
|
||||
offset += Time.deltaTime;
|
||||
//offset += Time.deltaTime;
|
||||
}
|
||||
|
||||
foreach (Transform row in rows) {
|
||||
var i = row.GetSiblingIndex();
|
||||
var distance = (float)i / (rows.childCount) * curve.length + offset;
|
||||
var distance = (float)i / (rows.childCount) * curve.length + Offset;
|
||||
distance = Mathf.Repeat(distance, curve.length);
|
||||
var pos = curve.GetPointAtDistance(distance);
|
||||
row.position = pos;
|
||||
|
||||
Reference in New Issue
Block a user