Esempio n. 1
0
        public static JoyLandlordsHand Create(int cardNum, int handIndex = 0)
        {
            JoyLandlordsHand joyLandlordsHand = ComponentFactory.Create <JoyLandlordsHand>();

            joyLandlordsHand.mCardNum   = cardNum;
            joyLandlordsHand.mHandIndex = handIndex;
            JoyLandlordsCard joyLandlordsCard = JoyLandlordsCardPool.Ins.Create(JoyLandlordsCardPrefabType.Large, cardNum,
                                                                                UIComponent.GetUiView <JoyLandlordsRoomPanelComponent>().mSelfHandCardGroupGo.transform);

            joyLandlordsHand.Init(joyLandlordsCard);
            return(joyLandlordsHand);
        }
Esempio n. 2
0
        public static JoyLandlordsCard Create(int cardPrefabType, int cardNum, Transform parenTransform)
        {
            JoyLandlordsCard joyLandlordsCard = ComponentFactory.Create <JoyLandlordsCard>();

            if (mCardPrefabDic == null)
            {
                InitCardPrefab();
            }
            joyLandlordsCard.pCardPrefabType = cardPrefabType;
            joyLandlordsCard.Init(GameObject.Instantiate(mCardPrefabDic[cardPrefabType], parenTransform));
            joyLandlordsCard.SetCardDataUI(cardNum);
            return(joyLandlordsCard);
        }
Esempio n. 3
0
 public void Init(JoyLandlordsCard joyLandlordsCard)
 {
     mJoyLandlordsCard = joyLandlordsCard;
     mPointerEvent     = mJoyLandlordsCard.gameObject.AddComponent <PointerEvent>();
     //注册事件委托
     mPointerEvent.OnPointerDownAction  -= OnPointerDown;
     mPointerEvent.OnPointerUpAction    -= OnPointerUp;
     mPointerEvent.OnPointerEnterAction -= OnPointerEnter;
     mPointerEvent.OnPointerDownAction  += OnPointerDown;
     mPointerEvent.OnPointerUpAction    += OnPointerUp;
     mPointerEvent.OnPointerEnterAction += OnPointerEnter;
     mPointerEvent.OnPointerExitAction  -= OnPointerExit;
     mPointerEvent.OnPointerExitAction  += OnPointerExit;
 }
Esempio n. 4
0
 //销毁一个牌的实体
 public void DestroyJoyLandlordsCard(JoyLandlordsCard joyLandlordsCard)
 {
     joyLandlordsCard.SetParent(mPoolGo.transform);
     CardGoPool[joyLandlordsCard.pCardPrefabType].Add(joyLandlordsCard);
 }