Search Unity

Why all ptr 0?

Discussion in 'Web' started by gtk2k, Nov 19, 2020.

  1. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    288
    Code (CSharp):
    1. void Start() {
    2. var texture = new Texture2D(0, 0, TextureFormat.ARGB32, false);
    3.         Debug.Log($"texture: {texture.GetNativeTexturePtr()}");
    4.         var texture2 = new Texture2D(0, 0, TextureFormat.ARGB32, false);
    5.         Debug.Log($"texture2: {texture2.GetNativeTexturePtr()}");
    6.         var texture3 = new Texture2D(0, 0, TextureFormat.ARGB32, false);
    7.         Debug.Log($"texture3: {texture3.GetNativeTexturePtr()}");
    8.         var texture4 = new Texture2D(0, 0, TextureFormat.ARGB32, false);
    9.         Debug.Log($"texture4: {texture4.GetNativeTexturePtr()}");
    10. }
    Run console
    Code (JavaScript):
    1. texture: 0
    2. texture2: 0
    3. texture3: 0
    4. texture4: 0
    5.  
    Why all texture ptr 0?
    Do I need any other code to get the correct ptr?