예제 #1
0
    public void Launch()
    {
        running.ForEach(runner => runner.Stop());
        running.Clear();

        for (int idx = 0; idx < rocketObjects.Length; idx++)
        {
            Transform rocket = rocketObjects[idx].transform;

            running.Add(
                rocketAnimation
                .AddAction(t => SetY(rocket, t * flightDistance))
                .Completion(() => SetY(rocket, 0))
                .Delay(flightStagger * idx)
                .FirstStepBeforeDelay(true)
                .Build(this)
                );
        }

        running.ForEach(runner => runner.Play());
    }