コード例 #1
0
        public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
        {
            if (newContatiner == null)
            {
                switch (uglyWorkAroundName)
                {
                case "Tr_TankWall":
                    newContatiner = rCam.ReturnFContainer("Foreground");
                    break;

                case "Tr_TankShadow1":
                    newContatiner = rCam.ReturnFContainer("ForegroundLights");
                    break;

                case "Tr_TankShadow":
                    newContatiner = rCam.ReturnFContainer("Shortcuts");
                    break;

                default:
                    newContatiner = rCam.ReturnFContainer("Shortcuts");
                    break;
                }
            }
            foreach (FSprite fsprite in sLeaser.sprites)
            {
                fsprite.RemoveFromContainer();
                newContatiner.AddChild(fsprite);
            }
        }
コード例 #2
0
        public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
        {
            if (newContatiner == null)
            {
                switch (this.assetName)
                {
                case "Tr_PipesA":
                    newContatiner = rCam.ReturnFContainer("Foreground");
                    break;

                case "Tr_PipesB":
                    newContatiner = rCam.ReturnFContainer("ForegroundLights");
                    break;

                case "Tr_PipesC":
                    newContatiner = rCam.ReturnFContainer("Shortcuts");
                    break;

                default:
                    newContatiner = rCam.ReturnFContainer("Shortcuts");
                    break;
                }
            }
            foreach (FSprite fsprite in sLeaser.sprites)
            {
                fsprite.RemoveFromContainer();
                newContatiner.AddChild(fsprite);
            }
        }
コード例 #3
0
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites            = new FSprite[6];
     sLeaser.sprites[0]         = new FSprite("pixel", true);
     sLeaser.sprites[0].color   = new Color(1f, 0.0f, 0.0f);
     sLeaser.sprites[0].scale   = 10f;
     sLeaser.sprites[0].anchorX = 0.0f;
     sLeaser.sprites[0].anchorY = 1f;
     rCam.ReturnFContainer("HUD2").AddChild(sLeaser.sprites[0]);
     rCam.ReturnFContainer("HUD2").AddChild(label);
     for (int index = 1; index < 5; ++index)
     {
         sLeaser.sprites[index]       = new FSprite("pixel", true);
         sLeaser.sprites[index].color = new Color(0.0f, 1f, 0.0f);
         sLeaser.sprites[index].alpha = 1f;
         rCam.ReturnFContainer("HUD2").AddChild(sLeaser.sprites[index]);
     }
     sLeaser.sprites[1].scaleY = 21f;
     sLeaser.sprites[2].scaleX = 21f;
     sLeaser.sprites[3].scaleY = 21f;
     sLeaser.sprites[4].scaleX = 21f;
     sLeaser.sprites[5]        = new FSprite("pixel", true);
     sLeaser.sprites[5].color  = new Color(0.0f, 1f, 0.0f);
     sLeaser.sprites[5].scale  = 7f;
     rCam.ReturnFContainer("HUD2").AddChild(sLeaser.sprites[5]);
 }
コード例 #4
0
 public override void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     base.AddToContainer(sLeaser, rCam, null);
     label.RemoveFromContainer();
     sLeaser.sprites[0].RemoveFromContainer();
     rCam.ReturnFContainer("Foreground").AddChild(sLeaser.sprites[0]);
     rCam.ReturnFContainer("Foreground").AddChild(label);
 }
コード例 #5
0
ファイル: BattleRoomRain.cs プロジェクト: Garrakx/Monkland
 // Token: 0x06000E4D RID: 3661 RVA: 0x00097A6C File Offset: 0x00095C6C
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     rCam.ReturnFContainer("GrabShaders").AddChild(sLeaser.sprites[0]);
     newContatiner = rCam.ReturnFContainer("Items");
     for (int i = 1; i < this.splashes; i++)
     {
         newContatiner.AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #6
0
 // Token: 0x06001E3F RID: 7743 RVA: 0x001AFB64 File Offset: 0x001ADD64
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     sLeaser.sprites[0].RemoveFromContainer();
     rCam.ReturnFContainer("HUD").AddChild(sLeaser.sprites[0]);
     if (newContatiner == null)
     {
         newContatiner = rCam.ReturnFContainer("Foreground");
     }
     for (int i = 1; i < sLeaser.sprites.Length; i++)
     {
         sLeaser.sprites[i].RemoveFromContainer();
         newContatiner.AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #7
0
ファイル: LightningStrike.cs プロジェクト: LeeMoriya/Downpour
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     rCam.microShake = 0.34f;
     if (!warn)
     {
         rCam.microShake = 0.9f;
         alpha           = 0.6f;
     }
     sLeaser.sprites = new FSprite[2];
     //Flash Sprite
     sLeaser.sprites[0]        = new FSprite("Futile_White", true);
     sLeaser.sprites[0].shader = rCam.game.rainWorld.Shaders["FlareBomb"];
     sLeaser.sprites[0].color  = this.color;
     sLeaser.sprites[0].scale  = this.rad;
     sLeaser.sprites[0].alpha  = 0.5f;
     //Darkening Sprite
     sLeaser.sprites[1]       = new FSprite("Futile_White", true);
     sLeaser.sprites[1].color = new Color(0.01f, 0.01f, 0.01f);
     sLeaser.sprites[1].alpha = 0.6f;
     if (warn)
     {
         sLeaser.sprites[1].alpha = 0f;
     }
     sLeaser.sprites[1].scale = 1000f;
     //Positions
     sLeaser.sprites[0].x = this.pos.x - rCam.pos.x;
     sLeaser.sprites[0].y = this.pos.y - rCam.pos.y;
     sLeaser.sprites[1].x = this.pos.x - rCam.pos.x;
     sLeaser.sprites[1].y = this.pos.y - rCam.pos.y;
     this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("Foreground"));
 }
コード例 #8
0
 // Token: 0x060018E9 RID: 6377 RVA: 0x0013FC08 File Offset: 0x0013DE08
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     for (int i = 0; i < sLeaser.sprites.Length; i++)
     {
         sLeaser.sprites[i].RemoveFromContainer();
         rCam.ReturnFContainer("Background").AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #9
0
ファイル: Snow.cs プロジェクト: LeeMoriya/Downpour
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites           = new FSprite[1];
     sLeaser.sprites[0]        = new FSprite("Futile_White", true);
     sLeaser.sprites[0].shader = rCam.game.rainWorld.Shaders["Spores"];
     sLeaser.sprites[0].color  = new Color(1f, 1f, 1f);
     this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("Background"));
     base.InitiateSprites(sLeaser, rCam);
 }
コード例 #10
0
ファイル: Blizzard.cs プロジェクト: LeeMoriya/Downpour
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites           = new FSprite[1];
     sLeaser.sprites[0]        = new FSprite("blizzard");
     sLeaser.sprites[0].alpha  = 0f;
     sLeaser.sprites[0].scaleY = UnityEngine.Random.Range(1.6f, 3f);
     sLeaser.sprites[0].scaleX = UnityEngine.Random.Range(1f, 1.6f);
     this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("HUD"));
 }
コード例 #11
0
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContainer)
 {
     if (newContainer == null)
     {
         newContainer = rCam.ReturnFContainer("Midground");
     }
     for (int i = startSprite; i < startSprite + numberOfSprites; i++)
     {
         newContainer.AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #12
0
 public override void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContainer)
 {
     if (newContainer == null)
     {
         newContainer = rCam.ReturnFContainer("Bloom");
     }
     for (int i = 0; i < sLeaser.sprites.Length; i++)
     {
         newContainer.AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #13
0
ファイル: LightningStrike.cs プロジェクト: LeeMoriya/Downpour
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     this.color      = new Color(1f, 1f, 0.87f);
     sLeaser.sprites = new FSprite[pathPositions.Count];
     for (int i = 0; i < pathPositions.Count; i++)
     {
         sLeaser.sprites[i]        = new FSprite("pixel", false);
         sLeaser.sprites[i].color  = this.color;
         sLeaser.sprites[i].scaleX = 5f;
     }
     this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("HUD"));
 }
コード例 #14
0
 // Token: 0x06001D34 RID: 7476 RVA: 0x0019A1BC File Offset: 0x001983BC
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     if (newContatiner == null)
     {
         newContatiner = rCam.ReturnFContainer("Water");
     }
     for (int i = 0; i < sLeaser.sprites.Length; i++)
     {
         sLeaser.sprites[i].RemoveFromContainer();
         newContatiner.AddChild(sLeaser.sprites[i]);
     }
 }
コード例 #15
0
 public virtual void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     if (newContatiner == null)
     {
         newContatiner = rCam.ReturnFContainer("HUD2");
     }
     foreach (FSprite fsprite in sLeaser.sprites)
     {
         fsprite.RemoveFromContainer();
         newContatiner.AddChild(fsprite);
     }
 }
コード例 #16
0
 public virtual void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     //默认添加在Midground Layer
     if (newContatiner == null)
     {
         newContatiner = rCam.ReturnFContainer("Midground");
     }
     foreach (FSprite sprite in sLeaser.sprites)
     {
         sprite.RemoveFromContainer();
         newContatiner.AddChild(sprite);
     }
 }
コード例 #17
0
 // Token: 0x06001D3D RID: 7485 RVA: 0x0019A5D4 File Offset: 0x001987D4
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites           = new FSprite[3];
     sLeaser.sprites[0]        = new FSprite("Futile_White", true);
     sLeaser.sprites[0].shader = rCam.room.game.rainWorld.Shaders["LightSource"];
     sLeaser.sprites[0].color  = new Color(0f, 0f, 1f);
     sLeaser.sprites[1]        = new FSprite("Futile_White", true);
     sLeaser.sprites[1].shader = rCam.room.game.rainWorld.Shaders["FlatLight"];
     sLeaser.sprites[1].color  = new Color(0f, 0f, 1f);
     sLeaser.sprites[2]        = new FSprite("Futile_White", true);
     sLeaser.sprites[2].shader = rCam.room.game.rainWorld.Shaders["FlareBomb"];
     sLeaser.sprites[2].color  = new Color(0f, 0f, 1f);
     AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("Water"));
 }
コード例 #18
0
        public static void ApplyPositionChangeHook(On.RoomCamera.orig_ApplyPositionChange orig, RoomCamera rCam)
        {
            WWW       www     = (WWW)typeof(RoomCamera).GetField("www", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(rCam);
            Texture2D texture = rCam.game.rainWorld.persistentData.cameraTextures[rCam.cameraNumber, 0];

            if (ShouldScroll(rCam, GetRoomName(www.url)))
            {
                texture.Resize(www.texture.width, www.texture.height, TextureFormat.ARGB32, false);
            }
            else
            {
                texture.Resize(1400, 800, TextureFormat.ARGB32, false); // default
            }
            texture.Apply();

            FAtlasManager manager = Futile.atlasManager;
            List <FAtlas> atlases = (List <FAtlas>) typeof(FAtlasManager).GetField("_atlases", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(manager);
            Dictionary <string, FAtlasElement> allElementsByName = (Dictionary <string, FAtlasElement>) typeof(FAtlasManager).GetField("_allElementsByName", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).GetValue(manager);
            FAtlas atlas = manager.GetAtlasWithName("LevelTexture");

            atlases.Remove(atlas);
            allElementsByName.Remove("LevelTexture");
            atlas = null;
            manager.LoadAtlasFromTexture("LevelTexture", texture);

            rCam.ReturnFContainer("Foreground").RemoveChild(rCam.levelGraphic);
            rCam.levelGraphic           = new FSprite("LevelTexture", true);
            rCam.levelGraphic.anchorX   = 0;
            rCam.levelGraphic.anchorY   = 0;
            rCam.levelGraphic.isVisible = true;
            rCam.levelGraphic.shader    = rCam.game.rainWorld.Shaders["LevelColor"];
            rCam.ReturnFContainer("Foreground").AddChild(rCam.levelGraphic);

            rCam.currentCameraPosition = 0;
            orig(rCam);
        }
コード例 #19
0
        public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
        {
            sLeaser.sprites    = new FSprite[2];
            sLeaser.sprites[0] = new FSprite("Futile_White")
            {
                shader = rCam.game.rainWorld.Shaders["FlatLight"],
                scaleX = 6f,
                scaleY = 6f,
                color  = new Color(1f, 1f, 1f, 0.2f)
            };
            sLeaser.sprites[1] = new FSprite("ShortcutArrow")
            {
                rotation = 180f,
                anchorY  = 1f
            };

            AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("HUD"));
        }
コード例 #20
0
    public virtual void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
    {
        //默认层:Midground
        sLeaser.RemoveAllSpritesFromContainer();
        if (newContatiner == null)
        {
            newContatiner = rCam.ReturnFContainer("Midground");
        }
        foreach (FSprite sprite in sLeaser.sprites)
        {
            newContatiner.AddChild(sprite);
        }

        if (sLeaser.containers != null)
        {
            foreach (FContainer container in sLeaser.containers)
            {
                newContatiner.AddChild(container);
            }
        }
    }
コード例 #21
0
ファイル: Blizzard.cs プロジェクト: LeeMoriya/Downpour
        public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
        {
            sLeaser.sprites = new FSprite[1];
            var tris = new TriangleMesh.Triangle[]
            {
                new TriangleMesh.Triangle(0, 1, 2),
                new TriangleMesh.Triangle(2, 1, 3)
            };
            var mesh = new TriangleMesh(spriteName, tris, false);

            mesh.MoveVertice(0, new Vector2(0f, 0f));
            mesh.MoveVertice(1, new Vector2(0f, rCam.sSize.y));
            mesh.MoveVertice(2, new Vector2(rCam.sSize.x, 0f));
            mesh.MoveVertice(3, new Vector2(rCam.sSize.x, rCam.sSize.y));

            mesh.UVvertices[0]       = new Vector2(0f, 0f);
            mesh.UVvertices[1]       = new Vector2(0f, 2f);
            mesh.UVvertices[2]       = new Vector2(2f, 0f);
            mesh.UVvertices[3]       = new Vector2(2f, 2f);
            sLeaser.sprites[0]       = mesh;
            sLeaser.sprites[0].alpha = 0f;
            this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("HUD"));
        }
コード例 #22
0
 // Token: 0x06001E44 RID: 7748 RVA: 0x001AFE54 File Offset: 0x001AE054
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites    = new FSprite[1];
     sLeaser.sprites[0] = new FSprite("pixel", true);
     this.AddToContainer(sLeaser, rCam, rCam.ReturnFContainer("Foreground"));
 }
コード例 #23
0
 private void AddToContainerHook(On.PlayerGraphics.orig_AddToContainer orig, PlayerGraphics self, RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     if (newContatiner == null)
     {
         newContatiner = rCam.ReturnFContainer("Midground");
     }
     for (int i = 0; i < sLeaser.sprites.Length; i++)
     {
         if ((i > 6 && i < 9) || i > 9)
         {
             if (self.player.playerState.slugcatCharacter == PlayerManager.GetCustomPlayer("Electric").SlugcatIndex)
             {
                 if (i == 12)
                 {
                     newContatiner.AddChild(sLeaser.sprites[i]);
                 }
                 else
                 {
                     if (i == 13)
                     {
                         newContatiner.AddChild(sLeaser.sprites[i]);
                     }
                     else
                     {
                         if (i == 14)
                         {
                             newContatiner.AddChild(sLeaser.sprites[i]);
                         }
                         else
                         {
                             rCam.ReturnFContainer("Foreground").AddChild(sLeaser.sprites[i]);
                         }
                     }
                 }
             }
             else
             {
                 if (i == 12)
                 {
                     rCam.ReturnFContainer("Bloom").AddChild(sLeaser.sprites[i]);
                 }
                 else
                 {
                     if (i == 13)
                     {
                         newContatiner.AddChild(sLeaser.sprites[i]);
                     }
                     else
                     {
                         if (i == 14)
                         {
                             newContatiner.AddChild(sLeaser.sprites[i]);
                         }
                         else
                         {
                             rCam.ReturnFContainer("Foreground").AddChild(sLeaser.sprites[i]);
                         }
                     }
                 }
             }
         }
         else
         {
             newContatiner.AddChild(sLeaser.sprites[i]);
         }
     }
 }
コード例 #24
0
ファイル: SnowPile.cs プロジェクト: LeeMoriya/Downpour
 public void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     sLeaser.sprites[0].RemoveFromContainer();
     rCam.ReturnFContainer("Foreground").AddChild(sLeaser.sprites[0]);
 }
コード例 #25
0
            public void Update(float timeStacker)
            {
                if (displaySprite.container != cam.ReturnFContainer("HUD2"))
                {
                    cam.ReturnFContainer("HUD2").AddChild(displaySprite);
                }

                // Create a delegate that gets the current inputs
                if (_getInputs == null)
                {
                    Type rwInput = Type.GetType("RWInput, Assembly-CSharp");
                    _getInputs = (GetRTInputs)Delegate.CreateDelegate(typeof(GetRTInputs), rwInput.GetMethod("PlayerInput", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static));
                }

                // Move the input display when left bracket is pressed
                if (Input.GetKey(KeyCode.LeftBracket))
                {
                    origin = Input.mousePosition;
                    Move();
                }

                // Allow dragging the input display
                if (_dragging)
                {
                    if (!Input.GetMouseButton(0))
                    {
                        _dragging = false;
                    }
                    else
                    {
                        origin = (Vector2)Input.mousePosition + _dragOffset;
                        Move();
                    }
                }
                else
                {
                    if (Input.GetMouseButtonDown(0) && IsMouseOver)
                    {
                        _dragging   = true;
                        _dragOffset = origin - (Vector2)Input.mousePosition;
                    }
                }

                // Change the lerp bar to display the current timeStacker
                _lerpBar.scaleX = timeStacker * _lerpBarWidth;

                // Cache the inputs at the start of the frame. It is not going to change while the buttons are updating
                rtInput = _getInputs(0, cam.game.rainWorld.options, cam.game.rainWorld.setup);
                foreach (InputButton button in buttons)
                {
                    button.Update();
                }

                // Update the analog input
                Vector2 aiCenter  = new Vector2(DrawOrigin.x + _analogRelPos.x + _analogBoxSize * 0.5f - 0.5f, DrawOrigin.y + _analogRelPos.y + _analogBoxSize * 0.5f - 0.5f);
                float   maxOffset = _analogBoxSize * 0.5f - 4f;

                _analogIndicator.SetPosition(aiCenter + CurrentInput.analogueDir * maxOffset);
                _analogRTIndicator.SetPosition(aiCenter + rtInput.analogueDir * maxOffset);
                _analogRTIndicator.isVisible = !hideRTIndicators;

                displaySprite.MoveToFront();
                offscreenContainer.MoveToFront();
            }
コード例 #26
0
 //添加Sprite到HUD Layer
 public override void InitiateSprites(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
 {
     sLeaser.sprites    = new FSprite[1];
     sLeaser.sprites[0] = this.sprite;
     rCam.ReturnFContainer("HUD").AddChild(sLeaser.sprites[0]);
 }
コード例 #27
0
ファイル: Snow.cs プロジェクト: LeeMoriya/Downpour
 public override void AddToContainer(RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, FContainer newContatiner)
 {
     newContatiner = rCam.ReturnFContainer("GrabShaders");
     sLeaser.sprites[0].RemoveFromContainer();
     newContatiner.AddChild(sLeaser.sprites[0]);
 }