Exemple #1
0
 void Start()
 {
     inven   = GameObject.FindGameObjectWithTag("GM").GetComponent <Inventory>();
     d_inven = GameObject.FindGameObjectWithTag("GM").GetComponent <Deck_Inven>();
     for (int x = 0; x < card_Status.Length; x++)
     {
         if (Card_Index == "00" + (x + 1).ToString())
         {
             mana.text = card_Status[x].Mana.ToString();
         }
     }
 }
Exemple #2
0
    void Start()
    {
        d_inven = this.GetComponent <Deck_Inven>();
        deck    = this.GetComponent <Deck>();

        if (First_Run == true)
        {
            inven.Add("001");
            inven.Add("001");
            inven.Add("002");
            inven.Add("002");
            inven.Add("003");
            inven.Add("003");
            inven.Add("004");
            inven.Add("004");
            inven.Add("005");
            inven.Add("005");
            inven.Add("006");
            inven.Add("006");
            inven.Add("007");
            inven.Add("007");
            inven.Add("008");
            inven.Add("008");
            inven_static.Add("001");
            inven_static.Add("001");
            inven_static.Add("002");
            inven_static.Add("002");
            inven_static.Add("003");
            inven_static.Add("003");
            inven_static.Add("004");
            inven_static.Add("004");
            inven_static.Add("005");
            inven_static.Add("005");
            inven_static.Add("006");
            inven_static.Add("006");
            inven_static.Add("007");
            inven_static.Add("007");
            inven_static.Add("008");
            inven_static.Add("008");

            card_bot = scoll.GetChild(0).gameObject;
            for (int i = 0; i < inven.Count; i++)
            {
                g = Instantiate(card_bot, scoll);
                inven_obj.Add(g);
                g.GetComponentInChildren <Text>().text             = inven[i];
                g.GetComponentInChildren <Card_Inven>().pos        = i;
                g.GetComponentInChildren <Card_Inven>().Card_Index = inven[i];
            }
            Destroy(card_bot);

            First_Run = false;
        }
        else if (First_Run == false)
        {
            Set_to_static();

            card_bot = scoll.GetChild(0).gameObject;
            for (int i = 0; i < inven_static.Count; i++)
            {
                g = Instantiate(card_bot, scoll);
                inven_obj.Add(g);
                Debug.Log(inven_obj);
                g.GetComponentInChildren <Text>().text             = inven_static[i];
                g.GetComponentInChildren <Card_Inven>().pos        = i;
                g.GetComponentInChildren <Card_Inven>().Card_Index = inven_static[i];
            }
            Destroy(card_bot);
        }
    }