コード例 #1
0
    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;
    }
コード例 #2
0
    void Pooed()
    {
        if (pooed)
        {
            return;
        }
        pooed = true;
        // change to pooped-upon sprite
        SpriteRenderer sprite_renderer = GetComponent <SpriteRenderer>();

        sprite_renderer.sprite = InterestingGameStuff.FindEnemySprite(level, true);
    }
コード例 #3
0
    /// <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;
    }