public void Initialize(int level_in, float speed_in) { level = level_in; SpriteRenderer sprite_renderer = GetComponent <SpriteRenderer>(); sprite_renderer.sprite = InterestingGameStuff.FindEnemySprite(level); speed = speed_in; }
void Pooed() { if (pooed) { return; } pooed = true; // change to pooped-upon sprite SpriteRenderer sprite_renderer = GetComponent <SpriteRenderer>(); sprite_renderer.sprite = InterestingGameStuff.FindEnemySprite(level, true); }
/// <summary> /// Changes the look, i.e. change the image that appears on the enemy: /// roach, fly, etc... /// </summary> /// <param name="level">Level.</param> public void Initialize(int level, float rotation_speed_in, float speed_in, float left_in, float top_in, float right_in, float bottom_in) { SpriteRenderer sprite_renderer = GetComponent <SpriteRenderer>(); sprite_renderer.sprite = InterestingGameStuff.FindEnemySprite(level); final_sprite = InterestingGameStuff.FindEnemySprite(level, true); // pooped-upon sprite rotation_speed = rotation_speed_in; speed = speed_in; left = left_in; top = top_in; right = right_in; bottom = bottom_in; }