示例#1
0
    // Update is called once per frame
    void Update()
    {
        //if (Input.GetKeyDown(KeyCode.W))
        //{
        //    if (!is_open_view && m_PigTreasureView != null)
        //    {
        //        Debug.Log("- 已分配: " + Profiler.GetTotalAllocatedMemoryLong() / 1024 / 1024 + "MBytes");
        //        Debug.Log("- 剩余: " + Profiler.GetTotalUnusedReservedMemoryLong() / 1024 / 1024 + "MBytes");
        //        //is_open_view = true;
        //        //if(m_UIRoot != null)
        //        //{
        //        //    pig_view.transform.SetParent(m_UIRoot.transform);
        //        //}

        //        Debug.Log("- 已分配: " + Profiler.GetTotalAllocatedMemoryLong() / 1024 / 1024 + "MBytes");
        //        Debug.Log("- 剩余: " + Profiler.GetTotalUnusedReservedMemoryLong() / 1024 / 1024 + "MBytes");
        //    }
        //}
        AssetTaskManager.Instence.Update();
        if (mLoadFinish && !mIsOpenView)
        {
            m_PigTreasureViewDesc = AssetManager.Instence.GetAssetObjWithType <UIPrefabDesc>(m_BundleName, m_AssetName);
            Transform pig_view = m_PigTreasureViewDesc.CreateUIObj();
            UIManager.Instence.AddTranToUIRoot(pig_view);
            mIsOpenView = true;
        }
    }
示例#2
0
    public void UpdateItemData(object data)
    {
        gameObject.SetActive(true);
        UIPrefabDesc value = data as UIPrefabDesc;

        value.callabck(value.index, value.data, this);
        inited = true;
    }
    static void CreateUIPrefabDesc()
    {
        string path = AssetDatabase.GetAssetPath(Selection.activeObject);

        Debug.Log(path);

        UIPrefabDesc desc = ScriptableObject.CreateInstance <UIPrefabDesc>();

        desc.SetUIPrefab((GameObject)Selection.activeObject);

        string savePath = (UIDescPath + path.Remove(0, path.LastIndexOf('/') + 1)).Replace(".prefab", DescPostName);

        Debug.LogFormat("save path {0}", savePath);
        AssetDatabase.CreateAsset(desc, savePath);
        AssetDatabase.Refresh();
    }