示例#1
0
 private void ClearUnitySpriteDataForSpriteIds(HashSet <int> spriteIds)
 {
     foreach (int spriteId in spriteIds)
     {
         SpriteDesign spriteDesign = this.spriteDictionaryById[spriteId];
         if (spriteDesign != null)
         {
             spriteDesign.ClearUnitySpriteData(true);
         }
     }
 }
示例#2
0
        private void ParseSprite(string xml)
        {
            SpriteDesign spriteDesign = PSObject.Deserialize <SpriteDesign>(xml);

            if (!this.spriteDictionaryByKey.ContainsKey(spriteDesign.SpriteKey))
            {
                this.spriteDictionaryByKey.Add(spriteDesign.SpriteKey, spriteDesign);
            }
            if (this.spriteDictionaryById.ContainsKey(spriteDesign.SpriteId))
            {
                return;
            }
            this.spriteDictionaryById.Add(spriteDesign.SpriteId, spriteDesign);
        }
示例#3
0
        public void InitializeShipSprites(ShipEntity shipEntity, PSShip psShip)
        {
            Vector2 vector2;

            // ISSUE: explicit reference operation
            ((Vector2)@vector2).\u002Ector((float)psShip.columns * 25f, (float)psShip.rows * 25f);
            Sprite unitySprite1 = psShip.ShipDesign.InteriorSprite.UnitySprite;

            ((SpriteRenderer)shipEntity.shipInterior.GetComponent <SpriteRenderer>()).set_sprite(unitySprite1);
            Sprite unitySprite2 = psShip.ShipDesign.ExteriorSprite.UnitySprite;

            ((SpriteRenderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).set_sprite(unitySprite2);
            Vector2 size = ((SpriteRenderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).get_size();

            ((BoxCollider)shipEntity.shipExterior.GetComponent <BoxCollider>()).set_size(Vector2.op_Implicit(new Vector2(Mathf.Abs((float)size.x), Mathf.Abs((float)size.y))));
            ((SpriteRenderer)shipEntity.skinLayer.GetComponent <SpriteRenderer>()).set_sprite(unitySprite2);
            ((SpriteMask)shipEntity.stickerLayer.GetComponent <SpriteMask>()).set_sprite(unitySprite2);
            ShipBattleEntity shipBattleEntity = shipEntity as ShipBattleEntity;
            Material         material         = Object.Instantiate(Resources.Load("SpriteMask")) as Material;

            if (Object.op_Inequality((Object)shipBattleEntity, (Object)null))
            {
                ((SpriteRenderer)shipBattleEntity.cloakOverlayLayer.GetComponent <SpriteRenderer>()).set_sprite(unitySprite2);
                ((Renderer)shipBattleEntity.cloakOverlayLayer.GetComponent <SpriteRenderer>()).set_material(material);
            }
            ((SpriteRenderer)shipEntity.innerLayer.GetComponent <SpriteRenderer>()).set_sprite(unitySprite1);
            ((Renderer)shipEntity.innerLayer.GetComponent <SpriteRenderer>()).set_material(material);
            Sprite         unitySprite3 = psShip.ShipDesign.ShieldSprite.UnitySprite;
            SpriteRenderer component    = (SpriteRenderer)shipEntity.shipShield.GetComponent <SpriteRenderer>();

            component.set_sprite(unitySprite3);
            component.set_drawMode((SpriteDrawMode)1);
            component.set_size(vector2);
            component.set_drawMode((SpriteDrawMode)0);
            SpriteDesign spriteDesign = psShip.SkinItemDesignId != 0 ? psShip.SkinItemDesign.LogoSprite : SingletonManager <SpriteManager> .Instance.GetSpriteByKey("blankPixel");

            ((SpriteRenderer)shipEntity.exteriorSkin.GetComponent <SpriteRenderer>()).set_sprite(spriteDesign.UnitySprite);
            ((RectTransform)((Component)shipEntity).GetComponent <RectTransform>()).set_sizeDelta(vector2);
        }