コード例 #1
0
    public static TBGiftDespItem CreatGiftDespItem(GameObject tParent, int id)
    {
        UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UITBDespItem);
        if (obj != null)
        {
            GameObject     go      = Instantiate(obj) as GameObject;
            TBGiftDespItem fc      = go.GetComponent <TBGiftDespItem> ();
            Transform      goTrans = go.transform;
            RED.AddChild(go, tParent);
            go.transform.localPosition = Vector3.zero;
            goTrans.localScale         = Vector3.one;
            fc.id = id;

            return(fc);
        }
        return(null);
    }
コード例 #2
0
 public void InitDespInfo(int type)
 {
     int[] tGiftList = Core.Data.ActivityManager.GetRewardDataList(type).Show;
     despRoot.GetComponent <UIGrid> ().Reposition();
     for (int i = 0; i < tGiftList.Length; i++)
     {
         UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UITBDespItem);
         if (obj != null)
         {
             GameObject     go = Instantiate(obj) as GameObject;
             TBGiftDespItem fc = go.GetComponent <TBGiftDespItem> ();
             go.transform.parent        = despRoot.transform;
             go.transform.localPosition = orginPos;
             go.transform.localScale    = Vector3.one;
             fc.id = tGiftList [i];
             itemTBGDespList.Add(fc);
         }
     }
     SpringPanel.Begin(despRoot.transform.parent.gameObject, Vector3.up * 57, 8f);
     despRoot.transform.parent.gameObject.GetComponent <SpringPanel> ().enabled = true;
     despRoot.GetComponent <UIGrid> ().Reposition();
 }