Esempio n. 1
0
    public void GetNew(string key, Action <GameObject> action)     //  , uint num = defaultNum)
    {
        GameObject obj = null;

        if (!dic.ContainsKey(key))
        {
            PoolBase pool = new PoolBase(key, defaultNum);
            dic.Add(key, pool);
            obj = pool.Get();
        }
        else
        {
            obj = dic [key].Get();
        }
        if (obj == null)
        {
            AEResources.LoadSingle(key, (obj1) => {
                obj           = obj1 as GameObject;
                GameObject go = GameObject.Instantiate(obj);
                action(go);
            });
        }
        else
        {
            action(obj);
        }
    }
Esempio n. 2
0
    private void LoadUI(string path, Action <UnityEngine.Object> action)
    {
        string uiPath = "UI/" + path;

        AEResources.LoadSingle(uiPath, (obj) => {
            action(obj);
        });
    }