GetPlatformTextureSettings
Gets platform specific texture settings.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
GetPlatformTextureSettings(string, int, TextureImporterFormat, int, bool)
Gets platform specific texture settings.
public bool GetPlatformTextureSettings(string platform, out int maxTextureSize, out TextureImporterFormat textureFormat, out int compressionQuality, out bool etc1AlphaSplitEnabled)
Parameters
The platform for which settings are required (see options below).
Maximum texture width/height in pixels.
Format of the texture for the given platform.
Value from 0..100, equivalent to the standard JPEG quality setting.
Status of the ETC1 and alpha split flag.
Returns
Type | Description |
|---|---|
| bool | True if the platform override was found, false if no override was found. |
Remarks
The values for the chosen platform are returned in the "out" parameters. The options for the platform string are "Standalone", "Web", "iPhone", "Android", "WebGL", "Windows Store Apps", "PS4", "XboxOne", "Nintendo Switch" and "tvOS".
Examples
using UnityEngine;using UnityEditor;using UnityEngine.UI;using System.Collections;public class DisplayInfo : EditorWindow{ [MenuItem("PlatformSettings/GetSettingsForAndroid")] static void GetAndroidSettings() { string platformString = "Android"; int platformMaxTextureSize = 0; TextureImporterFormat platformTextureFmt; int platformCompressionQuality = 0; bool platformAllowsAlphaSplit = false; TextureImporter ti = (TextureImporter)TextureImporter.GetAtPath("Assets/characters.png"); if (ti.GetPlatformTextureSettings(platformString, out platformMaxTextureSize, out platformTextureFmt, out platformCompressionQuality, out platformAllowsAlphaSplit)) { Debug.Log("Found some overrides for platform: " + platformString); } }}
GetPlatformTextureSettings(string, int, TextureImporterFormat, int)
Gets platform specific texture settings.
public bool GetPlatformTextureSettings(string platform, out int maxTextureSize, out TextureImporterFormat textureFormat, out int compressionQuality)
Parameters
The platform whose settings are required (see below).
Maximum texture width/height in pixels.
Format of the texture.
Value from 0..100, equivalent to the standard JPEG quality setting.
Returns
Type | Description |
|---|---|
| bool | True if the platform override was found, false if no override was found. |
Remarks
The values for the chosen platform are returned in the "out" parameters. The options for the platform string are "Standalone", "Web", "iPhone", "Android", "WebGL", "Windows Store Apps", "PS4", "XboxOne", "Nintendo Switch" and "tvOS".
GetPlatformTextureSettings(string, int, TextureImporterFormat)
Gets platform specific texture settings.
public bool GetPlatformTextureSettings(string platform, out int maxTextureSize, out TextureImporterFormat textureFormat)
Parameters
The platform whose settings are required (see below).
Maximum texture width/height in pixels.
Format of the texture.
Returns
Type | Description |
|---|---|
| bool | True if the platform override was found, false if no override was found. |
Remarks
The values for the chosen platform are returned in the "out" parameters. The options for the platform string are "Standalone", "Web", "iPhone", "Android", "WebGL", "Windows Store Apps", "PS4", "XboxOne", "Nintendo Switch" and "tvOS".
GetPlatformTextureSettings(string)
Gets platform specific texture settings.
public TextureImporterPlatformSettings GetPlatformTextureSettings(string platform)
Parameters
The platform whose settings are required (see below).
Returns
Type | Description |
|---|---|
| TextureImporterPlatformSettings | A TextureImporterPlatformSettings structure containing the platform parameters. |
Remarks
Returns the parameters for the chosen platform. The options for the platform string are "Standalone", "Web", "iPhone", "Android", "WebGL", "Windows Store Apps", "PS4", "XboxOne", "Nintendo Switch" and "tvOS".