Esempio n. 1
0
    private void setHand()
    {
        Debug.Log("Update Hands CAlled");
        Hand theHand = displayManager.currentScene.highHandData.HandList[0];

        nameLabel.text = displayManager.currentScene.highHandData.HandList[0].fname;
        cards[0].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[1].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[2].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[3].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[4].atlas = CardAtlas.GetComponent <UIAtlas>();
        Debug.Log("Hands count:" + cards.Count);
        try
        {
            Debug.Log("Handsasds:" + theHand.hand.Length);
            cards[5].atlas      = CardAtlas.GetComponent <UIAtlas>();
            cards[6].atlas      = CardAtlas.GetComponent <UIAtlas>();
            cards[5].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[5];
            cards[6].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[6];
        }
        catch (NullReferenceException ex)
        {
            Debug.Log("NRE:" + ex.Message);
        }



        cards[0].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[0];
        cards[1].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[1];
        cards[2].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[2];
        cards[3].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[3];
        cards[4].spriteName = displayManager.currentScene.highHandData.HandList[0].hand[4];
    }
Esempio n. 2
0
    void InstantiateObj(string city, int j, int i)
    {
        if (j <= 4)
        {
            if (i > 0)
            {
                UISprite ball = GameObject.Find("Ball").GetComponent <UISprite> ();
                string   str  = "Level/level_" + j.ToString();

                UIAtlas a = Resources.Load(str, typeof(UIAtlas)) as UIAtlas;
                Debug.Log(a);
                ball.atlas      = a.GetComponent <UIAtlas> ();
                ball.spriteName = j.ToString() + "_0";

                /*int t = i*j;
                 * UILabel label = GameObject.Find ("Level").GetComponent<UILabel> ();
                 * label.text=t.ToString();*/

                for (int count = 1; count <= i; count++)
                {
                    string str_o = "Level/" + j.ToString() + "_" + count.ToString();
                    Debug.Log(str_o);
                    GameObject o = (GameObject)Instantiate(Resources.Load(str_o));
                    Debug.Log(o);
                    o.transform.parent     = GameObject.Find("background_main").transform;
                    o.transform.localScale = new Vector3(1, 1, 1);
                }
            }
        }

        if (j > 4)
        {
            if (i > 0)
            {
                UISprite ball = GameObject.Find("Ball").GetComponent <UISprite> ();
                string   str  = "Level/" + city + "/level_" + j.ToString() + "_" + city;

                UIAtlas a = Resources.Load(str, typeof(UIAtlas)) as UIAtlas;
                Debug.Log(a);
                ball.atlas      = a.GetComponent <UIAtlas> ();
                ball.spriteName = j.ToString() + "_0";

                /*int t = (i+1)*j;
                 * UILabel label = GameObject.Find ("Level").GetComponent<UILabel> ();
                 * label.text=t.ToString();*/
                for (int count = 1; count <= i; count++)
                {
                    string str_o = "Level/" + city + "/" + j.ToString() + "_" + count.ToString();
                    Debug.Log(str_o);
                    GameObject o = (GameObject)Instantiate(Resources.Load(str_o));
                    o.transform.parent     = GameObject.Find("background_main").transform;
                    o.transform.localScale = new Vector3(1, 1, 1);
                }
            }
        }
    }
Esempio n. 3
0
    public void updateHand(Hand theHand, UIAtlas CardAtlas, DisplayManager dm)
    {
        this.theHand   = theHand;
        nameLabel.text = theHand.fname;
        if (dm.currentScene.highHandData.includeTime == 1)
        {
            timeLabel.text = ":" + winningMinute(theHand.timestamp, dm.currentScene.highHandData.sessionTimer);
        }
        cards[0].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[1].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[2].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[3].atlas = CardAtlas.GetComponent <UIAtlas>();
        cards[4].atlas = CardAtlas.GetComponent <UIAtlas>();
        //deprecated
        //cards[5].atlas = CardAtlas.GetComponent<UIAtlas>();
        //cards[6].atlas = CardAtlas.GetComponent<UIAtlas>();

        cards[0].spriteName = theHand.hand[0];
        cards[1].spriteName = theHand.hand[1];
        cards[2].spriteName = theHand.hand[2];
        cards[3].spriteName = theHand.hand[3];
        cards[4].spriteName = theHand.hand[4];
    }
Esempio n. 4
0
    public void updateHand(Hand theHand, UIAtlas CardAtlas, DisplayManager dm)
    {
        nameLabel.text      = theHand.fname;
        cards[0].atlas      = CardAtlas.GetComponent <UIAtlas>();
        cards[1].atlas      = CardAtlas.GetComponent <UIAtlas>();
        cards[2].atlas      = CardAtlas.GetComponent <UIAtlas>();
        cards[3].atlas      = CardAtlas.GetComponent <UIAtlas>();
        cards[4].atlas      = CardAtlas.GetComponent <UIAtlas>();
        cards[0].spriteName = theHand.hand[0];
        cards[1].spriteName = theHand.hand[1];
        cards[2].spriteName = theHand.hand[2];
        cards[3].spriteName = theHand.hand[3];
        cards[4].spriteName = theHand.hand[4];

        if (theHand.hand.Length > 5)
        {
            cards[5].atlas      = CardAtlas.GetComponent <UIAtlas>();
            cards[6].atlas      = CardAtlas.GetComponent <UIAtlas>();
            cards[5].spriteName = theHand.hand[5];
            cards[6].spriteName = theHand.hand[6];
        }
    }