public void ReturnGems()
    {
        currentSlot = movedGem01;
        targetSlot  = movedGem02;

        StartCoroutine(RewindSwap());


        AudioController.Audio_PlaySound(0);
    }
Exemplo n.º 2
0
    public void PointerDown()
    {
        if (!playerController.moveLock)
        {
            playerController.GemSelected(mySlot);
            animator.SetTrigger("Select");


            AudioController.Audio_PlaySound(1);
        }
    }
    private IEnumerator RewindSwap()
    {
        AudioController.Audio_PlaySound(0);

        currentSlot.SwapGemWith(targetSlot);
        targetSlot.SwapGemWith(currentSlot);

        currentSlot.ReadGemProperties();
        targetSlot.ReadGemProperties();

        yield return(StartCoroutine(boardManager.OnRewind()));

        yield return(null);
    }
Exemplo n.º 4
0
    public void PointerDragOver()
    {
        if (!playerController.moveLock)
        {
            if (playerController.draggingGem && playerController.currentSlot != mySlot)
            {
                if (AmINeighbourTo(playerController.currentSlot))
                {
                    playerController.targetSlot = mySlot;
                    animator.SetTrigger("Select");

                    AudioController.Audio_PlaySound(1);
                }
            }
        }
    }
Exemplo n.º 5
0
    public IEnumerator DestroyMyGem()
    {
        if (myGem != null)
        {
            matched = false;
            myGem.OnExplode();
            noGem = true;

            yield return(new WaitForEndOfFrame());


            myGem = null;


            AudioController.Audio_PlaySound(2);
        }
        else
        {
            ReadGemProperties();
        }
    }
    private IEnumerator PerformSwap()
    {
        AudioController.Audio_PlaySound(0);

        movedGem01 = currentSlot;
        movedGem02 = targetSlot;

        currentSlot.SwapGemWith(targetSlot);
        targetSlot.SwapGemWith(currentSlot);


        currentSlot.ReadGemProperties();
        targetSlot.ReadGemProperties();

        while (currentSlot.myGem.goingToParent || targetSlot.myGem.goingToParent)
        {
            yield return(new WaitForEndOfFrame());
        }

        yield return(StartCoroutine(boardManager.OnMovePerformed()));

        yield return(null);
    }