示例#1
0
 private void ShowMessage(DataChat message)
 {
     if (message.GetChatType() == DataChat.ChatType.Public)
     {
         if (message.Content.IndexOf(DialogGameplayChatView.EMOTICON_CODE) != 0)
         {
             dataChat.Add(message);
             if (message.GetChatType() == DataChat.ChatType.Public)
             {
                 lbMessage.text = message.Sender.userName + " : " + message.Content;
             }
         }
     }
 }
示例#2
0
 private void ShowMessage(DataChat message)
 {
     if (message.GetChatType() == DataChat.ChatType.Public)
     {
         if (message.Sender.userName == UserName)
         {
             if (message.Content.IndexOf(DialogGameplayChatView.EMOTICON_CODE) != 0)
             {
                 PokerGameplayPlayerChat.Create(message.Content, this);
             }
             else
             {
                 if (message.Content.Contains(DialogGameplayChatView.EMOTICON_STICKER_CODE))
                 {
                     string name = "S_" + message.Content.Split('_')[1];
                     EmoticonSticker.Create(name, gameObject.transform);
                 }
                 else if (message.Content.Contains(DialogGameplayChatView.EMOTICON_ANIMATION_CODE))
                 {
                     string name = message.Content.Split('-')[1];
                     EmoticonAnimation.Create(name, gameObject.transform);
                 }
             }
         }
     }
 }
示例#3
0
 private void ShowMessage(DataChat message)
 {
     if (message.GetChatType() == DataChat.ChatType.Public)
     {
         if (message.Sender.userName == UserName)
         {
             if (message.Content.IndexOf(DialogGameplayChatView.EMOTICON_CODE) != 0)
             {
                 PokerGameplayPlayerChat.Create(message.Content, this);
             }
             else
             {
                 if (message.Content.Contains(DialogGameplayChatView.EMOTICON_STICKER_CODE))
                 {
                     string name = "S_" + message.Content.Split('_')[1];
                     EmoticonSticker.Create(name, gameObject.transform);
                 }
                 else if (message.Content.Contains(DialogGameplayChatView.EMOTICON_ANIMATION_CODE))
                 {
                     string name = message.Content.Split('-')[1];
                     EmoticonAnimation.Create(name, gameObject.transform);
                 }
             }
         }
     }
 }
示例#4
0
    private void onShowMessage(DataChat message)
    {
        if (message.GetChatType() == DataChat.ChatType.Private)
        {
            string itemInteraction = message.Content;
            if (itemInteraction.IndexOf(ITEM_INTERACTION_PREFIX) == 0)
            {
                PokerPlayerUI sender   = playmat.GetPlayerUI(message.Sender.userName);
                PokerPlayerUI receiver = playmat.GetPlayerUI(message.ReceiverName);
                GameObject    pointTo  = new GameObject();
                pointTo.name                    = "Point To";
                pointTo.transform.parent        = receiver.transform;
                pointTo.transform.localScale    = Vector3.one;
                pointTo.transform.localPosition = Vector3.zero;
                pointTo.transform.parent        = gameObject.transform;
                Vector3 pointMoveTo = pointTo.transform.localPosition;
                GameObject.Destroy(pointTo);

                string     nameSprite2D = message.Content.Split('_')[1];
                Sprite[]   sprites      = Resources.LoadAll <Sprite>("Sprites/ItemInteractions/" + nameSprite2D);
                GameObject pointFrom    = new GameObject();
                pointTo.name = "Point From";
                pointFrom.transform.parent        = sender.transform;
                pointFrom.transform.localScale    = Vector3.one;
                pointFrom.transform.localPosition = Vector3.zero;
                pointFrom.transform.parent        = gameObject.transform;

                pointFrom.AddComponent <UI2DSprite>().sprite2D = sprites[0];
                pointFrom.GetComponent <UI2DSprite>().depth    = 20;
                pointFrom.GetComponent <UI2DSprite>().MakePixelPerfect();

                pointFrom.AddComponent <UI2DSpriteAnimation>().frames          = Array.FindAll <Sprite>(sprites, sp => sp.name.Contains(nameSprite2D));
                pointFrom.GetComponent <UI2DSpriteAnimation>().ignoreTimeScale = false;
                pointFrom.GetComponent <UI2DSpriteAnimation>().framesPerSecond = 5;
                pointFrom.GetComponent <UI2DSpriteAnimation>().loop            = true;
                pointFrom.GetComponent <UI2DSpriteAnimation>().Play();
                pointFrom.name = nameSprite2D;
                Hashtable tweenValue = new Hashtable();
                tweenValue.Add("item", pointFrom);
                tweenValue.Add("spriteArray", Array.FindAll <Sprite>(sprites, sp => sp.name.Contains("finish")));
                iTween.MoveTo(pointFrom, iTween.Hash("islocal", true, "position", pointMoveTo, "time", 1.5f, "oncomplete", "onMoveItemInteractionComplete", "oncompletetarget", gameObject, "oncompleteparams", tweenValue));
            }
        }
    }
示例#5
0
 private void ShowMessage(DataChat message) 
 {
     if (message.GetChatType() == DataChat.ChatType.Public)
     {
         if (message.Content.IndexOf(DialogGameplayChatView.EMOTICON_CODE) != 0)
         {
             dataChat.Add(message);
             if (message.GetChatType() == DataChat.ChatType.Public)
             {
                 lbMessage.text = message.Sender.userName + " : " + message.Content;
             }
         }
     }
 }
示例#6
0
    private void onShowMessage(DataChat message)
    {
        if (message.GetChatType() == DataChat.ChatType.Private)
        {
            string itemInteraction = message.Content;
            if (itemInteraction.IndexOf(ITEM_INTERACTION_PREFIX) == 0)
            {
                PokerPlayerUI sender = playmat.GetPlayerUI(message.Sender.userName);
                PokerPlayerUI receiver = playmat.GetPlayerUI(message.ReceiverName);
                GameObject pointTo = new GameObject();
                pointTo.name = "Point To";
                pointTo.transform.parent = receiver.transform;
                pointTo.transform.localScale = Vector3.one;
                pointTo.transform.localPosition = Vector3.zero;
                pointTo.transform.parent = gameObject.transform;
                Vector3 pointMoveTo = pointTo.transform.localPosition;
                GameObject.Destroy(pointTo);

                string nameSprite2D = message.Content.Split('_')[1];
                Sprite[] sprites = Resources.LoadAll<Sprite>("Sprites/ItemInteractions/" + nameSprite2D);
                GameObject pointFrom = new GameObject();
                pointTo.name = "Point From";
                pointFrom.transform.parent = sender.transform;
                pointFrom.transform.localScale = Vector3.one;
                pointFrom.transform.localPosition = Vector3.zero;
                pointFrom.transform.parent = gameObject.transform;

                pointFrom.AddComponent<UI2DSprite>().sprite2D = sprites[0];
                pointFrom.GetComponent<UI2DSprite>().depth = 20;
                pointFrom.GetComponent<UI2DSprite>().MakePixelPerfect();

                pointFrom.AddComponent<UI2DSpriteAnimation>().frames = Array.FindAll<Sprite>(sprites, sp => sp.name.Contains(nameSprite2D));
                pointFrom.GetComponent<UI2DSpriteAnimation>().ignoreTimeScale = false;
                pointFrom.GetComponent<UI2DSpriteAnimation>().framesPerSecond = 5;
                pointFrom.GetComponent<UI2DSpriteAnimation>().loop = true;
                pointFrom.GetComponent<UI2DSpriteAnimation>().Play();
                pointFrom.name = nameSprite2D;
                Hashtable tweenValue = new Hashtable();
                tweenValue.Add("item", pointFrom);
                tweenValue.Add("spriteArray", Array.FindAll<Sprite>(sprites, sp => sp.name.Contains("finish")));
                iTween.MoveTo(pointFrom, iTween.Hash("islocal", true, "position", pointMoveTo, "time", 1.5f, "oncomplete", "onMoveItemInteractionComplete", "oncompletetarget", gameObject, "oncompleteparams", tweenValue));
            }
        }
    }