Пример #1
0
    // Token: 0x06001E3D RID: 7741 RVA: 0x001AF9E4 File Offset: 0x001ADBE4
    public void DrawSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, float timeStacker, Vector2 camPos)
    {
        float   num    = Mathf.Lerp(this.lastPower, this.power, timeStacker);
        Vector2 vector = rCam.ApplyDepth(this.placedObject.pos, -3f + 10f * (float)this.depth);

        sLeaser.sprites[0].x     = vector.x - camPos.x;
        sLeaser.sprites[0].y     = vector.y - camPos.y;
        sLeaser.sprites[0].alpha = Math.Abs(num);
        for (int i = 0; i < 16; i++)
        {
            sLeaser.sprites[i + 1].x = vector.x - camPos.x;
            sLeaser.sprites[i + 1].y = vector.y - camPos.y;
            if (this.debugMode > 0)
            {
                sLeaser.sprites[i + 1].color = new Color((i % 2 != 0) ? 0f : 1f, (i % 2 != 1) ? 0f : 1f, 0f);
            }
            else
            {
                if (this.power > 0)
                {
                    sLeaser.sprites[i + 1].color = new Color(0f, 0f, Mathf.Lerp(this.lights[i, 1], this.lights[i, 0], timeStacker) * Math.Abs(num));
                }
                else
                {
                    sLeaser.sprites[i + 1].color = new Color(Mathf.Lerp(this.lights[i, 1], this.lights[i, 0], timeStacker) * Math.Abs(num), 0f, 0f);
                }
            }
        }
        if (base.slatedForDeletetion || this.room != rCam.room)
        {
            sLeaser.CleanSpritesAndRemove();
        }
    }