Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Gameobject losing its shader effects after deserialization: Any way to refresh?

Discussion in 'Editor & General Support' started by mattcscz, Sep 3, 2015.

  1. mattcscz

    mattcscz

    Joined:
    Mar 7, 2010
    Posts:
    411
    Hi guys,

    As the title says, I'm having an issue where after a saved gameobject is de-serialized it will lose any material/shader effect until I manually expand the material window in the editor.

    Is there anything I can call to refresh all the materials?



    Thanks!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,850
  3. mattcscz

    mattcscz

    Joined:
    Mar 7, 2010
    Posts:
    411
    Yes, i'm working with the standard shader =)

    I've taken a look at the Materials reference you linked above but I can't see what I might call to set this, unless I were to just call any of the set methods?

    Thanks for the reply!
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,850
    Are these material assets stored in your project or being created procedurally? If they are created by a script then you need to enable the keywords for the areas that are used, e.g if you add a normal map then you need to enable the keyword _NORMALMAP in the material. If you are unsure you could just go through the material and check if a normal map exists, if so enable keyword, etc.