public void ChangeFace(EnemyFaceType face) { switch (face) { case EnemyFaceType.DEAD: myRenderer.materials[faceMaterial].mainTextureOffset = new Vector2(0.0f, 0.0f); break; case EnemyFaceType.CLOSED: myRenderer.materials[faceMaterial].mainTextureOffset = new Vector2(0.25f, 0.0f); break; case EnemyFaceType.ANGRY: myRenderer.materials[faceMaterial].mainTextureOffset = new Vector2(0.5f, 0.0f); break; case EnemyFaceType.DIZZY: myRenderer.materials[faceMaterial].mainTextureOffset = new Vector2(0.75f, 0.0f); break; } }
public void SetFace(EnemyFaceType type) { face.ChangeFace(type); }