static void Save() { EditorPrefs.SetString("NGUI Partial", mPartial); EditorPrefs.SetString("NGUI Font Name", mFontName); EditorPrefs.SetString("NGUI Atlas Name", mAtlasName); EditorPrefs.SetString("NGUI Selected Sprite", mSpriteName); EditorPrefs.SetInt("NGUI Font Asset", (mFontData != null) ? mFontData.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font Texture", (mFontTexture != null) ? mFontTexture.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font", (mBitFont != null) ? mBitFont.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Atlas", (mAtlas != null) ? mAtlas.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Atlas Padding", mAtlasPadding); EditorPrefs.SetBool("NGUI Atlas Trimming", mAtlasTrimming); EditorPrefs.SetBool("NGUI Atlas PMA", mAtlasPMA); EditorPrefs.SetBool("NGUI Unity Packing", mUnityPacking); EditorPrefs.SetBool("NGUI Force Square Atlas", mForceSquare); EditorPrefs.SetInt("NGUI Pivot", (int)mPivot); EditorPrefs.SetInt("NGUI Layer", mLayer); EditorPrefs.SetInt("NGUI DynFont", (mDynFont != null) ? mDynFont.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI DynFontStyle", (int)mDynFontStyle); EditorPrefs.SetInt("NGUI Color Mode", (int)mColorMode); EditorPrefs.SetBool("NGUI All DCs", mAllDCs); EditorPrefs.SetInt("NGUI Font Size", mFontSize); SaveColor(); }
public void ClearAtlas(ref UIAtlas target) { if (target == null) { return; } SetResource(target.GetInstanceID(), null, typeof(UIAtlas)); target = null; }
static void Save() { PlayerPrefs.SetString("NGUI Font Name", mFontName); PlayerPrefs.SetString("NGUI Atlas Name", mAtlasName); PlayerPrefs.SetInt("NGUI Font Asset", (mFontData != null) ? mFontData.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Font Texture", (mFontTexture != null) ? mFontTexture.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Font", (mFont != null) ? mFont.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Atlas", (mAtlas != null) ? mAtlas.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Preview", mPreview ? 0 : 1); }
private static void Save() { EditorPrefs.SetString("NGUI Font Name", mFontName); EditorPrefs.SetString("NGUI Atlas Name", mAtlasName); EditorPrefs.SetInt("NGUI Font Asset", (mFontData != null) ? mFontData.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font Texture", (mFontTexture != null) ? mFontTexture.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font", (mFont != null) ? mFont.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Atlas", (mAtlas != null) ? mAtlas.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Preview", mPreview ? 0 : 1); EditorPrefs.SetInt("NGUI Atlas Padding", mAtlasPadding); EditorPrefs.SetBool("NGUI Atlas Trimming", mAtlasTrimming); }
static void Save() { PlayerPrefs.SetString("NGUI Font Name", mFontName); PlayerPrefs.SetString("NGUI Atlas Name", mAtlasName); PlayerPrefs.SetInt("NGUI Font Asset", (mFontData != null) ? mFontData.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Font Texture", (mFontTexture != null) ? mFontTexture.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Atlas", (mAtlas != null) ? mAtlas.GetInstanceID() : -1); PlayerPrefs.SetInt("NGUI Preview", mPreview ? 0 : 1); EditorPrefs.SetBool("NGUI Unity Packing", mUnityPacking); EditorPrefs.SetInt("NGUI Atlas Padding", mAtlasPadding); EditorPrefs.SetBool("NGUI Atlas Trimming", mAtlasTrimming); EditorPrefs.SetString("NGUI Partial", mPartial); EditorPrefs.SetInt("NGUI Pivot", (int)mPivot); }
static void Save() { EditorPrefs.SetString("NGUI Partial", mPartial); EditorPrefs.SetString("NGUI Font Name", mFontName); EditorPrefs.SetString("NGUI Atlas Name", mAtlasName); EditorPrefs.SetInt("NGUI Font Asset", (mFontData != null) ? mFontData.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font Texture", (mFontTexture != null) ? mFontTexture.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Font", (mFont != null) ? mFont.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Atlas", (mAtlas != null) ? mAtlas.GetInstanceID() : -1); EditorPrefs.SetInt("NGUI Atlas Padding", mAtlasPadding); EditorPrefs.SetBool("NGUI Atlas Trimming", mAtlasTrimming); EditorPrefs.SetBool("NGUI Unity Packing", mUnityPacking); EditorPrefs.SetBool("NGUI Force Square Atlas", mForceSquare); EditorPrefs.SetInt("NGUI Pivot", (int)mPivot); EditorPrefs.SetInt("NGUI Layer", mLayer); SaveColor(); }
/// <summary> /// Figures out the saveable filename for the texture of the specified atlas. /// </summary> static public string GetSaveableTexturePath(UIAtlas atlas) { // Path where the texture atlas will be saved string path = ""; // If the atlas already has a texture, overwrite its texture if (atlas.texture != null) { path = AssetDatabase.GetAssetPath(atlas.texture.GetInstanceID()); if (!string.IsNullOrEmpty(path)) { int dot = path.LastIndexOf('.'); return(path.Substring(0, dot) + ".png"); } } // No texture to use -- figure out a name using the atlas path = AssetDatabase.GetAssetPath(atlas.GetInstanceID()); path = string.IsNullOrEmpty(path) ? "Assets/" + atlas.name + ".png" : path.Replace(".prefab", ".png"); return(path); }
/// <summary> /// Figures out the saveable filename for the texture of the specified atlas. /// </summary> public static string GetSaveableTexturePath(UIAtlas atlas) { // Path where the texture atlas will be saved string path = ""; // If the atlas already has a texture, overwrite its texture if (atlas.texture != null) { path = AssetDatabase.GetAssetPath(atlas.texture.GetInstanceID()); if (!string.IsNullOrEmpty(path)) { int dot = path.LastIndexOf('.'); return path.Substring(0, dot) + ".png"; } } // No texture to use -- figure out a name using the atlas path = AssetDatabase.GetAssetPath(atlas.GetInstanceID()); path = string.IsNullOrEmpty(path) ? "Assets/" + atlas.name + ".png" : path.Replace(".prefab", ".png"); return path; }