Hydrogen Framework  1.3.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Hydrogen.Material Class Reference

Additional static functions and constants used to extend existing Material support inside of Unity. More...

Static Public Member Functions

static int GetDataHashCode (this UnityEngine.Material material)
 

Detailed Description

Additional static functions and constants used to extend existing Material support inside of Unity.

Definition at line 34 of file Material.cs.

Member Function Documentation

static int Hydrogen.Material.GetDataHashCode ( this UnityEngine.Material  material)
static

Definition at line 36 of file Material.cs.

37  {
38  string longName = material.name.Replace (" (Instance)", "") +
39  material.color.r +
40  material.color.g +
41  material.color.b +
42  material.color.a;
43 
44  if (material.mainTexture != null) {
45  longName += material.mainTexture.name +
46  material.mainTextureOffset +
47  material.mainTextureScale;
48  }
49 
50  if (material.shader != null) {
51  longName += material.shader.name +
52  material.shader.renderQueue;
53  }
54 
55  // Send it back!
56  return longName.GetHashCode ();
57  }