Esempio n. 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);
    }
Esempio n. 2
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);
    }