Esempio n. 1
0
File: UI.cs Progetto: 12cry/testJava
        public void closeViewBuildingCard()
        {
            ctrl.maskBuildingImage.gameObject.SetActive(false);
            List <BuildingCard> buildingCards = U.cpUI.getBuildingCards(cardType);

            if (buildingCards == null)
            {
                return;
            }
            for (int i = 0; i < buildingCards.Count; i++)
            {
                BuildingCard card = buildingCards[i];
                U.hideCard(card.ctrl);
            }
        }
Esempio n. 2
0
File: UI.cs Progetto: 12cry/testJava
        public void viewBuildingCard(int cardType)
        {
            this.cardType = cardType;

            ctrl.maskBuildingImage.gameObject.SetActive(true);
            ctrl.maskBuildingImage.transform.SetAsLastSibling();
            List <BuildingCard> buildingCards = U.cpUI.getBuildingCards(cardType);

            for (int i = 0; i < buildingCards.Count; i++)
            {
                BuildingCard card = buildingCards[i];
                card.ctrl.gameObject.transform.localPosition = new Vector3(i * 100 - 200, 0, 0);
                card.ctrl.gameObject.transform.localScale    = new Vector2(3, 3);
                card.ctrl.gameObject.transform.SetAsLastSibling();
            }
        }
 Texture2D SetTextureStats(Texture2D texture, BuildingCard card)
 {
     Texture2D healthTexture = (Texture2D) Resources.Load("GUI/Cards/health/" + TranslateFactionToColourString() + "/health" + card.Health);
     int healthHeight = healthTexture.height;
     int healthWidth = healthTexture.width;
     var health = healthTexture.GetPixels(0, 0, healthWidth, healthHeight);
     texture.SetPixels(154,165, healthWidth, healthHeight, health);
     Texture2D attackTexture = (Texture2D) Resources.Load("GUI/Cards/attack/" + TranslateFactionToColourString() + "/attack" + card.Attack);
     int attackHeight = attackTexture.height;
     int attackWidth = attackTexture.width;
     var attack = attackTexture.GetPixels(0, 0, attackWidth, attackHeight);
     texture.SetPixels(46,164, attackWidth, attackHeight, attack);
     return texture;
 }