C# Класс SimpleSpritePackerEditor.SPTools

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Settings_AllowMuliSpritesOneSource string
Settings_DisableReadWriteEnabled string
Settings_SavedInstanceIDKey string
Settings_ScrollViewHeightKey string
Settings_ShowSpritesKey string
Settings_ThumbsHeightKey string
Settings_UseScrollViewKey string
Settings_UseSpriteThumbsKey string

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AssetSetFormat() публичный статический Метод

Sets the asset texture format.
public static AssetSetFormat ( string path, TextureImporterFormat format ) : bool
path string Path.
format TextureImporterFormat Format.
Результат bool

AssetSetReadWriteEnabled() публичный статический Метод

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.
Результат bool

CreateBlankTexture() публичный статический Метод

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.
Результат bool

DoAssetReimport() публичный статический Метод

Does asset reimport.
public static DoAssetReimport ( string path, ImportAssetOptions options ) : void
path string Path.
options ImportAssetOptions Options.
Результат void

FilterResourcesForAtlasImport() публичный статический Метод

Filters the resources for atlas import.
public static FilterResourcesForAtlasImport ( Object resources ) : Object[]
resources Object Resources.
Результат Object[]

GetAllScenesNames() публичный статический Метод

Gets all scenes names.
public static GetAllScenesNames ( ) : string[]
Результат string[]

GetAssetPath() публичный статический Метод

Gets the asset path of a object.
public static GetAssetPath ( Object obj ) : string
obj Object Object.
Результат string

GetAssetPath() публичный статический Метод

Gets the asset path of a texture.
public static GetAssetPath ( Texture2D texture ) : string
texture UnityEngine.Texture2D Texture.
Результат string

GetDirectoryAssets() публичный статический Метод

Gets the assets in the specified directory.
public static GetDirectoryAssets ( string path ) : Object[]
path string Path.
Результат Object[]

GetEditorPrefBool() публичный статический Метод

Gets the editor preference bool value with the specified key.
public static GetEditorPrefBool ( string key ) : bool
key string Key.
Результат bool

GetProjectPrefabComponents() публичный статический Метод

public static GetProjectPrefabComponents ( ) : UnityEngine.Component[]
Результат UnityEngine.Component[]

GetSubAssets() публичный статический Метод

Gets the sub assets of an object.
public static GetSubAssets ( Object obj ) : Object[]
obj Object Object.
Результат Object[]

HasSubAssets() публичный статический Метод

Determines if the specified object has sub assets.
public static HasSubAssets ( Object obj ) : bool
obj Object Object.
Результат bool

ImportAndConfigureAtlasTexture() публичный статический Метод

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
Результат bool

ImportTexture() публичный статический Метод

Imports a texture as asset.
public static ImportTexture ( string path, Texture2D texture ) : bool
path string Path.
texture UnityEngine.Texture2D Texture.
Результат bool

IsDirectory() публичный статический Метод

Determines if the specified path is directory.
public static IsDirectory ( string path ) : bool
path string Path.
Результат bool

IsMainAsset() публичный статический Метод

Determines if the specified object is main asset.
public static IsMainAsset ( Object obj ) : bool
obj Object Object.
Результат bool

LoadSprite() публичный статический Метод

Loads a sprite from a texture.
public static LoadSprite ( Texture2D mainTexture, string name ) : Sprite
mainTexture UnityEngine.Texture2D Main texture.
name string Name.
Результат UnityEngine.Sprite

PrepareDefaultEditorPrefs() публичный статический Метод

Prepares the default editor preference values.
public static PrepareDefaultEditorPrefs ( ) : void
Результат void

RemoveReadOnlyFlag() публичный статический Метод

Removes the read only flag from the asset.
public static RemoveReadOnlyFlag ( string path ) : bool
path string Path.
Результат bool

ReplaceReferences() публичный статический Метод

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.
Результат int

ReplaceReferencesInAllScenes() публичный статический Метод

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.
Результат int

ReplaceReferencesInProject() публичный статический Метод

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.
Результат int

ReplaceReferencesInScene() публичный статический Метод

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.
Результат int

TextureSetReadWriteEnabled() публичный статический Метод

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.
Результат bool

Описание свойств

Settings_AllowMuliSpritesOneSource публичное статическое свойство

public static string Settings_AllowMuliSpritesOneSource
Результат string

Settings_DisableReadWriteEnabled публичное статическое свойство

public static string Settings_DisableReadWriteEnabled
Результат string

Settings_SavedInstanceIDKey публичное статическое свойство

public static string Settings_SavedInstanceIDKey
Результат string

Settings_ScrollViewHeightKey публичное статическое свойство

public static string Settings_ScrollViewHeightKey
Результат string

Settings_ShowSpritesKey публичное статическое свойство

public static string Settings_ShowSpritesKey
Результат string

Settings_ThumbsHeightKey публичное статическое свойство

public static string Settings_ThumbsHeightKey
Результат string

Settings_UseScrollViewKey публичное статическое свойство

public static string Settings_UseScrollViewKey
Результат string

Settings_UseSpriteThumbsKey публичное статическое свойство

public static string Settings_UseSpriteThumbsKey
Результат string