Beispiel #1
0
    public void ProcessNext()
    {
        Card c = stack.RemoveFirst();

        if (!c)
        {
            if (IsCurrentLevelComplete())
            {
                EndLevel();
            }
            else
            {
                ShowRestart();
                AudioManager.Instance.Highpass(true);
                AudioManager.Instance.PlayEffectAt(18, Vector3.zero, 0.5f);
                AudioManager.Instance.PlayEffectAt(26, Vector3.zero, 0.5f);
            }

            return;
        }

        float height = 1.5f;

        Vector3 pos;

        c.AddMove(guide1.position, true);
        c.AddMove(guide2.position, true);
        c.AddMove(startPoint.position, true);

        bool addExtraDelay = false;

        if (!treeFirst)
        {
            if (level == 0)
            {
                ShowTutorial(3, 0.5f);
                Invoke("DelayedTutorialHide", 3.5f);
                c.delayBeforeNext = 3f;
            }

            treeFirst = c;
            pos       = startPoint.position + new Vector3(0f, height * 0.75f, 0f);
            c.SetLineRoot(startPoint.position);
        }
        else
        {
            Card  parent = treeFirst.AddLink(c);
            float mod    = c.number < parent.number ? -1f : 1f;
            pos = parent.transform.position + new Vector3(1f * mod * lengthSlider.value, height * lengthSlider.value, 0f);
        }

        pos.z = 0;

        c.AddMove(pos, false);

        c.NextMove(0);
    }