Esempio n. 1
0
 void changeSpriteCheck(float enemyAngle)
 {
     GameLogger.ClearLog();
     if (enemyAngle >= 157.5 && enemyAngle < 202.5)
     {
         //GetComponent<SpriteRenderer> ().sprite = spriteBack as Sprite;
         SetFrame(0);
     }
     //moturs rotation 1
     else if (enemyAngle >= 202.5 && enemyAngle < 225)
     {
         //GetComponent<SpriteRenderer> ().sprite = sprite1 as Sprite;
         SetFrame(1);
     }
     //moturs rotation 2 (sedd från sidan)
     else if (enemyAngle >= 225 && enemyAngle < 270)
     {
         //GetComponent<SpriteRenderer> ().sprite = sprite2 as Sprite;
         SetFrame(2);
     }
     //moturs rotation 3
     else if (enemyAngle >= 270 && enemyAngle < 315)
     {
         //GetComponent<SpriteRenderer> ().sprite = sprite3 as Sprite;
         SetFrame(3);
     }
     //back
     else if (enemyAngle >= 315 || enemyAngle < 22.5)
     {
         //GetComponent<SpriteRenderer> ().sprite = spriteFront as Sprite;
         SetFrame(4);
     }
     //moturs 4
     else if (enemyAngle >= 22.5 && enemyAngle < 67.5)
     {
         //GetComponent<SpriteRenderer> ().sprite = sprite5 as Sprite;
         SetFrame(5);
     }
     //moturs 5 (sedd från sidan)
     else if (enemyAngle >= 67.5 && enemyAngle < 112.5)
     {
         SetFrame(6);
     }
     //moturs 6
     else if (enemyAngle >= 112.5 && enemyAngle < 157.5)
     {
         SetFrame(7);
     }
 }