Esempio n. 1
0
    public void SetData(PokerPlayerController player)
    {
        bool addEvent = data == null;

        this.data = player;
        if (addEvent)
        {
            data.onDataChanged += playerModel_onDataChanged;
        }
        UpdateUI(player);
        PuApp.Instance.GetImage(data.avatar, (_texture) => texture.mainTexture = _texture);

        Vector3 giftPosition = btnGift.transform.localPosition;

        if ((int)player.GetSide() > (int)Puppet.Poker.PokerSide.Slot_5)
        {
            float x = Math.Abs(giftPosition.x);
            giftPosition.x = x;
        }
        btnGift.transform.localPosition = giftPosition;
    }
Esempio n. 2
0
 public void SetDealerObjectToPlayer(PokerPlayerController player)
 {
     objectDealer.SetActive(true);
     PokerGPSide playerSide = Array.Find<PokerGPSide>(arrayPokerSide, s => s.CurrentSide == player.GetSide());
     objectDealer.transform.parent = playerSide.positionDealer.transform;
     objectDealer.transform.localPosition = Vector3.zero;
     objectDealer.transform.localScale = Vector3.one;
 }
Esempio n. 3
0
    public void SetData(PokerPlayerController player)
    {
        bool addEvent = data == null;
        this.data = player;
        if (addEvent)
            data.onDataChanged += playerModel_onDataChanged;
        UpdateUI(player);
        PuApp.Instance.GetImage(data.avatar, (_texture) => texture.mainTexture = _texture);

        Vector3 giftPosition = btnGift.transform.localPosition;
        if ((int)player.GetSide() > (int)Puppet.Poker.PokerSide.Slot_5)
        {
            float x = Math.Abs(giftPosition.x);
            giftPosition.x = x;
        }
        btnGift.transform.localPosition = giftPosition;
    }
Esempio n. 4
0
    public void SetDealerObjectToPlayer(PokerPlayerController player)
    {
        objectDealer.SetActive(true);
        PokerGPSide playerSide = Array.Find <PokerGPSide>(arrayPokerSide, s => s.CurrentSide == player.GetSide());

        objectDealer.transform.parent        = playerSide.positionDealer.transform;
        objectDealer.transform.localPosition = Vector3.zero;
        objectDealer.transform.localScale    = Vector3.one;
    }
Esempio n. 5
0
    void SetPositionAvatarPlayer(string userName)
    {
        PokerPlayerController player = PokerObserver.Game.GetPlayer(userName);

        GameObject obj;

        if (dictPlayerObject.ContainsKey(userName) && listPlayerQuit.Find(p => p.UserName == userName) == null)
        {
            obj = dictPlayerObject[userName];
        }
        else if (dictReJoinGame.ContainsKey(userName))
        {
            obj = dictReJoinGame[userName];
        }
        else
        {
            obj = (GameObject)GameObject.Instantiate(prefabPlayer);
            if (listPlayerQuit.Find(p => p.UserName == userName) == null)
            {
                dictPlayerObject.Add(player.userName, obj);
            }
            else if (dictReJoinGame.ContainsKey(player.userName) == false)
            {
                dictReJoinGame.Add(player.userName, obj);
            }
        }

        PokerGPSide   playerSide = Array.Find <PokerGPSide>(arrayPokerSide, s => s.CurrentSide == player.GetSide());
        PokerPlayerUI playerUI   = obj.GetComponent <PokerPlayerUI>();

        playerUI.side = playerSide;
        playerUI.SetData(player);
        obj.transform.parent        = playerSide.transform;
        obj.transform.localPosition = Vector3.zero;
        obj.transform.localScale    = Vector3.one;
        playerUI.ChangeCardPosition();
    }