Ejemplo n.º 1
0
        public static void HandleFacecards(PlayerController player, CustomCharacterData data)
        {
            var atlas    = uiAtlas;
            var atlasTex = atlas.Texture;

            dfAtlas.ItemInfo info = new dfAtlas.ItemInfo();
            info.name         = player.name + "_facecard";
            info.region       = TextureStitcher.AddFaceCardToAtlas(data.faceCard, atlasTex, uiFaceCards.Count, uiFacecardBounds);
            info.sizeInPixels = faceCardSizeInPixels;

            atlas.AddItem(info);

            if (atlas.Replacement)
            {
                atlas.Replacement.Material.mainTexture = atlasTex;
            }

            uiFaceCards.Add(info);
        }
Ejemplo n.º 2
0
        public static void HandlePunchoutFaceCards(CustomCharacterData data)
        {
            var atlas    = uiAtlas;
            var atlasTex = atlas.Texture;

            if (data.punchoutFaceCards != null)
            {
                Tools.Print("Adding punchout facecards");
                int count = Mathf.Min(data.punchoutFaceCards.Count, 3);
                for (int i = 0; i < count; i++)
                {
                    dfAtlas.ItemInfo info = new dfAtlas.ItemInfo();
                    info.name         = data.nameInternal + "_punchout_facecard" + (i + 1);
                    info.region       = TextureStitcher.AddFaceCardToAtlas(data.punchoutFaceCards[i], atlasTex, uiFaceCards.Count, uiFacecardBounds);
                    info.sizeInPixels = faceCardSizeInPixels;

                    atlas.AddItem(info);
                    uiFaceCards.Add(info);
                }
            }
        }