void NewPrefab(NEW_TYPE newType) { SaveProject(); GameObject newPrefab; switch (newType) { case NEW_TYPE.NEW_EMPTY: newPrefab = m_DefaultEmptyPrefab; break; case NEW_TYPE.NEW_PLANE: newPrefab = m_DefaultPlanePrefab; break; case NEW_TYPE.NEW_LEGACY: newPrefab = m_DefaultLegacyPrefab; break; case NEW_TYPE.NEW_SHURIKEN: newPrefab = m_DefaultShurikenPrefab; break; default: { NgUtil.LogMessage("NEW_TYPE error !!!"); return; } } string createPath = NgAsset.CreateDefaultUniquePrefab(newPrefab, GetCurrentDirPath() + "NewEffect.prefab"); SetChangePrefab(); SaveProject(); SelectToolbar(m_nProjectIndex, GetGroupIndex(), createPath); }
void NewPrefab() { SaveProject(); string createPath = NgAsset.CreateDefaultUniquePrefab(m_DefaultEffectPrefab, GetCurrentDirPath() + "NewEffect.prefab"); SetChangePrefab(); SaveProject(); SelectToolbar(m_nProjectIndex, GetGroupIndex(), createPath); }
void NewPrefab() { if (m_bGroupFoler == false || m_GroupFolerContents[m_nGroupIndex].text != "") { SaveProject(); if (m_CurrentBackgroundInfo != null) { DestroyImmediate(m_CurrentBackgroundInfo.gameObject); } string createPath = NgAsset.CreateDefaultUniquePrefab(m_DefaultBackgroundPrefab, NgFile.CombinePath(FXMakerMain.inst.GetResourceDir(FXMakerMain.TOOLDIR_TYPE.BACKGROUNDPREFABS), NgFile.CombinePath(m_GroupFolerContents[m_nGroupIndex].text, "NewBackground.prefab"))); SaveProject(); SelectToolbar(m_nGroupIndex, createPath); } }
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(); }
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(); }