|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Only change material of body and tail
|
|
|
|
private void ChangeMaterial(Material material) |
|
|
|
{ |
|
|
|
myBody.GetComponentInChildren<Renderer>().material = material; |
|
|
|
GameObject tail = transform.Find("DragonCube").Find("tail").gameObject; |
|
|
|
if (tail != null) |
|
|
|
{ |
|
|
|
tail.GetComponentInChildren<Renderer>().material = material; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
myBody.GetComponentInChildren<Renderer>().material = normalMaterial; |
|
|
|
ChangeMaterial(normalMaterial); |
|
|
|
myBody.GetComponentInChildren<Renderer>().material = weakMaterial; |
|
|
|
ChangeMaterial(weakMaterial); |
|
|
|
|
|
|
|
} |
|
|
|
else // Dead
|
|
|
|
|
|
|
myBody.GetComponentInChildren<Renderer>().material = deadMaterial; |
|
|
|
ChangeMaterial(deadMaterial); |
|
|
|
m_MyArea.AgentDied(); |
|
|
|
} |
|
|
|
} |
|
|
|