C# Class SimpleSpritePackerEditor.SPTools

Afficher le fichier Open project: sunduk/freegostop Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

AssetSetReadWriteEnabled() public static méthode

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.
Résultat bool

CreateBlankTexture() public static méthode

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.
Résultat bool

DoAssetReimport() public static méthode

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

FilterResourcesForAtlasImport() public static méthode

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

GetAllScenesNames() public static méthode

Gets all scenes names.
public static GetAllScenesNames ( ) : string[]
Résultat string[]

GetAssetPath() public static méthode

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

GetAssetPath() public static méthode

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

GetDirectoryAssets() public static méthode

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

GetEditorPrefBool() public static méthode

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

GetProjectPrefabComponents() public static méthode

public static GetProjectPrefabComponents ( ) : UnityEngine.Component[]
Résultat UnityEngine.Component[]

GetSubAssets() public static méthode

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

HasSubAssets() public static méthode

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

ImportAndConfigureAtlasTexture() public static méthode

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
Résultat bool

ImportTexture() public static méthode

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

IsDirectory() public static méthode

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

IsMainAsset() public static méthode

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

LoadSprite() public static méthode

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

PrepareDefaultEditorPrefs() public static méthode

Prepares the default editor preference values.
public static PrepareDefaultEditorPrefs ( ) : void
Résultat void

RemoveReadOnlyFlag() public static méthode

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

ReplaceReferences() public static méthode

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.
Résultat int

ReplaceReferencesInAllScenes() public static méthode

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.
Résultat int

ReplaceReferencesInProject() public static méthode

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.
Résultat int

ReplaceReferencesInScene() public static méthode

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.
Résultat int

TextureSetReadWriteEnabled() public static méthode

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.
Résultat bool

Property Details

Settings_AllowMuliSpritesOneSource public_oe static_oe property

public static string Settings_AllowMuliSpritesOneSource
Résultat string

Settings_DisableReadWriteEnabled public_oe static_oe property

public static string Settings_DisableReadWriteEnabled
Résultat string

Settings_SavedInstanceIDKey public_oe static_oe property

public static string Settings_SavedInstanceIDKey
Résultat string

Settings_ScrollViewHeightKey public_oe static_oe property

public static string Settings_ScrollViewHeightKey
Résultat string

Settings_ShowSpritesKey public_oe static_oe property

public static string Settings_ShowSpritesKey
Résultat string

Settings_ThumbsHeightKey public_oe static_oe property

public static string Settings_ThumbsHeightKey
Résultat string

Settings_UseScrollViewKey public_oe static_oe property

public static string Settings_UseScrollViewKey
Résultat string

Settings_UseSpriteThumbsKey public_oe static_oe property

public static string Settings_UseSpriteThumbsKey
Résultat string