Question by
unity_AErXjdsZNgn08A · May 26, 2020 at 03:50 PM ·
unity 2dupdate functionforloopcounting
How to count integer number inside a forloop in update function?
public bool isSwitch == false void Update() { for (int i = 0; i < slots.Length; i++) { if (slots[i].letter != null) { if (slots[i].letter.GetComponent().sprite.name == letters[i].GetComponent().sprite.name && isSwitch == false) { count++; isSwitch = true; } } } Debug.Log(count);
}
Comment
Your answer
Follow this Question
Related Questions
Play mode working differently on different computers 0 Answers
Unity2D Need Help in Multiple Enemies Shooting Script 0 Answers
Sprites Showing up Behind Tilemap??? 3 Answers
Upload WebGL Unblocked 0 Answers