Quantcast
Channel: Latest Questions by ShadyProductions
Viewing all articles
Browse latest Browse all 31

Using variables inside a GameObject[] array

$
0
0
Hello fellow programmers, I'm trying to use a class inside my GameObject[] array so I can access them in the inspector however, I'm not entirely sure how to do that, right now what I got is something like the following: ![alt text][1] However I would like to achieve something like this: ![alt text][2] This is the base of my code right now: [System.Serializable] public class tiles { public GameObject[] Plants; public GameObject[] Trees; public GameObject[] Rocks; } [System.Serializable] public class tileFunctions { public bool isInteractive; //can u click on it and do things with it? public bool isUsed; //is it on cooldown after use? public int maxReceivings; //if gathered how many items max } I would like to use the tileFunctions inside Plants, Trees and Rocks. So that I could use them as follows for example: groundTiles[0].Plants[0].isUsed Thanks! Regards, Shady. [1]: /storage/temp/60944-13937-capture2.jpg [2]: /storage/temp/60945-13938-capture.jpg

Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>