Beispiel #1
0
 void Translate()
 {
     // if (translateCo != null && translateCo.gameObject.activeSelf)
     // translateCo.Stop (false);
     Co.Start(TranslateTime, UpdateTranslation, EndMove);
     // translateCo = Co.Start (TranslateTime, UpdateTranslation, EndMove);
 }
Beispiel #2
0
 void Rotate(float duration, System.Action onEnd)
 {
     // if (rotateCo != null && rotateCo.gameObject.activeSelf)
     // rotateCo.Stop (false);
     Co.Start(duration, UpdateRotation, onEnd);
     // rotateCo = Co.Start (duration, UpdateRotation, onEnd);
 }
Beispiel #3
0
 void Translate(float speed)
 {
     if (translateCo != null)
     {
         translateCo.Stop(false);
     }
     translateCo = Co.Start(TranslateTime / speed, UpdateTranslation, () => { EndMove(trajectory.target); });
 }
Beispiel #4
0
 void Rotate(float duration, System.Action onEnd)
 {
     if (rotateCo != null)
     {
         rotateCo.Stop(false);
     }
     rotateCo = Co.Start(duration, UpdateRotation, onEnd);
 }
Beispiel #5
0
 public void RemoveSeed()
 {
     ObjectPool.Destroy <Seed> (seed);
     seed      = null;
     duration += 1;
     if (duration <= durations.Length - 1)
     {
         coSeed = Co.Start(durations[duration], ProduceSeed, OnProduceSeed);
     }
 }
Beispiel #6
0
    public static void Main()
    {
        var co = new Co();

        co.Start(() =>
        {
            Console.WriteLine("Hello");
            co.Stop();
        });
    }
Beispiel #7
0
        static void ElapseTime()
        {
            foreach (var group in Inventory.Groups)
            {
                foreach (Item item in group.Value.Items)
                {
                    ((Loan)item).AddTime();
                }
            }

            Co.Start(repaymentTime, OnElapseTime, ElapseTime);
        }
Beispiel #8
0
 public SeedProductionHandler(Transform producerTransform, float offset)
 {
     this.producerTransform = producerTransform;
     this.offset            = offset;
     coSeed = Co.Start(durations[duration], ProduceSeed, OnProduceSeed);
 }