Search Unity

Bought an asset with old code

Discussion in 'Scripting' started by yoash, Aug 6, 2015.

  1. yoash

    yoash

    Joined:
    Sep 3, 2013
    Posts:
    36
    I bought an asset that has animations in it,

    Here is the code:

    renderer.sharedMaterial.SetTextureOffset ("_MainTex", offset);
    renderer.sharedMaterial.SetTextureScale ("_MainTex", size);

    This is coming up as not valid anymore (I think it was made with Unity 3). Anyone know what comparable code would work with Unity 5?

    Thanks
     
  2. lordconstant

    lordconstant

    Joined:
    Jul 4, 2013
    Posts:
    351
    Swap out renderer with GetComponent<Renderer>
     
    yoash and Kiwasi like this.
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,463
    Or run the auto updater and it will do this for you.
     
    yoash likes this.