Exemple #1
0
 public void OnJewelPosition(IRuntimeJewel Jewel, Vector3 from, Vector3 to)
 {
     /*
      * Here is where we need to query the board map holder and make sure that
      * this gem is the gem that is supposed to be in the position
      */
     if (jewel.JewelID == Jewel.JewelID)
     {
         IRuntimeJewel[,] board = GameData.Instance.RuntimeGame.GameBoard.GetBoardData().GetMap();
         IRuntimeJewel boardJewel = board[(int)jewel.Pos.x, (int)jewel.Pos.y];
         if (boardJewel.JewelID == jewel.JewelID)
         {
             // The board and the cascader are in sync, move jewel to correct position
             parent.MonoBehavior.StartCoroutine(CascadeJewelFromPosition(from, to));
         }
         else
         {
             // The board and the cascader are out of sync, and this jewel should have been deleted
             parent.OnRemove(jewel);
         }
     }
 }