예제 #1
0
    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();
    }
예제 #2
0
 public void ClearAtlas(ref UIAtlas target)
 {
     if (target == null)
     {
         return;
     }
     SetResource(target.GetInstanceID(), null, typeof(UIAtlas));
     target = null;
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
 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);
 }
예제 #6
0
 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();
 }
예제 #7
0
    /// <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);
    }
예제 #8
0
    /// <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;
    }