Exemple #1
0
    IEnumerator GetHighHand()
    {
        var form = new WWWForm();

        form.AddField("activity", "CurrentAdvHH");
        form.AddField("casinoid", displayInfo.casinoID);
        // Start a download of the given URL
        WWW www = new WWW(url, form);

        // Wait for download to complete
        yield return(www);

        if (www.error == null)
        {
            if (!www.text.Contains("norows"))
            {
                XmlSerializer Xml_Serializer = new XmlSerializer(typeof(highHand));
                using (StringReader reader = new StringReader(www.text))
                {
                    TheHand = (highHand)Xml_Serializer.Deserialize(reader);
                }
                updateHH = true;
            }
            else
            {
                //TheHand = ScriptableObject.CreateInstance("highHand") as highHand;
            }
        }
    }
Exemple #2
0
    private void updatePlaceHands()
    {
        highHand HighHand = displayManager.currentScene.highHandData;
        //msg.text = displayManager.currentScene.highHandData.TitleMsg;
        GameObject skin = GameObject.FindGameObjectWithTag("Skin");
        int        hnd  = 0;

        foreach (prevHand ph in thePrevHands)
        {
            ph.visible(false);
        }

        /*if (HighHand.handcount > 1)
         * {
         *  for (int i = 0; i < HighHand.handcount - 2; i++)
         *  {
         *      thePrevHands[i].visible(true);
         *  }
         * }
         */

        if (HighHand.HandList.Count == 0 || !displayManager.sceneClock.active)
        {
            nameLabel.text = "You could be next!";
            cards[0].atlas = skin.GetComponent <UIAtlas>();
            cards[1].atlas = skin.GetComponent <UIAtlas>();
            cards[2].atlas = skin.GetComponent <UIAtlas>();
            cards[3].atlas = skin.GetComponent <UIAtlas>();
            cards[4].atlas = skin.GetComponent <UIAtlas>();

            cards[0].spriteName = "CB";
            cards[1].spriteName = "CB";
            cards[2].spriteName = "CB";
            cards[3].spriteName = "CB";
            cards[4].spriteName = "CB";

            if (cards.Count > 5)
            {
                cards[5].atlas      = skin.GetComponent <UIAtlas>();
                cards[6].atlas      = skin.GetComponent <UIAtlas>();
                cards[5].spriteName = "CB";
                cards[6].spriteName = "CB";
            }


            //cards[5].spriteName = "CB";
            //cards[6].spriteName = "CB";
            thePrevHands[0].visible(false);
            thePrevHands[1].visible(false);
        }

        if (HighHand.HandList.Count > 0 && HighHand.handcount > 0)
        {
            thePrevHands[0].visible(false);
            thePrevHands[1].visible(false);
            if (displayManager.currentScene.active)
            {
                updateHand(HighHand.HandList[0], CardAtlas, displayManager);
            }
        }
        if (HighHand.HandList.Count >= 2 && HighHand.handcount > 1)
        {
            if (displayManager.currentScene.active)
            {
                if (HighHand.handcount > 1)
                {
                    thePrevHands[0].visible(true);
                    thePrevHands[1].visible(false);
                    thePrevHands[0].transform.localPosition = Placements[1];
                }

                thePrevHands[0].updateHand(HighHand.HandList[1], CardAtlas, displayManager);
                updateHand(HighHand.HandList[0], CardAtlas, displayManager);
            }
        }
        if (HighHand.HandList.Count >= 3 && HighHand.handcount == 3)
        {
            if (displayManager.currentScene.active)
            {
                thePrevHands[0].visible(true);
                if (HighHand.handcount == 3)
                {
                    thePrevHands[1].visible(true);
                    thePrevHands[0].transform.localPosition = Placements[0];
                }

                updateHand(HighHand.HandList[0], CardAtlas, displayManager);
                thePrevHands[0].updateHand(HighHand.HandList[1], CardAtlas, displayManager);
                thePrevHands[1].updateHand(HighHand.HandList[2], CardAtlas, displayManager);
            }
        }
    }