- Home /
Question by
Edward3th · Dec 11, 2017 at 06:28 PM ·
guiscript.guitexture
Why arent the cards being displayed????
Im trying to build a deck builder, but when iplace the card, the textures arent bein draw. anyone understand why??
void DrawDeckBuilder(){
// Open scroll GUI
scrollPosition1 = GUI.BeginScrollView (VisibleRect1, scrollPosition1, InvisibleRect1);
for (int i = 0; i < DeckSize; i++) {
Rect cardSlotRect = new Rect (i * 0.21f * w, 0, w * 0.2f, h * 0.4f);
// Checks if there is a card to show his texture
if (deck [i].cardName != "") {
GUI.Box (cardSlotRect, deck [i].cardTexture);
} else {
GUI.Box (cardSlotRect, "Empty");
}
//// Placing Card from Deck
if (Input.GetMouseButtonUp (0) && draggingCard && cardSlotRect.Contains (Event.current.mousePosition)) {
PlaceCard (deck, draggedCard);
Debug.Log ("Placing card");
}
}
GUI.EndScrollView ();
}
void PlaceCard(List<Card> ListToPlace, Card CardToPlace){
ListToPlace.Add (CardToPlace);
draggedCard = null;
draggingCard = false;
}
Comment
Answer by Edward3th · Dec 11, 2017 at 06:44 PM
I have already solved it , the problem was that i was adding cards to the list instead of filling the empty spaces
Your answer
Follow this Question
Related Questions
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
GUI Final Scene/ Item Pickup 0 Answers
Erroe when resizing GUITextures in C# file 1 Answer
GUI Transparency Changing automatically 2 Answers
Doubt with GUILayout 0 Answers