Search Unity

Save changes on material at runtime

Discussion in 'Scripting' started by yalcinsenturk, Sep 1, 2014.

  1. yalcinsenturk

    yalcinsenturk

    Joined:
    Feb 28, 2014
    Posts:
    1
    I'm using code below, it works on editor, when I change color in play mode the color persist even I quit play mode.
    The problem is if I deploy to mobile it changes color but resets to original when I change scene or quit.

    Code (CSharp):
    1. Material mat = Resources.Load("Materials/"+Selected, typeof(Material)) as Material;
    2. mat.SetColor("_Color", clr);