C# Class SimpleSpritePackerEditor.SPTools

Datei anzeigen Open project: sunduk/freegostop Class Usage Examples

Public Properties

Property Type Description
Settings_AllowMuliSpritesOneSource string
Settings_DisableReadWriteEnabled string
Settings_SavedInstanceIDKey string
Settings_ScrollViewHeightKey string
Settings_ShowSpritesKey string
Settings_ThumbsHeightKey string
Settings_UseScrollViewKey string
Settings_UseSpriteThumbsKey string

Public Methods

Method Description
AssetSetFormat ( string path, TextureImporterFormat format ) : bool

Sets the asset texture format.

AssetSetReadWriteEnabled ( string path, bool enabled, bool force ) : bool

Sets the asset Read/Write enabled state.

CreateBlankTexture ( string path, bool alphaTransparency ) : bool

Creates a blank atlas texture.

DoAssetReimport ( string path, ImportAssetOptions options ) : void

Does asset reimport.

FilterResourcesForAtlasImport ( Object resources ) : Object[]

Filters the resources for atlas import.

GetAllScenesNames ( ) : string[]

Gets all scenes names.

GetAssetPath ( Object obj ) : string

Gets the asset path of a object.

GetAssetPath ( Texture2D texture ) : string

Gets the asset path of a texture.

GetDirectoryAssets ( string path ) : Object[]

Gets the assets in the specified directory.

GetEditorPrefBool ( string key ) : bool

Gets the editor preference bool value with the specified key.

GetProjectPrefabComponents ( ) : UnityEngine.Component[]
GetSubAssets ( Object obj ) : Object[]

Gets the sub assets of an object.

HasSubAssets ( Object obj ) : bool

Determines if the specified object has sub assets.

ImportAndConfigureAtlasTexture ( Texture2D targetTexture, Texture2D sourceTexture, Rect uvs, SimpleSpritePackerEditor.SPSpriteImportData spritesImportData ) : bool

Imports and configures atlas texture.

ImportTexture ( string path, Texture2D texture ) : bool

Imports a texture as asset.

IsDirectory ( string path ) : bool

Determines if the specified path is directory.

IsMainAsset ( Object obj ) : bool

Determines if the specified object is main asset.

LoadSprite ( Texture2D mainTexture, string name ) : Sprite

Loads a sprite from a texture.

PrepareDefaultEditorPrefs ( ) : void

Prepares the default editor preference values.

RemoveReadOnlyFlag ( string path ) : bool

Removes the read only flag from the asset.

ReplaceReferences ( Component components, Sprite find, Sprite replaceWith, bool spriteRenderersOnly ) : int

Replaces all the references in the supplied array (does not work with internal properties).

ReplaceReferencesInAllScenes ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly, bool skipCurrent ) : int

Replaces all the references in all scenes.

ReplaceReferencesInProject ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly ) : int

Replaces all the references in the project (does not work with internal properties).

ReplaceReferencesInScene ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly ) : int

Replaces all the references in the scene (does not work with internal properties).

TextureSetReadWriteEnabled ( Texture2D texture, bool enabled, bool force ) : bool

Sets the texture asset Read/Write enabled state.

Private Methods

Method Description
GetSpritesheetMeta ( SpriteMetaData collection, string name ) : SpriteMetaData

Gets the spritesheet meta data for the specified name.

HasSpritesheetMeta ( SpriteMetaData collection, string name ) : bool

Determines if the specified name has spritesheet meta data.

Method Details

AssetSetFormat() public static method

Sets the asset texture format.
public static AssetSetFormat ( string path, TextureImporterFormat format ) : bool
path string Path.
format TextureImporterFormat Format.
return bool

AssetSetReadWriteEnabled() public static method

Sets the asset Read/Write enabled state.
public static AssetSetReadWriteEnabled ( string path, bool enabled, bool force ) : bool
path string Path.
enabled bool If set to true enabled.
force bool If set to true force.
return bool

CreateBlankTexture() public static method

Creates a blank atlas texture.
public static CreateBlankTexture ( string path, bool alphaTransparency ) : bool
path string Asset Path.
alphaTransparency bool If set to true alpha transparency.
return bool

DoAssetReimport() public static method

Does asset reimport.
public static DoAssetReimport ( string path, ImportAssetOptions options ) : void
path string Path.
options ImportAssetOptions Options.
return void

FilterResourcesForAtlasImport() public static method

Filters the resources for atlas import.
public static FilterResourcesForAtlasImport ( Object resources ) : Object[]
resources Object Resources.
return Object[]

GetAllScenesNames() public static method

Gets all scenes names.
public static GetAllScenesNames ( ) : string[]
return string[]

GetAssetPath() public static method

Gets the asset path of a object.
public static GetAssetPath ( Object obj ) : string
obj Object Object.
return string

GetAssetPath() public static method

Gets the asset path of a texture.
public static GetAssetPath ( Texture2D texture ) : string
texture UnityEngine.Texture2D Texture.
return string

GetDirectoryAssets() public static method

Gets the assets in the specified directory.
public static GetDirectoryAssets ( string path ) : Object[]
path string Path.
return Object[]

GetEditorPrefBool() public static method

Gets the editor preference bool value with the specified key.
public static GetEditorPrefBool ( string key ) : bool
key string Key.
return bool

GetProjectPrefabComponents() public static method

public static GetProjectPrefabComponents ( ) : UnityEngine.Component[]
return UnityEngine.Component[]

GetSubAssets() public static method

Gets the sub assets of an object.
public static GetSubAssets ( Object obj ) : Object[]
obj Object Object.
return Object[]

HasSubAssets() public static method

Determines if the specified object has sub assets.
public static HasSubAssets ( Object obj ) : bool
obj Object Object.
return bool

ImportAndConfigureAtlasTexture() public static method

Imports and configures atlas texture.
public static ImportAndConfigureAtlasTexture ( Texture2D targetTexture, Texture2D sourceTexture, Rect uvs, SimpleSpritePackerEditor.SPSpriteImportData spritesImportData ) : bool
targetTexture UnityEngine.Texture2D Target texture.
sourceTexture UnityEngine.Texture2D Source texture.
uvs UnityEngine.Rect Uvs.
spritesImportData SimpleSpritePackerEditor.SPSpriteImportData
return bool

ImportTexture() public static method

Imports a texture as asset.
public static ImportTexture ( string path, Texture2D texture ) : bool
path string Path.
texture UnityEngine.Texture2D Texture.
return bool

IsDirectory() public static method

Determines if the specified path is directory.
public static IsDirectory ( string path ) : bool
path string Path.
return bool

IsMainAsset() public static method

Determines if the specified object is main asset.
public static IsMainAsset ( Object obj ) : bool
obj Object Object.
return bool

LoadSprite() public static method

Loads a sprite from a texture.
public static LoadSprite ( Texture2D mainTexture, string name ) : Sprite
mainTexture UnityEngine.Texture2D Main texture.
name string Name.
return UnityEngine.Sprite

PrepareDefaultEditorPrefs() public static method

Prepares the default editor preference values.
public static PrepareDefaultEditorPrefs ( ) : void
return void

RemoveReadOnlyFlag() public static method

Removes the read only flag from the asset.
public static RemoveReadOnlyFlag ( string path ) : bool
path string Path.
return bool

ReplaceReferences() public static method

Replaces all the references in the supplied array (does not work with internal properties).
public static ReplaceReferences ( Component components, Sprite find, Sprite replaceWith, bool spriteRenderersOnly ) : int
components UnityEngine.Component
find UnityEngine.Sprite Find.
replaceWith UnityEngine.Sprite Replace with.
spriteRenderersOnly bool If set to true sprite renderers only.
return int

ReplaceReferencesInAllScenes() public static method

Replaces all the references in all scenes.
public static ReplaceReferencesInAllScenes ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly, bool skipCurrent ) : int
spriteInfoList List Sprite info list.
replaceMode SPReferenceReplacerWindow
spriteRenderersOnly bool If set to true sprite renderers only.
skipCurrent bool If set to true skip current scene.
return int

ReplaceReferencesInProject() public static method

Replaces all the references in the project (does not work with internal properties).
public static ReplaceReferencesInProject ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly ) : int
spriteInfoList List Sprite info list.
replaceMode SPReferenceReplacerWindow
spriteRenderersOnly bool If set to true sprite renderers only.
return int

ReplaceReferencesInScene() public static method

Replaces all the references in the scene (does not work with internal properties).
public static ReplaceReferencesInScene ( List spriteInfoList, SPReferenceReplacerWindow replaceMode, bool spriteRenderersOnly ) : int
spriteInfoList List Sprite info list.
replaceMode SPReferenceReplacerWindow
spriteRenderersOnly bool If set to true sprite renderers only.
return int

TextureSetReadWriteEnabled() public static method

Sets the texture asset Read/Write enabled state.
public static TextureSetReadWriteEnabled ( Texture2D texture, bool enabled, bool force ) : bool
texture UnityEngine.Texture2D Texture.
enabled bool If set to true enabled.
force bool If set to true force.
return bool

Property Details

Settings_AllowMuliSpritesOneSource public_oe static_oe property

public static string Settings_AllowMuliSpritesOneSource
return string

Settings_DisableReadWriteEnabled public_oe static_oe property

public static string Settings_DisableReadWriteEnabled
return string

Settings_SavedInstanceIDKey public_oe static_oe property

public static string Settings_SavedInstanceIDKey
return string

Settings_ScrollViewHeightKey public_oe static_oe property

public static string Settings_ScrollViewHeightKey
return string

Settings_ShowSpritesKey public_oe static_oe property

public static string Settings_ShowSpritesKey
return string

Settings_ThumbsHeightKey public_oe static_oe property

public static string Settings_ThumbsHeightKey
return string

Settings_UseScrollViewKey public_oe static_oe property

public static string Settings_UseScrollViewKey
return string

Settings_UseSpriteThumbsKey public_oe static_oe property

public static string Settings_UseSpriteThumbsKey
return string