Search Unity

Changing the source image of a sprite sheet during runtime

Discussion in '2D' started by Aegilluum, Oct 19, 2014.

  1. Aegilluum

    Aegilluum

    Joined:
    Sep 28, 2013
    Posts:
    28
    Hi,

    Is there a way to load a different image source of a specific sprite sheet during runtime ??


    Thank you
     
  2. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
  3. Aegilluum

    Aegilluum

    Joined:
    Sep 28, 2013
    Posts:
    28
    thx for your reply !

    I tried : renderer.material.mainTexture = Resources.Load.<Texture2D>("playerSheet2.png");

    But doesn't work. What i want to achieve ( don't know if my question was clear) is not to change a texture on an object. It's to change to image source which contains multiple sprites for my animations.
     
    Last edited: Oct 20, 2014