예제 #1
0
    // EffectFolder郴狼 prefab颇老 备己窍扁, selectPrefabPath甫 瘤沥且 版快 EffectIndex 府畔
    int LoadEffectFolder(string selectPrefabPath)
    {
        NgUtil.ClearObjects(m_EffectPrefabs);
        m_nEffectCount = 0;

        // load Group
        if (0 < m_nGroupCount)
        {
            if (GetGroupIndex() < 0)
            {
                SetGroupIndex(0);
            }

            // load Effect Folder
            string loaddir = GetCurrentDirPath();
            m_LoadDirectory = NgFile.PathSeparatorNormalize(loaddir);
            m_EffectPrefabs = NgAsset.GetPrefabList(m_LoadDirectory, false, true, FXMakerLayout.m_nMaxPrefabListCount, out m_nEffectCount);
//			m_EffectNameStrings	= new string[m_nEffectCount];
            m_EffectContents = new GUIContent[m_nEffectCount];
            BuildContents();

            // select prefab
            if (selectPrefabPath != "")
            {
                return(NgAsset.FindPathIndex(loaddir, selectPrefabPath));
            }
        }
        else
        {
        }
        return(-1);
    }
    void AddObjects(string loaddir)
    {
        m_LoadDirectory = NgFile.PathSeparatorNormalize(loaddir);
//      if (m_bSelectMeshDialog)
//           m_PrefabObjects	= NgAsset.GetMeshList(m_LoadDirectory, true, FXMakerLayout.m_nMaxPrefabListCount, out m_nObjectCount);
//      else m_PrefabObjects	= NgAsset.GetPrefabList(m_LoadDirectory, false, true, FXMakerLayout.m_nMaxPrefabListCount, out m_nObjectCount);
        if (m_bSelectMeshDialog)
        {
            m_ObjectNodes = NgAsset.GetMeshList(m_LoadDirectory, true, FXMakerLayout.m_nMaxPrefabListCount, out m_nObjectCount);
        }
        else
        {
            m_ObjectNodes = NgAsset.GetPrefabList(m_LoadDirectory, false, true, FXMakerLayout.m_nMaxPrefabListCount, true, out m_nObjectCount);
        }

        m_ObjectContents = new GUIContent[m_nObjectCount];

        // Current Select
        if (m_AddGameObject != null)
        {
            for (int n = 0; n < m_nObjectCount; n++)
            {
                if (m_ObjectNodes[n].m_AssetPath == AssetDatabase.GetAssetPath(m_AddPrefabObject))
                {
                    m_nObjectIndex = n;
                }
            }
        }
        BuildContents();
    }
예제 #3
0
    // Property -------------------------------------------------------------------------
    // Control Function -----------------------------------------------------------------
    void ResizePrefabs(string assetPath, bool bRecursively)
    {
        int nOutFindFile;

        NgAsset.ObjectNode[] objNodes = NgAsset.GetPrefabList("Assets/" + assetPath, false, bRecursively, 0, false, NgEnum.PREFAB_TYPE.All, out nOutFindFile);
        for (int n = 0; n < objNodes.Length; n++)
        {
            ResizePrefab(objNodes[n].m_AssetPath);
        }
    }
예제 #4
0
    // background俊 荤侩瞪 府家胶 格废 备己窍扁
    void LoadResourceFolder()
    {
        for (int n = 0; n < m_CloneTypeCount; n++)
        {
            string strDir     = NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDRESOURCES), m_ResourceSubDir[n]);
            int    nFileCount = 0;

            m_ClonePrefabs[n]  = NgAsset.GetPrefabList(strDir, false, true, FXMakerLayout.m_nMaxResourceListCount, out nFileCount);
            m_CloneContents[n] = new GUIContent[m_ClonePrefabs[n].Length];
        }
        BuildResourceContents();
    }
예제 #5
0
    // BackgroundFolder郴狼 prefab list客 捞抚备己窍扁, selectPrefabPath甫 瘤沥且 版快 BackgroundIndex 府畔
    int LoadBackgroundFolder(string selectPrefabPath)
    {
//      Debug.Log(selectPrefabPath);
        NgUtil.ClearObjects(m_BackgroundPrefabs);
        m_nBackgroundCount = 0;

        // load Group
        if (0 < m_nGroupCount)
        {
            // load Background Folder
            string loaddir = NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDPREFABS), m_GroupFolerContents[m_nGroupIndex].text);
//          Debug.Log(loaddir);
            m_BackgroundPrefabs  = NgAsset.GetPrefabList(loaddir, false, true, 0, out m_nBackgroundCount);
            m_BackgroundContents = new GUIContent[Mathf.Max(m_nBackgroundCount, FXMakerOption.inst.m_nMinBottomToolbarCount)];
            for (int n = 0; n < m_BackgroundPrefabs.Length; n++)
            {
                GUIContent econ = new GUIContent();
                econ.image              = FXMakerMain.inst.GetPrefabThumbTexture(m_BackgroundPrefabs[n]);
                econ.text               = m_BackgroundPrefabs[n].name;
                econ.tooltip            = FXMakerTooltip.GetHsToolBackground("BACKGROUND_HOVER", m_BackgroundPrefabs[n].name);
                m_BackgroundContents[n] = econ;
            }
            for (int n = m_BackgroundPrefabs.Length; n < FXMakerOption.inst.m_nMinBottomToolbarCount; n++)
            {
                GUIContent econ = new GUIContent();
                econ.image              = null;
                econ.text               = "";
                econ.tooltip            = FXMakerTooltip.GetHsToolBackground("EMPTYBACKGROUND_HOVER", "");
                m_BackgroundContents[n] = econ;
            }

            // select prefab
            if (selectPrefabPath != "")
            {
                return(NgAsset.FindPathIndex(loaddir, selectPrefabPath, "prefab"));
            }
        }
        else
        {
        }
        return(-1);
    }