Exemplo n.º 1
0
    void Start()
    {
        running = new Interpolation(t => toRotate.transform.rotation = Quaternion.Euler(0, 0, t * 360f))
                  .Duration(duration)
                  .Repeats(true)
                  .Build(this);

        running.Play();
    }
Exemplo n.º 2
0
 public void StartStopOrbit()
 {
     if (running.playing)
     {
         running.Pause();
     }
     else
     {
         running.Play();
     }
 }
Exemplo n.º 3
0
    void UpdateColor(bool animated)
    {
        Renderer particleRenderer = particles.GetComponent <Renderer>();

        Color from = particleRenderer.material.GetColor(colorKey);
        Color to   = colors[colorIndex];

        System.Action <float> step = t =>
                                     particleRenderer.material.SetColor(colorKey, Color.Lerp(from, to, t));

        if (running != null)
        {
            running.Stop();
        }

        running = new Interpolation(step)
                  .Duration(animated ? transitionDuration : 0)
                  .Build(this);

        running.Play();
    }