void OnGUI()
    {
        Object tarPath = EditorGUILayout.ObjectField("AutoTarget", null, typeof(Object), false, GUILayout.MaxWidth(Screen.width));

        m_assetPath    = EditorGUILayout.TextField("AssetPath", m_assetPath, GUILayout.MaxWidth(Screen.width));
        m_bRecursively = EditorGUILayout.Toggle("Recursively", m_bRecursively, GUILayout.MaxWidth(Screen.width));

        EnableSet(ref m_bSetGUI, "SetGUI");
        m_bGUI = EditorGUILayout.Toggle("GUITexture", m_bGUI, GUILayout.MaxWidth(Screen.width));

        EnableSet(ref m_bSetFilterMode, "SetFilterMode");
        m_filterMode = (FilterMode)EditorGUILayout.EnumPopup("filterMode", m_filterMode, GUILayout.MaxWidth(Screen.width));

        if (m_bSetGUI == false || m_bGUI == false)
        {
            EnableSet(ref m_bSetWrapMode, "SetWrapMode");
            m_wrapMode = (TextureWrapMode)EditorGUILayout.EnumPopup("wrapMode", m_wrapMode, GUILayout.MaxWidth(Screen.width));
            EnableSet(ref m_bSetAnisoLevel, "SetAnisoLevel");
            m_anisoLevel = EditorGUILayout.IntSlider("anisoLevel", m_anisoLevel, 0, 9, GUILayout.MaxWidth(Screen.width));
        }

        EnableSet(ref m_bSetMaxTextureSizeIdx, "SetMaxTextureSizeIdx");
        m_maxTextureSizeIdx = EditorGUILayout.Popup("maxTextureSize", m_maxTextureSizeIdx, textureSizeStr, GUILayout.MaxWidth(Screen.width));

        EnableSet(ref m_bSetTextureFormatIdx, "SetTextureFormatIdx");
        m_textureFormatIdx = EditorGUILayout.Popup("textureFormat", m_textureFormatIdx, textureFormatStr, GUILayout.MaxWidth(Screen.width));
        GUI.enabled        = true;

        if (tarPath != null)
        {
            string path = AssetDatabase.GetAssetPath(tarPath);
            path        = path.Replace("Assets/", "");
            m_assetPath = path.Replace(Path.GetFileName(path), "");
        }

        EditorGUILayout.Space();
        FXMakerLayout.GUIEnableBackup((m_assetPath.Trim() != ""));
        if (GUILayout.Button("Start Reimport", GUILayout.Height(40)))
        {
            ReimportTextures(m_assetPath, m_bRecursively, m_wrapMode, m_filterMode, m_anisoLevel, System.Convert.ToInt32(textureSizeStr[m_maxTextureSizeIdx]), textureFormatVal[m_textureFormatIdx]);
        }
        FXMakerLayout.GUIEnableRestore();
    }
Пример #2
0
    void OnGUI()
    {
        Object tarPath = EditorGUILayout.ObjectField("AutoTarget", null, typeof(Object), false, GUILayout.MaxWidth(Screen.width));

        m_srcModelPath  = EditorGUILayout.TextField("srcModelPath", m_srcModelPath, GUILayout.MaxWidth(Screen.width));
        m_bRecursively  = EditorGUILayout.Toggle("Recursively", m_bRecursively, GUILayout.MaxWidth(Screen.width));
        m_tarPrefabPath = EditorGUILayout.TextField("tarPrefabPath", m_tarPrefabPath, GUILayout.MaxWidth(Screen.width));

        if (tarPath != null)
        {
            string path = AssetDatabase.GetAssetPath(tarPath);
            path           = path.Replace("Assets/", "");
            m_srcModelPath = path.Replace(Path.GetFileName(path), "");
        }

        EditorGUILayout.Space();
        FXMakerLayout.GUIEnableBackup((m_srcModelPath.Trim() != ""));
        if (GUILayout.Button("CreatePrefab", GUILayout.Height(40)))
        {
            CreatePrefab(m_srcModelPath, m_bRecursively);
        }
        FXMakerLayout.GUIEnableRestore();
    }
Пример #3
0
    public override void OnInspectorGUI()
    {
        AddScriptNameField(m_Sel);
        m_UndoManager.CheckUndo();

        Rect rect;

        m_FxmPopupManager = GetFxmPopupManager();

        // --------------------------------------------------------------
        bool bClickButton = false;

        EditorGUI.BeginChangeCheck();
        {
//			DrawDefaultInspector();
            m_Sel.m_fUserTag = EditorGUILayout.FloatField(GetCommonContent("m_fUserTag"), m_Sel.m_fUserTag);

            m_Sel.m_AttachType = (NcParticleEmit.AttachType)EditorGUILayout.EnumPopup(GetHelpContent("m_AttachType"), m_Sel.m_AttachType, GUILayout.MaxWidth(Screen.width));

            if (m_Sel.m_AttachType == NcParticleEmit.AttachType.Active)
            {
                m_Sel.m_fDelayTime  = EditorGUILayout.FloatField(GetHelpContent("m_fDelayTime"), m_Sel.m_fDelayTime);
                m_Sel.m_fRepeatTime = EditorGUILayout.FloatField(GetHelpContent("m_fRepeatTime"), m_Sel.m_fRepeatTime);
            }

            m_Sel.m_nRepeatCount   = EditorGUILayout.IntField(GetHelpContent("m_nRepeatCount"), m_Sel.m_nRepeatCount);
            m_Sel.m_ParticlePrefab = (GameObject)EditorGUILayout.ObjectField(GetHelpContent("m_ParticlePrefab"), m_Sel.m_ParticlePrefab, typeof(GameObject), false, null);
            // --------------------------------------------------------------
            EditorGUILayout.Space();
            rect = EditorGUILayout.BeginHorizontal(GUILayout.Height(m_fButtonHeight));
            {
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 4, 0, 2), GetHelpContent("SelectParticlePrefab"), (m_FxmPopupManager != null)))
                {
                    m_FxmPopupManager.ShowSelectPrefabPopup(m_Sel, true, 0);
                }
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 4, 2, 1), GetHelpContent("ClearPrefab"), (m_Sel.m_ParticlePrefab != null)))
                {
                    bClickButton           = true;
                    m_Sel.m_ParticlePrefab = null;
                }
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 4, 3, 1), GetHelpContent("OpenPrefab"), (m_FxmPopupManager != null) && (m_Sel.m_ParticlePrefab != null)))
                {
                    bClickButton = true;
                    GetFXMakerMain().OpenPrefab(m_Sel.m_ParticlePrefab);
                    return;
                }
                GUILayout.Label("");
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            // --------------------------------------------------------------

            if (m_Sel.m_AttachType == NcParticleEmit.AttachType.Destroy)
            {
                SetMinValue(ref m_Sel.m_nRepeatCount, 1);
            }
            FXMakerLayout.GUIEnableBackup(false);
            EditorGUILayout.Toggle(GetHelpContent("m_bWorldSpace"), true);
            FXMakerLayout.GUIEnableRestore();

            m_Sel.m_EmitCount   = EditorGUILayout.IntField("m_EmitCount", m_Sel.m_EmitCount);
            m_Sel.m_RandomRange = EditorGUILayout.Vector3Field("m_RandomRange", m_Sel.m_RandomRange, null);
            m_Sel.m_AddStartPos = EditorGUILayout.Vector3Field("m_AddStartPos", m_Sel.m_AddStartPos, null);

            // check
            SetMinValue(ref m_Sel.m_EmitCount, 1);
            SetMinValue(ref m_Sel.m_fDelayTime, 0);
            SetMinValue(ref m_Sel.m_fRepeatTime, 0);
            SetMinValue(ref m_Sel.m_nRepeatCount, 0);
        }
        m_UndoManager.CheckDirty();
        // --------------------------------------------------------------
        if ((EditorGUI.EndChangeCheck() || bClickButton) && GetFXMakerMain())
        {
            OnEditComponent();
        }
        // ---------------------------------------------------------------------
        if (GUI.tooltip != "")
        {
            m_LastTooltip = GUI.tooltip;
        }
        HelpBox(m_LastTooltip);
    }
Пример #4
0
    // ==========================================================================================================
    void winEffectList(int id)
    {
        if (GetGroupIndex() < 0)
        {
            return;
        }

        Rect effectRect = FXMakerLayout.GetEffectListRect();

        // window desc -----------------------------------------------------------
        FXMakerTooltip.WindowDescription(effectRect, FXMakerLayout.WINDOWID.EFFECT_LIST, null);

        // mini ----------------------------------------------------------------
        m_bMinimize = GUI.Toggle(new Rect(3, 1, FXMakerLayout.m_fMinimizeClickWidth, FXMakerLayout.m_fMinimizeClickHeight), m_bMinimize, "Mini");
        GUI.changed = false;
        if (FXMakerLayout.m_bMinimizeAll || m_bMinimize)
        {
            RenameCurrentPrefab(m_EditingName);
            FXMakerMain.inst.SaveTooltip();
            return;
        }

        // 扁瓷 滚瓢 -----------------------------------------------------------
        Rect rect1Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 20, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 25);
        Rect rect2Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 50, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 20);
        Rect rect3Row = new Rect(FXMakerLayout.m_rectInnerMargin.x, 75, effectRect.width - FXMakerLayout.m_rectInnerMargin.x * 2, 12);

        // Add button
        if (m_nEffectCount < FXMakerLayout.m_nMaxPrefabListCount)
        {
            if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 0, 1), FXMakerTooltip.GetHcToolEffect("New"), IsReadOnlyFolder() == 0))
            {
                RenameCurrentPrefab(m_EditingName);
                ShowNewMenu();
                return;
            }
        }

        if (m_nEffectCount <= 0)
        {
            // right button
            if (Input.GetMouseButtonUp(1))
            {
                ShowRightMenu(-1, false);
            }
            return;
        }

        // Selected state
        bool bEnable = (FXMakerMain.inst.IsCurrentEffectObject() && IsReadOnlyFolder() == 0);

        // Delete button
        if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 1, 1), FXMakerTooltip.GetHcToolEffect("Del"), bEnable))
        {
            RenameCurrentPrefab(m_EditingName);
            m_bProcessDelete = true;
        }

        if (m_bProcessDelete)
        {
            m_bProcessDelete = FxmPopupManager.inst.ShowModalOkCancelMessage("'" + m_EffectContents[m_nEffectIndex].text + "'\n" + FXMakerTooltip.GetHsToolMessage("DIALOG_DELETEPREFAB", ""));
            if (m_bProcessDelete == false)
            {
                if (FxmPopupManager.inst.GetModalMessageValue() == FXMakerLayout.MODALRETURN_TYPE.MODALRETURN_OK)
                {
                    NcSpriteAnimation spriteCom = FXMakerMain.inst.GetOriginalEffectPrefab().GetComponent <NcSpriteAnimation>();
                    if (spriteCom != null && spriteCom.m_bBuildSpriteObj && spriteCom.GetComponent <Renderer>().sharedMaterial != null)
                    {
                        m_bProcessDelSprite = true;
                    }
                    else
                    {
                        GameObject deletePrefab = FXMakerMain.inst.ClearCurrentEffectObject(m_CurrentEffectRoot, true);
                        FXMakerAsset.DeleteEffectPrefab(deletePrefab);
                        SelectToolbar(m_nProjectIndex, GetGroupIndex(), m_nEffectIndex);
                        return;
                    }
                }
            }
        }

        if (m_bProcessDelSprite)
        {
            m_bProcessDelSprite = FxmPopupManager.inst.ShowModalOkCancelMessage("'" + m_EffectContents[m_nEffectIndex].text + "'\n" + FXMakerTooltip.GetHsToolMessage("DIALOG_DELETESPRITE", ""));
            if (m_bProcessDelSprite == false)
            {
                if (FxmPopupManager.inst.GetModalMessageValue() == FXMakerLayout.MODALRETURN_TYPE.MODALRETURN_OK)
                {
                    // delete material, texture
                    NcSpriteAnimation spriteCom = FXMakerMain.inst.GetOriginalEffectPrefab().GetComponent <NcSpriteAnimation>();
                    if (spriteCom.GetComponent <Renderer>().sharedMaterial.mainTexture != null)
                    {
                        string path = AssetDatabase.GetAssetPath(spriteCom.GetComponent <Renderer>().sharedMaterial.mainTexture);
                        AssetDatabase.MoveAssetToTrash(path);
//						AssetDatabase.DeleteAsset(path);
                    }
                    string matpath = AssetDatabase.GetAssetPath(spriteCom.GetComponent <Renderer>().sharedMaterial);
                    AssetDatabase.MoveAssetToTrash(matpath);
//					AssetDatabase.DeleteAsset(matpath);
                }
                // delete prefab
                GameObject deletePrefab = FXMakerMain.inst.ClearCurrentEffectObject(m_CurrentEffectRoot, true);
                FXMakerAsset.DeleteEffectPrefab(deletePrefab);
                SelectToolbar(m_nProjectIndex, GetGroupIndex(), m_nEffectIndex);
                return;
            }
        }

        // Clone button
        if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 2, 1), FXMakerTooltip.GetHcToolEffect("Clone"), bEnable))
        {
            RenameCurrentPrefab(m_EditingName);
            ClonePrefab();
            return;
        }

        // Capture Thumb button
        if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 3, 1), FXMakerTooltip.GetHcToolEffect("Thumb"), bEnable))
        {
            RenameCurrentPrefab(m_EditingName);
            ThumbPrefab();
            return;
        }

//      // History button
//      if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 4, 1), FXMakertip.GetHcToolEffect("History"), bEnable))
//      {
//          SetActiveEffect(m_nEffectIndex);
//          return;
//      }

        // Sprite button
        if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect1Row, 5, 4, 1), FXMakerTooltip.GetHcToolEffect("Sprite"), bEnable))
        {
            RenameCurrentPrefab(m_EditingName);
            SpritePrefab();
            return;
        }

        // Selected state
        if (FXMakerMain.inst.IsCurrentEffectObject())
        {
            // ChangeName
            if (FXMakerMain.inst.IsCurrentEffectObject() && 0 <= m_nEffectIndex && m_nEffectIndex < m_nEffectCount)
            {
                GUI.SetNextControlName("TextField");
                FXMakerLayout.GUIEnableBackup(IsReadOnlyFolder() == 0);
//              FXMakerMain.inst.ToggleGlobalLangSkin(true);
                m_EditingName = GUI.TextField(FXMakerLayout.GetInnerHorizontalRect(rect2Row, 4, 0, 4), m_EditingName, 50);
//              FXMakerMain.inst.ToggleGlobalLangSkin(false);
                FXMakerLayout.GUIEnableRestore();

                bool bEnterKey = (Event.current.isKey && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter));
                if (bEnterKey || (FXMakerMain.GetPrevWindowFocus() == (int)FXMakerLayout.WINDOWID.EFFECT_LIST && FXMakerMain.GetWindowFocus() != (int)FXMakerLayout.WINDOWID.EFFECT_LIST))
                {
                    RenameCurrentPrefab(m_EditingName);
                }
            }
        }

        // Resize --------------------------------------------------------------
        bool bChangeScrollColumn = false;

        m_nScrollColumn = (int)GUI.HorizontalScrollbar(rect3Row, m_nScrollColumn, 1, 1, m_nMaxObjectColumn + 1);
        if (GUI.changed)
        {
            UnityEditor.EditorPrefs.SetInt("FXMakerEffect.Effect_nScrollColumn", m_nScrollColumn);
            bChangeScrollColumn = true;

            Rect rect = FXMakerLayout.GetAspectScrollViewRect((int)rect3Row.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false);
            m_EffectListScrollPos.y = rect.height * (m_nEffectIndex - m_nScrollColumn) / (float)m_nEffectCount;
        }
        // Draw line
        Rect lineRect = rect3Row;

        lineRect.y      = rect3Row.yMax + 5;
        lineRect.height = 3;
        NgGUIDraw.DrawHorizontalLine(new Vector2(lineRect.x, lineRect.y), (int)lineRect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false);

        // Effect List ------------------------------------------------------
        Rect listRect   = FXMakerLayout.GetChildVerticalRect(effectRect, m_nGuiTopHeight, 1, 0, 1);
        Rect scrollRect = FXMakerLayout.GetAspectScrollViewRect((int)listRect.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false);
        Rect gridRect   = FXMakerLayout.GetAspectScrollGridRect((int)listRect.width, FXMakerLayout.m_fScrollButtonAspect, m_nEffectCount, m_nScrollColumn, false);

        m_EffectListScrollPos = GUI.BeginScrollView(listRect, m_EffectListScrollPos, scrollRect);
//      FXMakerMain.inst.ToggleGlobalLangSkin(true);
//		int		nEffectIndex	= GUI.SelectionGrid(listRect, m_nEffectIndex, m_EffectNameStrings, m_nScrollColumn);
//		int		nEffectIndex	= GUI.SelectionGrid(gridRect, m_nEffectIndex, m_EffectContents, m_nScrollColumn);
        int nEffectIndex = FXMakerLayout.TooltipSelectionGrid(FXMakerLayout.GetOffsetRect(effectRect, 0, -m_EffectListScrollPos.y), listRect, gridRect, m_nEffectIndex, m_EffectContents, m_nScrollColumn);

//      FXMakerMain.inst.ToggleGlobalLangSkin(false);

        // move key
        if (FXMakerMain.inst.GetFocusInputKey(FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.EFFECT_LIST)) != 0)
        {
            switch (FXMakerMain.inst.GetFocusInputKey(FXMakerLayout.GetWindowId(FXMakerLayout.WINDOWID.EFFECT_LIST)))
            {
            case KeyCode.LeftArrow: nEffectIndex--;                                       FXMakerMain.inst.SetFocusInputKey(0);   break;

            case KeyCode.RightArrow: nEffectIndex++;                                       FXMakerMain.inst.SetFocusInputKey(0);   break;

            case KeyCode.UpArrow: nEffectIndex -= m_nScrollColumn;        FXMakerMain.inst.SetFocusInputKey(0);   break;

            case KeyCode.DownArrow: nEffectIndex += m_nScrollColumn;        FXMakerMain.inst.SetFocusInputKey(0);   break;
            }
            if (nEffectIndex < 0)
            {
                nEffectIndex = 0;
            }
            if (m_nEffectCount <= nEffectIndex)
            {
                nEffectIndex = m_nEffectCount - 1;
            }
        }

        // select
        if ((bChangeScrollColumn == false && GUI.changed) || m_nEffectIndex != nEffectIndex)
        {
            RenameCurrentPrefab(m_EditingName);

            // right button
            if (Input.GetMouseButtonUp(1))
            {
                ShowRightMenu(nEffectIndex, true);
            }

            // active
            NgUtil.LogDevelop("changed m_nEffectIndex - id = " + id + ", value = " + m_EffectContents[nEffectIndex].text);
            if (nEffectIndex == m_nEffectIndex && FXMakerMain.inst.IsCurrentEffectObject())
            {
                FXMakerMain.inst.CreateCurrentInstanceEffect(true);
            }
            else
            {
                SetActiveEffect(nEffectIndex);
            }
        }
        else
        {
            // right button
            if (Input.GetMouseButtonUp(1))
            {
                RenameCurrentPrefab(m_EditingName);
                ShowRightMenu(-1, false);
            }
        }
        GUI.EndScrollView();
        FXMakerMain.inst.SaveTooltip();
    }
Пример #5
0
    public override void OnInspectorGUI()
    {
        AddScriptNameField(m_Sel);
        m_UndoManager.CheckUndo();

        Rect rect;

        m_FxmPopupManager = GetFxmPopupManager();

        // --------------------------------------------------------------
        bool bClickButton = false;

        EditorGUI.BeginChangeCheck();
        {
//			DrawDefaultInspector();
            m_Sel.m_fUserTag = EditorGUILayout.FloatField(GetCommonContent("m_fUserTag"), m_Sel.m_fUserTag);

            m_Sel.m_AttachType = (NcAttachPrefab.AttachType)EditorGUILayout.EnumPopup(GetHelpContent("m_AttachType"), m_Sel.m_AttachType, GUILayout.MaxWidth(Screen.width));

            if (m_Sel.m_AttachType == NcAttachPrefab.AttachType.Active)
            {
                m_Sel.m_fDelayTime  = EditorGUILayout.FloatField(GetHelpContent("m_fDelayTime"), m_Sel.m_fDelayTime);
                m_Sel.m_fRepeatTime = EditorGUILayout.FloatField(GetHelpContent("m_fRepeatTime"), m_Sel.m_fRepeatTime);
            }

            m_Sel.m_nRepeatCount    = EditorGUILayout.IntField(GetHelpContent("m_nRepeatCount"), m_Sel.m_nRepeatCount);
            m_Sel.m_AttachPrefab    = (GameObject)EditorGUILayout.ObjectField(GetHelpContent("m_AttachPrefab"), m_Sel.m_AttachPrefab, typeof(GameObject), false, null);
            m_Sel.m_fPrefabSpeed    = EditorGUILayout.FloatField(GetHelpContent("m_fPrefabSpeed"), m_Sel.m_fPrefabSpeed);
            m_Sel.m_fPrefabLifeTime = EditorGUILayout.FloatField(GetHelpContent("m_fPrefabLifeTime"), m_Sel.m_fPrefabLifeTime);

            if (m_Sel.m_AttachType == NcAttachPrefab.AttachType.Destroy)
            {
                SetMinValue(ref m_Sel.m_nRepeatCount, 1);

                FXMakerLayout.GUIEnableBackup(false);
                EditorGUILayout.Toggle(GetHelpContent("m_bWorldSpace"), true);
                FXMakerLayout.GUIEnableRestore();
            }

            if (m_Sel.m_AttachType == NcAttachPrefab.AttachType.Active)
            {
                m_Sel.m_bWorldSpace = EditorGUILayout.Toggle(GetHelpContent("m_bWorldSpace"), m_Sel.m_bWorldSpace);
            }

            m_Sel.m_RandomRange   = EditorGUILayout.Vector3Field("m_RandomRange", m_Sel.m_RandomRange, null);
            m_Sel.m_AddStartPos   = EditorGUILayout.Vector3Field("m_AddStartPos", m_Sel.m_AddStartPos, null);
            m_Sel.m_AccumStartRot = EditorGUILayout.Vector3Field("m_AccumStartRot", m_Sel.m_AccumStartRot, null);

            // check
            SetMinValue(ref m_Sel.m_fDelayTime, 0);
            SetMinValue(ref m_Sel.m_fRepeatTime, 0);
            SetMinValue(ref m_Sel.m_nRepeatCount, 0);
            SetMinValue(ref m_Sel.m_fPrefabSpeed, 0.01f);
            SetMinValue(ref m_Sel.m_fPrefabLifeTime, 0);

            // --------------------------------------------------------------
            EditorGUILayout.Space();
            rect = EditorGUILayout.BeginHorizontal(GUILayout.Height(m_fButtonHeight));
            {
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 3, 0, 1), GetHelpContent("Select Prefab"), (m_FxmPopupManager != null)))
                {
                    m_FxmPopupManager.ShowSelectPrefabPopup(m_Sel, true, 0);
                }
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 3, 1, 1), GetHelpContent("Clear Prefab"), (m_Sel.m_AttachPrefab != null)))
                {
                    bClickButton         = true;
                    m_Sel.m_AttachPrefab = null;
                }
                if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(rect, 3, 2, 1), GetHelpContent("Open Prefab"), (m_FxmPopupManager != null) && (m_Sel.m_AttachPrefab != null)))
                {
                    bClickButton = true;
                    GetFXMakerMain().OpenPrefab(m_Sel.m_AttachPrefab);
                    return;
                }
                GUILayout.Label("");
            }
            EditorGUILayout.EndHorizontal();

            // m_nSpriteFactoryIndex
            EditorGUILayout.Space();
            if (m_Sel.m_AttachPrefab)
            {
                NcSpriteFactory ncSpriteFactory = m_Sel.m_AttachPrefab.GetComponent <NcSpriteFactory>();
                if (ncSpriteFactory)
                {
                    m_Sel.m_nSpriteFactoryIndex = EditorGUILayout.IntSlider(GetHelpContent("m_nSpriteFactoryIndex"), m_Sel.m_nSpriteFactoryIndex, 0, ncSpriteFactory.GetSpriteNodeCount() - 1);

                    string[] spriteNames = new string[ncSpriteFactory.GetSpriteNodeCount()];
                    for (int n = 0; n < ncSpriteFactory.GetSpriteNodeCount(); n++)
                    {
                        spriteNames[n] = ncSpriteFactory.GetSpriteNode(n).m_SpriteName;
                    }
                    m_Sel.m_nSpriteFactoryIndex = EditorGUILayout.Popup("SpriteName", m_Sel.m_nSpriteFactoryIndex, spriteNames);
                }
                else
                {
                    m_Sel.m_nSpriteFactoryIndex = -1;
                }
            }
            else
            {
                m_Sel.m_nSpriteFactoryIndex = -1;
            }
        }
        m_UndoManager.CheckDirty();
        // --------------------------------------------------------------
        if ((EditorGUI.EndChangeCheck() || bClickButton) && GetFXMakerMain())
        {
            OnEditComponent();
        }
        // ---------------------------------------------------------------------
        if (GUI.tooltip != "")
        {
            m_LastTooltip = GUI.tooltip;
        }
        HelpBox(m_LastTooltip);
    }