Ejemplo n.º 1
0
//--------------------------------------------------------------------------HELPERS:

        private void updateProgressBar(float percent)
        {
            percent = Mathf.Clamp(percent, 0.001f, 100);
            Vector3 origin        = ZeroPercentComplete.position;
            Vector3 completePos   = OneHundredPercentComplete.position;
            Vector3 stretchDir    = completePos - origin;
            Vector3 stretchTarget = origin + stretchDir * (percent / 100);

            Bar.Stretch(origin, stretchTarget);
            Bar.transform.SetLocalEulerZ(0);
        }
Ejemplo n.º 2
0
 public void AddSegment(Vector3 from, Vector3 to, Vector3 scale)
 {
     // lastAddedSegment is now old and will be replaced with new segment
     if (activeSegment != null)
     {
         oldSegments.Add(activeSegment);
     }
     activeSegment = createNewLineSegement(scale);
     activeSegment.Stretch(from, to);
     activeSegment.transform.parent = transform;
 }