Exemple #1
0
    public override void Update()
    {
        float now = Time.time;

        wiggler.Update(now);
        notSameCycler.Update(now);

        if (solved)
        {
            return;
        }

        if (shapes.touchedAtSameTime(now) && triangleShowing())
        {
            messagePromptCoordinator.clearTouch();
            messagePromptCoordinator.progress("stop shapes from changing");
            Handheld.Vibrate();
            wiggler.wiggleNow(now);
            endScene();
        }
        else
        {
            messagePromptCoordinator.hintWhenTouched(GameObject => {}, sensor, now,
                                                     new Dictionary <GameObject, ActionResponsePair[]> {
                { circle.gameObject, new [] { new ActionResponsePair("stop circle from changing", new[] { "Nope." }) } },
                { triangle.gameObject, new [] { new ActionResponsePair("stop triangle from changing", new[] { "Nope." }) } },
            });
        }

        AnimateShapes(now);

        // if touched circle, draw its bright first frame
        if (sensor.changeInsideSprite(Camera.main, circle))
        {
            circle.setFrame(0);
            circle.Animate();
        }

        // if touched triangle, ditto
        if (sensor.changeInsideSprite(Camera.main, triangle) && triangleShowing())
        {
            triangle.setFrame(0);
            triangle.Animate();
        }
    }