public static void EndSpriteCapture(int nSpriteCaptureCount)
    {
        FxmSpritePopup spritePopup = FxmPopupManager.inst.GetSpritePopup();

        // Save Capture
        FXMakerEffect.inst.SaveProject();
        string path = spritePopup.EndCapture(m_SpriteTextures);

        // Restore gui
        Camera.main.backgroundColor = m_SpriteOldBackColor;
        FXMakerMain.inst.GetComponent <FXMakerEffect>().enabled = true;
        FXMakerMain.inst.GetComponentInChildren <FXMakerGizmo>().SetSpriteCaptureState(false);
        FXMakerMain.inst.GetFXMakerControls().SetTimeScale(m_fOldTime);

        // select
        if (spritePopup.m_bCreatePrefab)
        {
            FXMakerEffect.inst.LoadProject(path);
        }
        else
        {
            FXMakerEffect.inst.LoadProject();
            if (path != "")
            {
                Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Texture));
                FXMakerAsset.SetPingObject(obj);
            }
        }
    }
Beispiel #2
0
    public void SetCloneObject(int nCloneIndex, GameObject prefab)
    {
        // 기존 것 삭제
        if (m_ChildObjects[nCloneIndex] != null)
        {
            Object.DestroyImmediate(m_ChildObjects[nCloneIndex]);
            m_ChildObjects[nCloneIndex]        = null;
            m_CloneThumbFilenames[nCloneIndex] = "";
        }

        // 새로운 차일드 등록
        if (prefab != null)
        {
            m_ChildObjects[nCloneIndex] = NgAsset.LoadPrefab(prefab, gameObject);
            NgObject.SetActiveRecursively(m_ChildObjects[nCloneIndex], true);
            m_ChildObjects[nCloneIndex].name = m_ChildObjects[nCloneIndex].name.Replace("(Clone)", "");

            // 사용된 prefab과 GameObject를 선택한다.
            FXMakerAsset.SetPingObject(prefab, m_ChildObjects[nCloneIndex]);

            // thumb 출력을 위해서 원본prefab의 guid를 저장해 둔다.
            m_CloneThumbFilenames[nCloneIndex] = NgAsset.GetPrefabThumbFilename(prefab);
        }
        FXMakerBackground.inst.SaveBackgroundPrefab();
    }
    // ----------------------------------------------------------------------------------------------------------
    protected override void SetActiveObject(int nObjectIndex)
    {
        if (nObjectIndex < 0 || m_nObjectCount <= nObjectIndex)
        {
            return;
        }

        GameObject selCurveAniObj = m_CurveAniObjects[nObjectIndex];

        // right button, image Ping and not select
        if (Input.GetMouseButtonUp(1))
        {
            FXMakerAsset.SetPingObject(selCurveAniObj);
            return;
        }

        // 같은것 재클릭
        if (m_nObjectIndex == nObjectIndex)
        {
            FXMakerAsset.SetPingObject(m_CurrentCurveAnimation);
            FXMakerMain.inst.CreateCurrentInstanceEffect(true);
            return;
        }

        SetCurveAni(selCurveAniObj);
        FXMakerMain.inst.CreateCurrentInstanceEffect(true);

        m_nObjectIndex           = nObjectIndex;
        m_nSelObjectProjectIndex = m_nProjectIndex;
        m_nSelObjectGroupIndex   = (m_bOptionRecursively ? -1 : m_nGroupIndex);
        m_SelObjectContent       = new GUIContent(m_ObjectContents[nObjectIndex].text, m_ObjectContents[nObjectIndex].image, m_ObjectContents[nObjectIndex].tooltip);
    }
Beispiel #4
0
	public void SetCurrentEffectPrefab(GameObject setPrefab, GameObject effectRoot, bool bUpdateOnlyPrefab)
	{
		if (m_bApplicationQuit)
			return;

		if (IsStartTooMain() || setPrefab == null)
			return;

		m_OriginalEffectPrefab	= setPrefab;
		if (bUpdateOnlyPrefab)
			return;

		NcEffectBehaviour.PreloadTexture(setPrefab);

		m_OriginalEffectObject	= NgAsset.LoadPrefab(setPrefab, effectRoot);
		m_OriginalEffectObject.name = m_OriginalEffectObject.name.Replace("(Clone)", "(Original)");
		NgObject.SetActiveRecursively(m_OriginalEffectObject, false);

		if (IsLoadingProject() == false)
			FXMakerAsset.SetPingObject(m_OriginalEffectObject);

		// EffectHierarchy
		if (GetFXMakerHierarchy() != null)
			GetFXMakerHierarchy().ShowHierarchy(m_OriginalEffectObject);
		// Create ShowObject
		CreateCurrentInstanceEffect(true);
	}
Beispiel #5
0
    public void SetCloneObject(int nCloneIndex, GameObject prefab)
    {
        // 扁粮 巴 昏力
        if (m_ChildObjects[nCloneIndex] != null)
        {
            Object.DestroyImmediate(m_ChildObjects[nCloneIndex]);
            m_ChildObjects[nCloneIndex]        = null;
            m_CloneThumbFilenames[nCloneIndex] = "";
        }

        // 货肺款 瞒老靛 殿废
        if (prefab != null)
        {
            m_ChildObjects[nCloneIndex] = NgAsset.LoadPrefab(prefab, gameObject);
            NgObject.SetActiveRecursively(m_ChildObjects[nCloneIndex], true);
            m_ChildObjects[nCloneIndex].name = m_ChildObjects[nCloneIndex].name.Replace("(Clone)", "");

            // 荤侩等 prefab苞 GameObject甫 急琶茄促.
            FXMakerAsset.SetPingObject(prefab, m_ChildObjects[nCloneIndex]);

            // thumb 免仿阑 困秦辑 盔夯prefab狼 guid甫 历厘秦 敌促.
            m_CloneThumbFilenames[nCloneIndex] = NgAsset.GetPrefabThumbFilename(prefab);
        }
        FXMakerBackground.inst.SaveBackgroundPrefab();
    }
Beispiel #6
0
    void SetSelectedTransformMaterial(Material selMaterial)
    {
        Material[] mats = m_SelectedTransform.GetComponent <Renderer>().sharedMaterials;

        m_SelectedMaterial           = selMaterial;
        mats[m_nSelRendererMatIndex] = selMaterial;
        m_SelectedTransform.GetComponent <Renderer>().sharedMaterials = mats;
//      m_SelectedTransform.renderer.sharedMaterial = selMaterial;
        FXMakerHierarchy.inst.SetActiveComponent(m_SelectedTransform.gameObject, m_SelectedMaterial, false);
        FXMakerAsset.SetPingObject(m_SelectedMaterial);
    }
Beispiel #7
0
 public void SetPingObject(int nChildIndex)
 {
     if (nChildIndex < FXMakerBackground.m_CloneTypeCount)
     {
         FXMakerAsset.SetPingObject(m_ChildObjects[nChildIndex]);
     }
     else
     {
         FXMakerAsset.SetPingObject(m_ReferenceObjects[nChildIndex - FXMakerBackground.m_CloneTypeCount]);
     }
 }
Beispiel #8
0
    // ----------------------------------------------------------------------------------------------------------
    protected override void SetActiveObject(int nObjectIndex)
    {
        if (nObjectIndex < 0 || m_nObjectCount <= nObjectIndex)
        {
            return;
        }

        Texture selTexture = GetObjectNodeTexture(nObjectIndex);
        bool    bMaskTex   = false;

        // right button, image Ping and not select
        if (Input.GetMouseButtonUp(1))
        {
            if (m_SelectedMaterial != null && NgMaterial.IsMaskTexture(m_SelectedMaterial))
            {
                m_nSelMaskTextureIndex = nObjectIndex;
                bMaskTex = true;
            }
            else
            {
                FXMakerAsset.SetPingObject(selTexture);
                return;
            }
        }
        else
        {
            m_nSelMainTextureIndex = nObjectIndex;
        }

//      // ������ ��Ŭ��
//      if (m_nObjectIndex == nObjectIndex)
//      {
//          FXMakerAsset.SetPingObject(m_SelectedMaterial);
//          FXMakerMain.inst.CreateCurrentInstanceEffect(true);
//          return;
//      }

        SetActiveObject(selTexture, bMaskTex);

        // GUI Update
        m_nObjectIndex           = nObjectIndex;
        m_nSelObjectProjectIndex = m_nProjectIndex;
        m_nSelObjectGroupIndex   = (m_bOptionRecursively ? -1 : m_nGroupIndex);
        m_SelObjectContent       = new GUIContent(m_ObjectContents[nObjectIndex].text, m_ObjectContents[nObjectIndex].image, m_ObjectContents[nObjectIndex].tooltip);
    }
    void SetCurrentBackgroundInfo(GameObject setPrefab)
    {
        // clear current
        NgObject.RemoveAllChildObject(m_CurrentBackgroundRoot, true);
        if (m_CurrentBackgroundInfo != null)
        {
            DestroyImmediate(m_CurrentBackgroundInfo.gameObject);
        }

        if (setPrefab != null)
        {
            GameObject obj = NgAsset.LoadPrefab(setPrefab, m_CurrentBackgroundRoot);
            obj.name = obj.name.Replace("(Clone)", "(Original)");
            m_CurrentBackgroundInfo = obj.GetComponent <FxmInfoBackground>();
            m_CurrentBackgroundInfo.SetActive();
            if (FXMakerMain.inst.IsLoadingProject() == false)
            {
                FXMakerAsset.SetPingObject(setPrefab, m_CurrentBackgroundInfo);
            }

            FXMakerMain.inst.GetFXMakerMouse().UpdateCamera();
        }
    }
Beispiel #10
0
    void PingPrefab()
    {
//		if (IsLoadingProject() == false)
//			if (Input.GetMouseButtonUp(1))
        FXMakerAsset.SetPingObject(FXMakerMain.inst.GetOriginalEffectPrefab());
    }
 void PingPrefab()
 {
     FXMakerAsset.SetPingObject(m_BackgroundPrefabs[m_nBackgroundIndex]);
 }
    // ----------------------------------------------------------------------------------------------------------
    protected override void SetActiveObject(int nObjectIndex)
    {
        if (nObjectIndex < 0 || m_nObjectCount <= nObjectIndex)
        {
            return;
        }

        bool       bAppend   = false;
        GameObject selPrefab = GetObjectNodePrefab(nObjectIndex);

        // right button, image Ping and not select
        if (Input.GetMouseButtonUp(1))
        {
            if (m_bDialogType == DIALOG_TYPE.ADD && FXMakerOption.inst.m_PrefabDlg_RightClick == FXMakerOption.DLG_RIGHTCLICK.APPEND)
            {
                bAppend = true;
            }
            else
            {
//	            if (m_bDialogType == DIALOG_TYPE.SELECT == false)
                FXMakerAsset.SetPingObject(selPrefab);
                return;
            }
        }

        // 같은것 재클릭
        if (m_nObjectIndex == nObjectIndex)
        {
//			if (m_bDialogType != DIALOG_TYPE.SELECT)
            FXMakerAsset.SetPingObject(m_AddGameObject);
            FXMakerMain.inst.CreateCurrentInstanceEffect(true);
            return;
        }

        if (m_bDialogType == DIALOG_TYPE.SELECT)
        {
            m_AddPrefabObject = selPrefab;
            m_AddGameObject   = selPrefab;

            if (m_bSelectMeshDialog)
            {
                MeshFilter meshFilter = m_AddPrefabObject.GetComponent <MeshFilter>();
                if (meshFilter != null && meshFilter.sharedMesh != null)
                {
                    NgSerialized.SetMesh(m_SelectMeshComponent, meshFilter.sharedMesh, true);
                    FXMakerHierarchy.inst.UpdateMeshList();
                }
            }
            else
            {
                SetAttachPrefab(selPrefab);
            }
            FXMakerMain.inst.CreateCurrentInstanceEffect(true);
        }
        else
        {
            if (bAppend == false)
            {
                // 기존것 삭제
                if (m_AddGameObject != null)
                {
                    m_AddGameObjectList.Remove(m_AddGameObject);
                    DestroyImmediate(m_AddGameObject);
                    m_AddGameObject = null;
                }
            }

            // create
            m_AddPrefabObject = selPrefab;
            m_AddGameObject   = FXMakerHierarchy.inst.AddGameObject(m_SelectedTransform.gameObject, selPrefab);
            m_AddGameObjectList.Insert(0, m_AddGameObject);

            if (FXMakerHierarchy.inst.SetActiveGameObject(m_AddGameObject) == false)
            {
                FXMakerMain.inst.CreateCurrentInstanceEffect(true);
            }
        }

        m_nObjectIndex           = nObjectIndex;
        m_nSelObjectProjectIndex = m_nProjectIndex;
        m_nSelObjectGroupIndex   = (m_bOptionRecursively ? -1 : m_nGroupIndex);
        m_SelObjectContent       = new GUIContent(m_ObjectContents[nObjectIndex].text, m_ObjectContents[nObjectIndex].image, m_ObjectContents[nObjectIndex].tooltip);
    }
    // ==========================================================================================================
    protected override void DrawBottomRect(Rect baseRect)
    {
        GUI.Box(baseRect, "");

        GUIContent guiCon;
        Rect       imageRect = baseRect;

        imageRect.width = FXMakerLayout.GetFixedWindowWidth();
        Rect rightRect = baseRect;

        rightRect.x     += imageRect.width;
        rightRect.width -= imageRect.width;
        rightRect        = FXMakerLayout.GetOffsetRect(rightRect, 5, 3, -5, -3);

        Rect buttonRect = FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 0, 5);

        if (m_bSaveDialog)
        {
            Rect labelRect = FXMakerLayout.GetInnerVerticalRect(baseRect, 12, 2, 3);
            GUI.Label(FXMakerLayout.GetLeftRect(labelRect, 100), "Filename:");
            Rect   editRect     = FXMakerLayout.GetInnerVerticalRect(baseRect, 12, 5, 5);
            string saveFilename = GUI.TextField(editRect, m_SaveFilename, 50);
            if (saveFilename != m_SaveFilename)
            {
                if (saveFilename.Trim() != "")
                {
                    m_SaveFilename = saveFilename;
                }
            }
        }
        else
        {
            bool bPreviewEnable = false;
            // image
            if (m_SelObjectContent == null)
            {
                guiCon = new GUIContent("[Not Selected]");
                // original mesh preview
                if (m_bDialogType == DIALOG_TYPE.SELECT && m_bSelectMeshDialog && m_OldSelectMesh != null)
                {
                    Texture2D preview = NgAsset.GetAssetPreview(m_OldSelectMesh);
                    guiCon         = new GUIContent(m_OldSelectMesh.name, preview, GetMeshInfo(m_OldSelectMesh));
                    bPreviewEnable = true;
                }
            }
            else
            {
                guiCon         = new GUIContent("", m_SelObjectContent.image, m_SelObjectContent.tooltip);
                bPreviewEnable = (m_SelObjectContent != null);
            }

            if (FXMakerLayout.GUIButton(imageRect, guiCon, GUI.skin.GetStyle("PopupBottom_ImageButton"), bPreviewEnable))
            {
                if (m_bDialogType == DIALOG_TYPE.SELECT)
                {
                    if (m_bSelectMeshDialog)
                    {
                        Object pingObj;
                        Object pingMesh;
                        if (m_AddPrefabObject != null)
                        {
                            pingObj  = m_AddPrefabObject;
                            pingMesh = m_AddPrefabObject.GetComponent <MeshFilter>().sharedMesh;
                        }
                        else
                        {
                            pingObj  = m_OldSelectMesh;
                            pingMesh = m_OldSelectMesh;
                        }

                        if (Input.GetMouseButtonUp(0))
                        {
                            FXMakerAsset.SetPingObject(pingObj);
                            FXMakerMain.inst.CreateCurrentInstanceEffect(true);
                        }
                        if (Input.GetMouseButtonUp(1))
                        {
                            FXMakerAsset.SetPingObject(pingMesh);
                        }
                    }
                    else
                    {
                        FXMakerMain.inst.CreateCurrentInstanceEffect(true);
                    }
                }
                else
                {
                    if (Input.GetMouseButtonUp(0))
                    {
                        FXMakerAsset.SetPingObject(m_AddGameObject);
                        FXMakerMain.inst.CreateCurrentInstanceEffect(true);
                    }
                    if (Input.GetMouseButtonUp(1))
                    {
                        FXMakerAsset.SetPingObject(GetObjectNodePrefab(m_nObjectIndex));
                    }
                }
            }

            // text
            GUI.Label(FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 5, 8), (m_SelObjectContent == null ? "[Not Selected]" : m_SelObjectContent.text));
        }

        if (m_bSaveDialog)
        {
            bool bSaveEnable    = (0 <= m_nGroupIndex && 0 < m_nGroupCount);
            bool bReadOnyFolder = false;

            if (bSaveEnable)
            {
                bReadOnyFolder = 0 < IsReadOnlyFolder();
                bSaveEnable    = !bReadOnyFolder;
            }

            // Cancel
            if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(buttonRect, 2, 0, 1), GetHelpContent("Cancel"), true))
            {
                ClosePopup(false);
                return;
            }
            // save
            if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(buttonRect, 2, 1, 1), (bReadOnyFolder ? FXMakerTooltip.GetGUIContent("Save", FXMakerTooltip.GetHsToolMessage("READONLY_FOLDER", "")) : GetHelpContent("Save")), bSaveEnable))
            {
                SaveCurrentObjectToPrefabFile();
                ClosePopup(true);
//              FXMakerEffect.inst.LoadProject();
            }
            if (m_bDrawRedBottomButtom)
            {
                NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(buttonRect, 3), FXMakerLayout.m_ColorHelpBox, (bSaveEnable ? 2:1), false);
            }
            if (m_bDrawRedBottom)
            {
                NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(baseRect, 2), FXMakerLayout.m_ColorHelpBox, (bSaveEnable ? 2:1), false);
            }
        }
        else
        {
            // Undo
            int nButtonWidht = 70;
            buttonRect.width = nButtonWidht / 2;
            if (FXMakerLayout.GUIButton(buttonRect, GetHelpContent("Undo"), (m_AddGameObject != null)))
            {
                UndoObject();
            }

            // close
            buttonRect.x    += buttonRect.width + 5;
            buttonRect.width = baseRect.width - buttonRect.x;
            if (GUI.Button(buttonRect, GetHelpContent("Close")))
            {
                ClosePopup(true);
            }
        }
    }
Beispiel #14
0
    void DrawBottomMenuRect(Rect baseRect)
    {
        GUI.Box(baseRect, "");

        Rect imageRect = baseRect;

        imageRect.width = m_nOriginalBottomHeight - 1;
        Rect rightRect = baseRect;

        rightRect.x     += imageRect.width;
        rightRect.width -= imageRect.width;
        rightRect        = FXMakerLayout.GetOffsetRect(rightRect, 5, 3, -5, -3);

        Rect buttonRect   = FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 0, 5);
        int  nButtonWidht = 70;

        buttonRect.width = nButtonWidht / 2;

        if (m_SelectedMaterial != null && m_SelObjectContent != null)
        {
            // image
            if (GUI.Button(imageRect, new GUIContent("", m_SelObjectContent.image, m_SelObjectContent.tooltip), GUI.skin.GetStyle("PopupBottom_ImageButton")))
            {
                if (Input.GetMouseButtonUp(0))
                {
                    if (0 <= m_nNewShaderMaterialIndex)
                    {
                        FXMakerAsset.SetPingObject(m_SelectedTransform.gameObject);
                    }
                    else
                    {
                        FXMakerAsset.SetPingObject(m_SelectedMaterial);
                    }
                    FXMakerMain.inst.CreateCurrentInstanceEffect(true);
                }
                if (Input.GetMouseButtonUp(1))
                {
                    FXMakerAsset.SetPingObject(m_SelObjectContent.image);
                }
            }

            // Current Color
            Color matColor  = NgMaterial.GetMaterialColor(m_SelectedMaterial);
            Rect  colorRect = FXMakerLayout.GetOffsetRect(FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 5, 7), 0, 2, 0, 0);
            colorRect.width = nButtonWidht / 2;
            if (NgMaterial.IsMaterialColor(m_SelectedMaterial))
            {
                EditorGUIUtility.DrawColorSwatch(colorRect, matColor);
            }

            // text
            rightRect.x     += colorRect.width;
            rightRect.width -= colorRect.width;
            GUI.Label(FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 5, 3), m_SelObjectContent.text);
            GUI.Label(FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 7, 5), (m_SelectedMaterial.shader != null ? m_SelectedMaterial.shader.name : "[Not Selected]"));


            bool bChange = (NgMaterial.IsSameMaterial(m_SelectedMaterial, m_OriMaterial, true) == false);
            // Undo
            if (FXMakerLayout.GUIButton(buttonRect, GetHelpContent("Undo"), bChange))
            {
                UndoObject();
                return;
            }

            // UniqueSave
            buttonRect.x    += buttonRect.width + 5;
            buttonRect.width = nButtonWidht;
            if (FXMakerLayout.GUIButton(buttonRect, GetHelpContent("UniqueSave"), bChange))
            {
                m_bUniqueSave = true;
                ClosePopup(true);
                return;
            }
        }

        // close
        buttonRect.x    += buttonRect.width + 5;
        buttonRect.width = baseRect.width - buttonRect.x;
        if (GUI.Button(buttonRect, GetHelpContent("Close")))
        {
            ClosePopup(true);
        }

        // ���õȰ�, ������, ��ġ, ȸ��, ����, �ݱ�, ���
    }
Beispiel #15
0
    void DrawBottomMaterialRect(Rect baseRect)
    {
        int      nVMargin    = 4;
        GUIStyle styleBox    = GUI.skin.GetStyle("MaterialList_Box");
        GUIStyle styleButton = GUI.skin.GetStyle("ImageOnly_Button");

        // Draw line
        NgGUIDraw.DrawHorizontalLine(new Vector2(baseRect.x + nVMargin, baseRect.y + nVMargin), (int)baseRect.width, new Color(0.1f, 0.1f, 0.1f, 0.7f), 2, false);

        baseRect = FXMakerLayout.GetOffsetRect(baseRect, 0, nVMargin * 2, 0, -nVMargin);
        int  nObjectCount;
        Rect listRect;
        int  nColumn;
        Rect scrollRect;
        Rect gridRect;
        int  nSelectIndex;
        bool bShowList = true;                          // (0 <= m_nObjectIndex && m_nSelObjectProjectIndex == m_nProjectIndex && m_nGroupIndex == m_nSelObjectGroupIndex);

        // New Shader Material List ------------------------------------------------------
        listRect = FXMakerLayout.GetInnerHorizontalRect(baseRect, 2, 0, 1);
        GUI.Box(listRect, GetHelpContent("New Shader Material"), styleBox);

        if (bShowList && m_NewShaderMaterials != null && 0 < m_NewShaderMaterials.Length)
        {
            listRect     = FXMakerLayout.GetOffsetRect(listRect, 5, 15, -5, -3);
            nColumn      = (int)((listRect.width - 5) / listRect.height * 2.3f);
            nObjectCount = m_NewShaderMaterials.Length;
            scrollRect   = FXMakerLayout.GetAspectScrollViewRect((int)listRect.width, m_fButtonAspect, nObjectCount, nColumn, true);
            gridRect     = FXMakerLayout.GetAspectScrollGridRect((int)listRect.width, m_fButtonAspect, nObjectCount, nColumn, true);

            m_NewShaderMaterialListScrollPos = GUI.BeginScrollView(listRect, m_NewShaderMaterialListScrollPos, scrollRect);
//			nSelectIndex	= GUI.SelectionGrid(gridRect, m_nNewShaderMaterialIndex, m_NewShaderMaterialContents, nColumn, styleButton);
            nSelectIndex = FXMakerLayout.TooltipSelectionGrid(FXMakerLayout.GetOffsetRect(GetPopupRect(), 0, -m_NewShaderMaterialListScrollPos.y), listRect, gridRect, m_nNewShaderMaterialIndex, m_NewShaderMaterialContents, nColumn, styleButton);

            if (m_nNewShaderMaterialIndex != nSelectIndex)
            {
                if (Input.GetMouseButtonUp(1))
                {
                    FXMakerAsset.SetPingObject(m_NewShaderMaterials[nSelectIndex]);
                }
                else
                {
                    m_nNewShaderMaterialIndex = nSelectIndex;
                    if (m_SelectedMaterial != null)
                    {
                        NgMaterial.CopyMaterialArgument(m_SelectedMaterial, m_NewShaderMaterials[nSelectIndex]);
                    }
                    SetActiveMaterial(m_NewShaderMaterials[nSelectIndex], null, true, false);
                }
            }
            GUI.EndScrollView();
        }

        // Found Material List ------------------------------------------------------
        listRect = FXMakerLayout.GetInnerHorizontalRect(baseRect, 2, 1, 1);
        GUI.Box(listRect, GetHelpContent("Found Material"), styleBox);

        if (bShowList && m_CurrentTextureMaterials != null && 0 < m_CurrentTextureMaterials.Length)
        {
            listRect     = FXMakerLayout.GetOffsetRect(listRect, 5, 15, -5, -3);
            nColumn      = (int)((listRect.width - 5) / listRect.height * 2.3f);
            nObjectCount = m_CurrentTextureMaterials.Length;
            scrollRect   = FXMakerLayout.GetAspectScrollViewRect((int)listRect.width, m_fButtonAspect, nObjectCount, nColumn, true);
            gridRect     = FXMakerLayout.GetAspectScrollGridRect((int)listRect.width, m_fButtonAspect, nObjectCount, nColumn, true);

            m_CurrentTextureMaterialListScrollPos = GUI.BeginScrollView(listRect, m_CurrentTextureMaterialListScrollPos, scrollRect);
//			nSelectIndex	= GUI.SelectionGrid(gridRect, m_nCurrentTextureMaterialIndex, m_CurrentTextureMaterialContents, nColumn, styleButton);
            nSelectIndex = FXMakerLayout.TooltipSelectionGrid(FXMakerLayout.GetOffsetRect(GetPopupRect(), 0, -m_CurrentTextureMaterialListScrollPos.y), listRect, gridRect, m_nCurrentTextureMaterialIndex, m_CurrentTextureMaterialContents, nColumn, styleButton);

            if (m_nCurrentTextureMaterialIndex != nSelectIndex)
            {
                if (Input.GetMouseButtonUp(1))
                {
                    FXMakerAsset.SetPingObject(m_NewShaderMaterials[nSelectIndex]);
                }
                else
                {
                    m_nCurrentTextureMaterialIndex = nSelectIndex;
                    SetActiveMaterial(m_CurrentTextureMaterials[nSelectIndex], null, false, false);
                }
            }
            GUI.EndScrollView();
        }
    }
    // ==========================================================================================================
    protected override void DrawBottomRect(Rect baseRect)
    {
        GUI.Box(baseRect, "");

        GUIContent guiCon;
        Rect       imageRect = baseRect;

        imageRect.width = FXMakerLayout.GetFixedWindowWidth();
        Rect rightRect = baseRect;

        rightRect.x     += imageRect.width;
        rightRect.width -= imageRect.width;
        rightRect        = FXMakerLayout.GetOffsetRect(rightRect, 5, 3, -5, -3);

        Rect buttonRect = FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 0, 5);

        if (m_bSaveDialog)
        {
            Rect labelRect = FXMakerLayout.GetInnerVerticalRect(baseRect, 12, 2, 3);
            GUI.Label(FXMakerLayout.GetLeftRect(labelRect, 100), "Filename:");
            Rect   editRect     = FXMakerLayout.GetInnerVerticalRect(baseRect, 12, 5, 5);
            string saveFilename = GUI.TextField(editRect, m_SaveFilename, 50);
            if (saveFilename != m_SaveFilename)
            {
                if (saveFilename.Trim() != "")
                {
                    m_SaveFilename = saveFilename;
                }
            }
        }
        else
        {
            // image
            if (m_SelObjectContent == null)
            {
                guiCon = new GUIContent("[Not Selected]");
            }
            else
            {
                guiCon = new GUIContent("", m_SelObjectContent.image, m_SelObjectContent.tooltip);
            }
            if (FXMakerLayout.GUIButton(imageRect, guiCon, GUI.skin.GetStyle("PopupBottom_ImageButton"), (m_SelObjectContent != null)))
            {
                if (Input.GetMouseButtonUp(0))
                {
                    FXMakerAsset.SetPingObject(m_CurrentCurveAnimation);
                    FXMakerMain.inst.CreateCurrentInstanceEffect(true);
                }
                if (Input.GetMouseButtonUp(1))
                {
                    FXMakerAsset.SetPingObject(m_CurveAniObjects[m_nObjectIndex]);
                }
            }

            // text
            GUI.Label(FXMakerLayout.GetInnerVerticalRect(rightRect, 12, 5, 8), (m_SelObjectContent == null ? "[Not Selected]" : m_SelObjectContent.text));
        }

        if (m_bSaveDialog)
        {
            bool bSaveEnable    = (0 <= m_nGroupIndex && 0 < m_nGroupCount);
            bool bReadOnyFolder = false;

            if (bSaveEnable)
            {
                bReadOnyFolder = 0 < IsReadOnlyFolder();
                bSaveEnable    = !bReadOnyFolder;
            }

            // Cancel
            if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(buttonRect, 2, 0, 1), GetHelpContent("Cancel"), true))
            {
                ClosePopup(false);
                return;
            }
            // save
            if (FXMakerLayout.GUIButton(FXMakerLayout.GetInnerHorizontalRect(buttonRect, 2, 1, 1), (bReadOnyFolder ? FXMakerTooltip.GetGUIContent("Save", FXMakerTooltip.GetHsToolMessage("READONLY_FOLDER", "")) : GetHelpContent("Save")), bSaveEnable))
            {
                SaveCurveAniToPrefabFile();
                ClosePopup(true);
//              FXMakerEffect.inst.LoadProject();
            }
            if (m_bDrawRedBottomButtom)
            {
                NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(buttonRect, 3), FXMakerLayout.m_ColorHelpBox, (bSaveEnable ? 2:1), false);
            }
            if (m_bDrawRedBottom)
            {
                NgGUIDraw.DrawBox(FXMakerLayout.GetOffsetRect(baseRect, 2), FXMakerLayout.m_ColorHelpBox, (bSaveEnable ? 2:1), false);
            }
        }
        else
        {
            // Undo
            int nButtonWidht = 70;
            buttonRect.width = nButtonWidht / 2;
            if (FXMakerLayout.GUIButton(buttonRect, GetHelpContent("Undo"), (m_SelCurveAniObject != null)))
            {
                UndoCurveAni();
                m_nObjectIndex           = -1;
                m_nSelObjectGroupIndex   = -1;
                m_nSelObjectProjectIndex = -1;
                m_SelObjectContent       = null;
                m_SelCurveAniObject      = null;

                FXMakerMain.inst.CreateCurrentInstanceEffect(true);
            }

            // close
            buttonRect.x    += buttonRect.width + 5;
            buttonRect.width = baseRect.width - buttonRect.x;
            if (GUI.Button(buttonRect, GetHelpContent("Close")))
            {
                ClosePopup(true);
            }
        }
    }