How can I access data in Monobehaviour?
Posted: Sat Dec 01, 2018 5:40 pm
Here's the specific Scenario.
Each of our Game character will have an enum TEAM that designated which TEAM it is on.
TEAM1 to TEAM4 each has specific Color assigned to them.
And they got multiplied on to the base Texture.
TEAM1 => Red
TEAM2 => Blue
TEAM3 => Green
TEAM4 => Yellow
Currently, we have one Material per Team,
which is really redundant and cost ineffective, considering that everything else are all identical.
So, we want the shader to be able to access that data, and automatically choose the color via a switch.
Also, because Vertex Color are needed for other purposes, they cannot be used in our case.
-------------------
Could anyone help us in solving this ?
THX in advance
Each of our Game character will have an enum TEAM that designated which TEAM it is on.
TEAM1 to TEAM4 each has specific Color assigned to them.
And they got multiplied on to the base Texture.
TEAM1 => Red
TEAM2 => Blue
TEAM3 => Green
TEAM4 => Yellow
Currently, we have one Material per Team,
which is really redundant and cost ineffective, considering that everything else are all identical.
So, we want the shader to be able to access that data, and automatically choose the color via a switch.
Also, because Vertex Color are needed for other purposes, they cannot be used in our case.
-------------------
Could anyone help us in solving this ?
THX in advance