-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use shared materials for every mesh only bundle one shader: "Legacy Shaders/Diffuse"
- Loading branch information
1 parent
d9de03f
commit 7f68f72
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
| ||
using UnityEngine; | ||
|
||
public class Materials { | ||
|
||
public static readonly Material sugarscape; | ||
|
||
public static readonly Material male; | ||
public static readonly Material female; | ||
|
||
static Materials () { | ||
sugarscape = new Material(Shaders.Legacy.diffuse) { | ||
color = Color.white | ||
}; | ||
|
||
male = new Material(Shaders.Legacy.diffuse) { | ||
color = Color.red | ||
}; | ||
female = new Material(Shaders.Legacy.diffuse) { | ||
color = Color.blue | ||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
| ||
using UnityEngine; | ||
|
||
public class Shaders { | ||
|
||
public static class Legacy { | ||
|
||
public static readonly Shader diffuse; | ||
|
||
static Legacy () { | ||
diffuse = Shader.Find("Legacy Shaders/Diffuse"); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters