Beispiel #1
0
    public GameObject ShowPanel(string name)
    {
        if (CheckCanvasRootIsNull())
        {
            Debug.Log("test");
            return(null);
        }

        if (IsPanelLive(name))
        {
            Debug.LogErrorFormat("[{0}] is Showing", name);
            ClosePanel(name);
            return(null);
        }

        GameObject loadGo = AssetRelate.ResourcesLoadCheckNull <GameObject>(UI_GAMEPANEL_ROOT + name);

        if (loadGo == null)
        {
            return(null);
        }

        GameObject panel = GameObjectRelate.InstantiateGameObject(m_CanvasRoot, loadGo);

        panel.name = name;

        m_PanelList.Add(name, panel);

        return(panel);
    }
Beispiel #2
0
    void Start()
    {
        m_baseItems = Inventory.Instance.m_baseItems;

        m_basebag      = GameObjectRelate.SearchChild(this.transform, "BaseBag");
        m_basebagcells = GameObjectRelate.SearchChildsPartName(m_basebag, "UCell");

        Inventory.Instance.InitBags(m_basebagcells);
    }
Beispiel #3
0
    public void InitBags(List <Transform> UCells)
    {
        int i = 0;

        foreach (uint id  in m_baseItems.Keys)
        {
            GameObject obj = AssetRelate.ResourcesLoadCheckNull <GameObject>("Prefabs/Items/" + getstring(id));
            if (obj == null)
            {
                return;
            }

            GameObject item  = GameObjectRelate.InstantiateGameObject(UCells[i++].gameObject, obj);
            clickItem  click = item.GetComponent <clickItem>();

            click.item = m_baseItems[id];
        }
    }
Beispiel #4
0
 public void Awake()
 {
     m_Text = GameObjectRelate.SearchChild(this.transform, "Text").GetComponent <Text>();
 }