Quantcast
Channel: Answers by "IvovdMarel"
Viewing all articles
Browse latest Browse all 145

Answer by IvovdMarel

$
0
0
You could use Unity's OnValidate method, which will run every time values have changed in the inspector. https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html Simply check foreach(GameObject go in myList) { if (go.transform.parent != this.transform) { Debug.LogWarning(go.name + " can't be added to this list, since it's not a direct child of " + this.name); go = null; } }

Viewing all articles
Browse latest Browse all 145

Trending Articles



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