Manual     Reference     Scripting  
  
Scripting > Runtime Classes > Texture   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Attributes
  • Enumerations
  • History
  • Index
  • Texture
  • All Members
  • Variables
  • anisoLevel
  • filterMode
  • height
  • mipMapBias
  • width
  • wrapMode
  • Functions
  • GetNativeTextureID
  • Inherited Variables
  • hideFlags
  • name
  • Inherited Functions
  • GetInstanceID
  • ToString
  • Inherited Class Functions
  • Destroy
  • DestroyImmediate
  • DontDestroyOnLoad
  • FindObjectOfType
  • FindObjectsOfType
  • Instantiate
  • operator !=
  • operator ==
  • operator bool

Texture.GetNativeTextureID  

function GetNativeTextureID () : int

Description

Retrieve native ('hardware') handle to a texture

Use this function to retrieve an ID/handle corresponding to a particular texture as it is represented on the native graphics device level. This can be used to enable texture manipulation from native plugins. This function is only supported on OpenGL/ES devices.

JavaScript
var mainTextureNativeId : int = renderer.material.mainTexture.GetNativeTextureID();

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
public int mainTextureNativeId = renderer.material.mainTexture.GetNativeTextureID();
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

public mainTextureNativeId as int = renderer.material.mainTexture.GetNativeTextureID()