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(); }
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); }
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(); }
void ResizePrefab(string assetPath) { GameObject loadPrefab = NgAsset.LoadPrefab(assetPath); loadPrefab.transform.localScale *= m_fScale; AssetDatabase.SaveAssets(); AssetDatabase.SaveAssets(); }
void CreatePrefab(NgAsset.ObjectNode modelNode) { string targetPath = NgFile.CombinePath("Assets/" + m_tarPrefabPath, NgFile.GetFilename(modelNode.m_AssetPath) + ".prefab"); GameObject loadPrefab = NgAsset.LoadPrefab(targetPath); if (loadPrefab != null) { // 있으면 pass return; } PrefabUtility.CreatePrefab(targetPath, (GameObject)modelNode.m_Object); AssetDatabase.SaveAssets(); AssetDatabase.SaveAssets(); }
void SaveCurrentObjectToPrefabFile() { if (m_nProjectIndex < 0) return; if (FXMakerEffect.inst.m_DefaultEmptyPrefab == null) { Debug.LogError("FXMakerMain.m_DefaultEmptyPrefab is null"); return; } string dstPath = NgFile.CombinePath(m_LoadDirectory, m_SaveFilename + ".prefab"); dstPath = NgAsset.CreateDefaultUniquePrefab(FXMakerEffect.inst.m_DefaultEmptyPrefab, dstPath); GameObject newPrefab = NgAsset.LoadPrefab(dstPath); PrefabUtility.ReplacePrefab(m_SelectedTransform.gameObject, newPrefab); FXMakerAsset.AssetDatabaseSaveAssets(); }
public void ShowBackground(bool bShow) { for (int nIndex = 0; nIndex < m_ReferenceObjects.Length; nIndex++) { int nChildIndex = FXMakerBackground.m_CloneTypeCount + nIndex; // 기존 것 삭제 if (m_ChildObjects[nChildIndex] != null) { Object.DestroyImmediate(m_ChildObjects[nChildIndex]); m_ChildObjects[nChildIndex] = null; } if (bShow && m_ReferenceObjects[nIndex] != null) { m_ChildObjects[nChildIndex] = NgAsset.LoadPrefab(m_ReferenceObjects[nIndex], gameObject); m_ChildObjects[nChildIndex].name = m_ChildObjects[nChildIndex].name.Replace("(Clone)", ""); NgObject.SetActiveRecursively(m_ChildObjects[nChildIndex], true); } } }
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(); } }
void SaveCurveAniToPrefabFile() { if (m_nProjectIndex < 0) { return; } if (m_DefaultSavePrefab == null) { Debug.LogError("FxmFolderPopup_NcCurveAnimation.m_DefaultSavePrefab is null"); return; } string dstPath = NgFile.CombinePath(m_LoadDirectory, m_NcCurveAni_FileKeyword + m_SaveFilename + ".prefab"); dstPath = NgAsset.CreateDefaultUniquePrefab(m_DefaultSavePrefab, dstPath); GameObject newPrefab = NgAsset.LoadPrefab(dstPath); NcCurveAnimation newCom = newPrefab.AddComponent <NcCurveAnimation>(); m_CurrentCurveAnimation.CopyTo(newCom, false); FXMakerAsset.AssetDatabaseSaveAssets(); }