Exemple #1
0
 public void initMailList()
 {
     deleAllMail();
     Content.GetComponent <RectTransform> ().sizeDelta = new Vector2(0, posY * account.mailList.Count);
     if (account.mailList.Count == 0)
     {
         root.Find("NoMail").gameObject.SetActive(true);
         return;
     }
     for (int i = 0; i < account.mailList.Count; i++)
     {
         MAIL      mail = account.mailList [i];
         Transform tr   = Instantiate(mailBase);
         string    info = "";
         if (mail.mailType == 1)
         {
             info = mail.senderName + " 发了一封邮件给你,请尽快查收吧";
         }
         else if (mail.mailType == 3)
         {
             info = mail.senderName + " 想要添加你为好友,请尽快处理吧";
         }
         else if (mail.mailType == 2)
         {
             info = mail.senderName + "同意了你的加好友请求";
         }
         tr.Find("info").GetComponent <Text> ().text  = info;
         tr.Find("look").GetComponent <Text> ().text  = (mail.lookOver == 0 ? "未读" : "已读");
         tr.Find("index").GetComponent <Text> ().text = i + "";
         tr.SetParent(Content, false);
         tr.gameObject.SetActive(true);
         EventInterface.AddOnEvent(tr, ClickMail);
     }
 }
    // Use this for initialization
    void init()
    {
        topRoot        = transform.Find("top");
        seleRoot       = transform.Find("selePanel");
        playerNameText = topRoot.Find("playerName").GetComponent <Text> ();
        goldText       = topRoot.Find("goldBG/Text").GetComponent <Text> ();
        roomCardText   = topRoot.Find("FKBG/Text").GetComponent <Text> ();
        rangRoot       = transform.Find("Ranking");
        //topRoot.gameObject.SetActive (false);
        //rangRoot.gameObject.SetActive (false);
        enterRoomBtn    = seleRoot.Find("enterRoom");
        xzddBtn         = seleRoot.Find("XZMJ");
        CreatRoomBtn    = seleRoot.Find("CreatRoom");
        Friends_Content = transform.Find("Ranking/Scroll View/Viewport/Content");
        Friend_item     = transform.Find("Ranking/item");
        EventInterface.AddOnEvent(enterRoomBtn, Click);
        EventInterface.AddOnEvent(xzddBtn, Click);
        EventInterface.AddOnEvent(CreatRoomBtn, Click);

        enterRoomPanel              = transform.Find("enterRoomPanel");
        enterRoomPanel_InputField   = enterRoomPanel.Find("InputField").GetComponent <InputField> ();
        enterRoomPanel_enterRoomBtn = enterRoomPanel.Find("enterRoomBtn");
        enterRoomPanel_returnBtn    = enterRoomPanel.Find("returnBtn");
        EventInterface.AddOnEvent(enterRoomPanel_returnBtn, Click);
        EventInterface.AddOnEvent(enterRoomPanel_enterRoomBtn, Click);

        bottomRoot = transform.Find("bottom");
        mailBtn    = bottomRoot.Find("message_btn");
        EventInterface.AddOnEvent(mailBtn, Click);
    }
 // Use this for initialization
 void Start () {
     AccountNameInput = transform.Find("AccountNameInput").GetComponent<InputField>();
     PassWordInput = transform.Find("PassWordInput").GetComponent<InputField>();
     loginBtn = transform.Find("loginBtn");
     EventInterface.AddOnEvent(loginBtn,Click);
     installEvents();
 }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     //创建玩家消息
     for (int i = 0; i < 4; i++)
     {
         playerInfoList.Add(new playerInfo(transform.Find("playerInfo/player" + (i + 1)), i));
     }
     roomIdText    = transform.Find("roomID").GetComponent <Text>();
     leaveBtn      = transform.Find("leaveBtn");
     changeRoomBtn = transform.Find("changeBtn");
     readyBtn      = transform.Find("readyBtn");
     EventInterface.AddOnEvent(leaveBtn, Click);
     EventInterface.AddOnEvent(changeRoomBtn, Click);
     EventInterface.AddOnEvent(readyBtn, Click);
     installEvents();
     print("开始进入房间");
     if (GameManager.GetInstance().gameSceneLoadeOver())
     {
         print("进入麻将房间成功");
         roomIsIn = true;
     }
     else
     {
         timerManager.GetInstance().addTimer(0.1f, 0.1f, (timerID, userData) =>
         {
             if (GameManager.GetInstance().gameSceneLoadeOver())
             {
                 print("进入麻将房间成功222");
                 timerManager.GetInstance().cancelTimer(timerID);
                 roomIsIn = true;
             }
         });
     }
 }
 public void initFriendsListOK(PLAYRE_DATA_LIST arg1)
 {
     if (arg1.Count == 0)
     {
         MonoBehaviour.print("没有好友!!!");
         noFriendsTr.gameObject.SetActive(true);
     }
     else
     {
         noFriendsTr.gameObject.SetActive(false);
         foreach (Transform item in Friends_Content)
         {
             Destroy(item.gameObject);
         }
         MonoBehaviour.print("有好友---!" + arg1.Count);
         foreach (var item in arg1)
         {
             MonoBehaviour.print(item.playerName + "---" + item.playerDBID + "---" + item.playerGold + "---" + item.isOnLine);
             Transform tr = Instantiate(Friend_item);
             tr.SetParent(Friends_Content, false);
             tr.gameObject.SetActive(true);
             string active = item.isOnLine == 0 ? "离线" : "在线";
             tr.Find("name").GetComponent <Text>().text     = item.playerName + "(" + active + ")";
             tr.Find("dbid").GetComponent <Text>().text     = item.playerDBID + "";
             tr.Find("goldText").GetComponent <Text>().text = item.playerGold + "";
             Transform btn = tr.Find("Give");
             EventInterface.AddOnEvent(btn, SendMsg);
         }
     }
 }
Exemple #6
0
 // Use this for initialization
 void Start()
 {
     closeBtn = root.Find("close");
     EventInterface.AddOnEvent(addFriendBtn, Click);
     EventInterface.AddOnEvent(closeBtn, Click);
     root.localScale = new Vector3(0, 0, 0);
     root.DOScale(new Vector3(1, 1, 1), 0.3f).SetEase(Ease.OutBack);
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     root      = transform.Find("root");
     creatBtn  = root.Find("creatBtn");
     nameInput = root.Find("nameInput").GetComponent <InputField> ();
     EventInterface.AddOnEvent(creatBtn, Click);
     root.localScale = new Vector3(0, 0, 0);
     root.DOScale(new Vector3(1, 1, 1), 0.3f).SetEase(Ease.OutBack);
 }
 // Use this for initialization
 void Start()
 {
     instance   = this;
     roomIdText = transform.Find("roomID").GetComponent <Text>();
     leaveBtn   = transform.Find("leaveBtn");
     EventInterface.AddOnEvent(leaveBtn, Click);
     print("进入麻将房间成功");
     GameManager.GetInstance().gameSceneLoadeOver();
     installEvents();
 }
 // Use this for initialization
 void Awake()
 {
     instance = this;
     EventInterface.AddOnEvent(sendPaiBtn, Click);
     EventInterface.AddOnEvent(showActionDataBtn, Click);
     EventInterface.AddOnEvent(pengBtn, Click);
     EventInterface.AddOnEvent(gangBtn, Click);
     EventInterface.AddOnEvent(huBtn, Click);
     EventInterface.AddOnEvent(guoBtn, Click);
     EventInterface.AddOnEvent(showPublicInfoBtn, Click);
     EventInterface.AddOnEvent(showTingPaiInfoBtn, Click);
 }
Exemple #10
0
 // Use this for initialization
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     root = transform.Find("root");
     root.DOScale(1, 0.3f).SetEase(Ease.OutBack);
     cancelBtn = root.Find("cancelBtn");
     OKBtn     = root.Find("OKBtn");
     closeBtn  = root.Find("closeBtn");
     EventInterface.AddOnEvent(cancelBtn, Click);
     EventInterface.AddOnEvent(OKBtn, Click);
     EventInterface.AddOnEvent(closeBtn, Click);
     titleText    = root.Find("titleText").GetComponent <Text>();
     ContentsText = root.Find("ContentsText").GetComponent <Text>();
 }
Exemple #11
0
 // Use this for initialization
 void Start()
 {
     instance      = this;
     root          = transform.Find("root");
     returnBtn     = root.Find("return");
     Content       = root.Find("Scroll View/Viewport/Content");
     mailBase      = root.Find("MailBase");
     mailInfoPanel = transform.Find("mailInfoPanel");
     EventInterface.AddOnEvent(returnBtn, Click);
     account = (Account)KBEngineApp.app.player();
     root.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack);
     posY = mailBase.GetComponent <RectTransform> ().rect.height;
     initMailList();
 }
 public ActionData()
 {
     account     = (Account)KBEngineApp.app.player();
     ActionPanel = MJpanel.instance.transform.Find("ActionPanel");
     btn_gang    = ActionPanel.Find("gang");
     btn_pen     = ActionPanel.Find("pen");
     btn_hu      = ActionPanel.Find("hu");
     btn_guo     = ActionPanel.Find("guo");
     EventInterface.AddOnEvent(btn_gang, click);
     EventInterface.AddOnEvent(btn_pen, click);
     EventInterface.AddOnEvent(btn_hu, click);
     EventInterface.AddOnEvent(btn_guo, click);
     ActionPanel.gameObject.SetActive(false);
 }
Exemple #13
0
 // Use this for initialization
 void Awake()
 {
     root        = transform.Find("root");
     returnBtn   = root.Find("return");
     okBtn       = root.Find("okBtn");
     deleBtn     = root.Find("deleBtn");
     okBtnText   = okBtn.Find("Text").GetComponent <Text>();
     deleBtnText = deleBtn.Find("Text").GetComponent <Text>();
     EventInterface.AddOnEvent(returnBtn, Click);
     EventInterface.AddOnEvent(okBtn, Click);
     EventInterface.AddOnEvent(deleBtn, Click);
     account = (Account)KBEngineApp.app.player();
     root.DOScale(Vector3.one, 0.5f).SetEase(Ease.OutBack);
     mailInfotext = root.Find("info").GetComponent <Text>();
 }
 public void initSeat(int serverSeatIndex)
 {
     ServerIndex = serverSeatIndex;
     //0号位玩家的手牌单独操作
     MonoBehaviour.print("索引为--" + localIndex);
     iconBG = root.Find("iconBG");
     if (localIndex == 0)
     {
         isPlayer        = true;
         MyCardlist      = MJpanel.instance.transform.Find("MycardList");
         tingPaiInfo     = MJpanel.instance.transform.Find("tingPaiInfo");
         tingPaiInfoRoot = tingPaiInfo.Find("root");
         tingPaiPrfb     = tingPaiInfo.Find("prfb");
     }
     else
     {
         MyCardlist    = root.Find("MycardList");
         holdsStartPos = MyCardlist.Find("holdCardStart").localPosition;
         EventInterface.AddOnEvent(iconBG, iconBGClick);
     }
     holdsCardPrfb   = MyCardlist.Find("HoldsCard");
     holdsRoot       = MyCardlist.Find("holdsRoot");
     holdsCardWeight = holdsCardPrfb.GetComponent <RectTransform>().rect.width;
     //打出的牌
     Myflodslist     = root.Find("MyfoldsList");
     flodsCardPrfb   = Myflodslist.Find("FoldsCord");
     flodsRoot       = Myflodslist.Find("Root");
     flodsRoot2      = Myflodslist.Find("Root2");
     playPaiPos      = MyCardlist.Find("playPaiPos");
     MyPengList      = root.Find("MyPenList");
     pengPrfb        = MyPengList.Find("pengPrf");
     pengRoot        = MyPengList.Find("pengRoot");
     MyGangList      = root.Find("MyGangList");
     diangangsPrf    = MyGangList.Find("diangangsPrf");
     diangangsRoot   = MyGangList.Find("diangangsRoot");
     wangangsPrf     = MyGangList.Find("wangangsPrf");
     wangangsRoot    = MyGangList.Find("wangangsRoot");
     angangsPrf      = MyGangList.Find("angangsPrf");
     angangsRoot     = MyGangList.Find("angangsRoot");
     MyHUList        = root.Find("MyHuList");
     huPrf           = MyHUList.Find("huCord");
     huRoot          = MyHUList.Find("Root");
     flodsCardWeight = flodsCardPrfb.GetComponent <RectTransform>().rect.width;
     flodsCardHeight = flodsCardPrfb.GetComponent <RectTransform>().rect.height;
     pengRootWeight  = pengPrfb.GetComponent <RectTransform>().rect.width;
 }
Exemple #15
0
 // Use this for initialization
 void Start()
 {
     instance = this;
     //创建玩家消息
     for (int i = 0; i < 4; i++)
     {
         playerInfoList.Add(new playerInfo(transform.Find("playerInfo/player" + (i + 1)), i));
     }
     roomIdText    = transform.Find("roomID").GetComponent <Text>();
     leaveBtn      = transform.Find("leaveBtn");
     changeRoomBtn = transform.Find("changeBtn");
     readyBtn      = transform.Find("readyBtn");
     EventInterface.AddOnEvent(leaveBtn, Click);
     EventInterface.AddOnEvent(changeRoomBtn, Click);
     EventInterface.AddOnEvent(readyBtn, Click);
     print("进入麻将房间成功");
     GameManager.GetInstance().gameSceneLoadeOver();
     installEvents();
 }
Exemple #16
0
    void initMyHandCords(bool isTurn)
    {
        for (int i = 0; i < holdsRoot.childCount; i++)
        {
            GameObject.Destroy(holdsRoot.GetChild(i).gameObject);
        }
        Account      account   = (Account)KBEngineApp.app.player();
        List <SByte> handCards = account.holds;
        sbyte        pai       = account.holds[account.holds.Count - 1];

        if (isTurn)
        {
            handCards.Remove(pai);
        }
        handCards.Sort();
        handCards.Reverse();
        float paiWeight = holdsCardPrfb.GetComponent <RectTransform>().rect.width;

        for (int i = 0; i < handCards.Count; i++)
        {
            int        hs = handCards[i];
            GameObject go = GameObject.Instantiate(holdsCardPrfb.gameObject);
            go.name = hs + "";
            go.transform.Find("hs").GetComponent <Image>().sprite = MJpanel.instance.getUISprite("UI/MJSprite/" + MJpanel.instance.getMJType(hs));
            go.transform.SetParent(holdsRoot, false);
            go.transform.localPosition = new Vector3(holdsCardPrfb.localPosition.x - i * paiWeight, holdsCardPrfb.localPosition.y, 0);
            go.SetActive(true);
            EventInterface.AddOnEvent(go.transform, ClickPai);
        }
        if (isTurn)
        {
            GameObject go = GameObject.Instantiate(holdsCardPrfb.gameObject);
            go.name = pai + "";
            go.transform.Find("hs").GetComponent <Image>().sprite = MJpanel.instance.getUISprite("UI/MJSprite/" + MJpanel.instance.getMJType(pai));
            go.transform.SetParent(holdsRoot, false);
            go.transform.localPosition = new Vector3(holdsCardPrfb.localPosition.x + 2 * paiWeight, holdsCardPrfb.localPosition.y, 0);
            go.SetActive(true);
            EventInterface.AddOnEvent(go.transform, ClickPai);
            handCards.Add(pai);
        }
    }