*
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SegmentDisplayString : MonoBehaviour {
|
||||
|
||||
public SegmentDisplay[] segments;
|
||||
|
||||
public void SetString(string val) {
|
||||
int segmentId = 0;
|
||||
for (int i = 0; i < val.Length; ++i) {
|
||||
char v = val[i];
|
||||
if (v == '.') {
|
||||
segments[segmentId == 0 ? 0 : segmentId - 1].ShowDot = true;
|
||||
} else {
|
||||
segments[segmentId].ShowDot = false;
|
||||
segments[segmentId].SetChar(v);
|
||||
segmentId++;
|
||||
if (segmentId >= segments.Length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user