コード例 #1
0
    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;
        }
    }
コード例 #2
0
 public void SetFace(EnemyFaceType type)
 {
     face.ChangeFace(type);
 }