예제 #1
0
 public void SwapGemWith(Board_Slot targetSlot)
 {
     if (myGem != null)
     {
         myGem.transform.parent = targetSlot.transform;
         myGem.GoToParent();
         targetSlot.ReadGemProperties();
         //targetSlot.ScanNeighbours();
         myGem = null;
     }
     //noGem = false;
 }
    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);
    }