예제 #1
0
    protected override IEnumerator Logic()
    {
        // Start cauldron
        MRCauldron.current.GetStarted();

        time = Span.FromSeconds(roundDuration);
        while (time.TotalSeconds > 0f)
        {
            float value = (float)time.TotalSeconds / roundDuration;
            value = Mathf.Pow(value, 0.7f);

            // Hacer la islita pequeña
            float scale = Mathf.Lerp(0.43f, 1f, value);
            isle.localScale = new Vector3(scale, 1f, scale);

            // Make boats rotate
            float boatSpeed = Mathf.Lerp(this.boatSpeed.x, this.boatSpeed.y, 1 - value);
            drivers.Rotate(Vector3.up, -boatSpeed * Time.deltaTime);
            drivers.localScale = isle.localScale;

            yield return(null);

            time      -= Span.FromSeconds(Time.deltaTime);
            timer.text = string.Format("{0:0}:{1:00}", time.Minutes, time.Seconds);
        }

        // Declare winner
        int winner = MRCauldron.GetWinner();

        DeclareWinner(winner);
    }
예제 #2
0
 protected override void Awake()
 {
     base.Awake();
     current = this;
     scores  = new int[2];
 }