Ejemplo n.º 1
0
        public void OnTouchStart(Vector2 p_point, int p_touchID)
        {
            if (OnTouchMove(p_point, p_touchID))
            {
                return;
            }
            mg_pt_ToppingHolderObject mg_pt_ToppingHolderObject2 = FindTopping(p_point);

            if (!(mg_pt_ToppingHolderObject2 != null))
            {
                return;
            }
            if (mg_pt_ToppingHolderObject2.IsSauce)
            {
                if (!m_holdingSauce)
                {
                    mg_pt_Topping mg_pt_Topping2 = GrabTopping(mg_pt_ToppingHolderObject2.ToppingType, mg_pt_ToppingHolderObject2.HeldTagSFX, p_point, p_touchID);
                    if (mg_pt_Topping2 != null)
                    {
                        m_holdingSauce = true;
                        mg_pt_ToppingHolderObject2.OnGrabbed();
                    }
                }
            }
            else
            {
                mg_pt_Topping mg_pt_Topping2 = GrabTopping(mg_pt_ToppingHolderObject2.ToppingType, mg_pt_ToppingHolderObject2.HeldTagSFX, p_point, p_touchID);
                if (mg_pt_Topping2 != null)
                {
                    mg_pt_ToppingHolderObject2.OnGrabbed();
                }
            }
        }
Ejemplo n.º 2
0
        private mg_pt_ToppingHolderObject FindTopping(Vector2 p_point)
        {
            mg_pt_ToppingHolderObject result = null;

            mg_pt_ToppingHolderObject[] toppingHolders = m_toppingHolders;
            foreach (mg_pt_ToppingHolderObject mg_pt_ToppingHolderObject2 in toppingHolders)
            {
                if (mg_pt_ToppingHolderObject2.Clicked(p_point))
                {
                    result = mg_pt_ToppingHolderObject2;
                    break;
                }
            }
            return(result);
        }