示例#1
0
 public void OnDrop(PointerEventData eventData)
 {
     if (!Ring)
     {
         // If reference point dont hold a ring, accept it straight away.
         AcceptDragRing();
     }
     else
     {
         //Debug.Log("SOMETHING INSIDE");
         if (Ring)
         {
             RingBehaviour otherRing = RingDragBehaviour.DraggedInstance.GetComponent <RingBehaviour>();
             if (Ring.CombineRings(otherRing.CurrentRingData))
             {
                 // The dragged ring will be destroyed with its data transferred to the residing ring in ringpointmanager.
                 //AcceptDragRing();
                 otherRing.GetComponent <RingDragBehaviour>().OnDragOverAndCombine();
                 RingDropEvent();
                 if (stateChange != null)
                 {
                     stateChange();
                 }
                 // Check if ring has 3 of the same colors using LINQ expression
                 if (!(Ring.CurrentRingData.ringColors.Any(o => o != Ring.CurrentRingData.ringColors[0])) && Ring.CurrentRingData.ringColors[0] != ColorIndex.NONE)
                 {
                     onTierMatchUp(Ring.CurrentRingData.ringColors[0]);
                 }
                 else if (stateChangeDragDrop != null)
                 {
                     stateChangeDragDrop(true);
                 }
             }
             else
             {
                 // CASE WHEN TIERS DONT MATCH UP
                 return;
             }
         }
     }
 }
示例#2
0
 public void AcceptSpawnedRing(RingBehaviour ringToAccept)
 {
     Ring = ringToAccept;
     IntializeRing(false);
     Ring.GetComponent <RingScaleAnimationController>().GrowIn();
 }