1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  3. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
    Dismiss Notice
  4. Unity 5.5 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  6. Unity 5.6 beta is now available for download.
    Dismiss Notice
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
    Dismiss Notice
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
    Dismiss Notice

All of the named properties of a Material

Discussion in 'Scripting' started by scone, Feb 7, 2011.

  1. scone

    scone

    Joined:
    May 21, 2008
    Messages:
    244
    Hello,

    I'm trying to account for all possible textures, properties, etc. of a material for a save/load function.

    So far, from the scripting doc I've found that there are:
    • Textures
      • _MainTex
      • _BumpMap
      • _Cube
    • Colors
      • _Color
      • _SpecColor
      • _Emission
      • _ReflectColor
    • Floats
      • _Shininess

    Is that it?
     
    Last edited: Feb 8, 2011
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Messages:
    8,769
    You can define any number of properties in a shader but these are just some common names that Unity provides shortcuts for. However, you can get/set properties with any names using the GetXXX/SetXXX functions of the Material class (for example, GetFloat gets any given float property by name).
     
  3. scone

    scone

    Joined:
    May 21, 2008
    Messages:
    244
    Thanks for the info. Specifically, I was wondering if people could help me fill out that list. For example what is the name for the texture channel of self-illuminating shaders? Is the source for the standard Unity shaders available, so that I can see what these properties are called?