Example #1
0
        private void Awake()
        {
            Collections   = new List <PTFlatGroupCollection>();
            ptZone        = GetComponent <PTZone>();
            hasCooledDown = true;

            PTGlobalInput.OnTouchEnd += (PTTouch touch) =>
            {
                UpdateContent();
            };

            OnDragBegan += (PTTouch touch) =>
            {
                if (!allowRapidDrag)
                {
                    isDragging = true;
                    //SetDraggable(false, touch);
                }
            };
            OnDragEnd += (PTTouch touch) =>
            {
                isDragging = false;
            };
            ptZone.OnArranged += () =>
            {
                //SetDraggable(true, null);
            };
        }
Example #2
0
 public virtual void DealToAllPlayers(int amount)
 {
     foreach (PTPlayer player in PTTableTop.players)
     {
         PTZone currZone = player.GetComponent <PTZone>();
         Deal(currZone, amount, false);
     }
 }
Example #3
0
 public virtual void Deal(PTZone zone, int amount, bool faceup)
 {
     for (int i = 0; i < amount; i++)
     {
         if (content.childCount > 0)
         {
             Transform currCard = content.GetChild(0);
             currCard.ToggleVisibility(true, PT.DEFAULT_TIMER);
             currCard.Flip(faceup, PT.DEFAULT_TIMER);
             zone.Add(currCard.transform, PT.DEFAULT_TIMER * 2);
         }
     }
     StartCoroutine(ArrangeCoroutine(PT.DEFAULT_TIMER));
 }
Example #4
0
        private void OnTransformParentChanged()
        {
            PTZone parentZone = GetComponentInParent <PTZone>();

            if (parentZone)
            {
                foreach (Transform child in parentZone.content)
                {
                    PTTransform ptTrans = child.GetComponent <PTTransform>();
                    if (ptTrans && ptTrans.OnSiblingChanged != null)
                    {
                        ptTrans.OnSiblingChanged(parentZone);
                    }
                }
            }
        }
Example #5
0
        public static bool IsInZone(this Transform trans, PTZone zone)
        {
            PTZone parentZone = trans.GetComponentInParent <PTZone>();

            return(parentZone && parentZone == zone);
        }