Ejemplo n.º 1
0
    private void playTutorialAnimation()
    {
        BWTutorialLayer tutorialScript = tutorialLayer.GetComponent <BWTutorialLayer>();


        if (tutorialScript.isPlayingTutorial)
        {
            return;
        }

        ArrayList positionArray = new ArrayList();

        foreach (int _number in expectedNumbers)
        {
            BWFlowersLayer layer  = flowersLayer.GetComponent <BWFlowersLayer>();
            GameObject     flower = layer.flowerWithNumber(_number);

            if (flower == null)
            {
                return;
            }

            Vector3 pos = new Vector3(flower.transform.position.x + 20F, flower.transform.position.y + 170F, -800F);
            positionArray.Add(pos);
        }

        tutorialScript.positions = positionArray;
        tutorialScript.playTutorial();
    }
Ejemplo n.º 2
0
    void FingerGestures_OnFingerDragBegin(int fingerIndex, Vector2 fingerPos, Vector2 startPos)
    {
        if (!touchEnabled)
        {
            return;
        }

        CancelInvoke("noInteraction");
        CancelInvoke("deduceResult");

        BWTutorialLayer tutorialScript = tutorialLayer.GetComponent <BWTutorialLayer>();

        tutorialScript.stopAnimation();

        GameObject selection = PickObject(startPos);

        if (selection == null || dragFingerIndex != -1)
        {
            return;
        }
        //Scrolling begins
        if (selection == scrollCollider)
        {
            if (!enableScrolling)
            {
                return;
            }
            dragFingerIndex = fingerIndex;
            isDragging      = true;
        }
        else if (isSelectionFlower(selection))
        {
            BWFlower flowerObj = selection.GetComponent <BWFlower>();
            if (expectedNumbers != null && expectedNumbers.Count > 0 && flowerObj.getFlowerNumber() == (int)expectedNumbers[0])
            {
                //beeToFlower((int)expectedNumbers[0]);
                dragFingerIndex = fingerIndex;
                isSwiping       = true;
                swipingWentOut  = false;
                currentAnswer   = true;
                expectedNumbers.RemoveAt(0);

                prevFlower = selection;
            }
            else
            {
                //if started from incorrect flower

                if (flowerObj.getFlowerNumber() == beeStartingPoint + numberToFind)
                {
                    playHintSound(1);
                }
                else
                {
                    playHelpSound();
                }
            }
        }
    }