/// <summary> /// Recursively set team color into any nodes that use it /// </summary> public static void SetPaintColors(this SCNNode node) { var geometry = node?.Geometry; if (geometry != null) { // paintColor can be UIColor or SCNVector4 var paintColor = node.GetTeam().GetColor(); if (geometry.HasUniform(PaintMaskColorKey)) { geometry.SetColor(PaintMaskColorKey, paintColor); } var lods = geometry.LevelsOfDetail; if (lods != null) { foreach (var lod in lods) { if (lod?.Geometry != null && lod.Geometry.HasUniform(PaintMaskColorKey)) { lod.Geometry.SetColor(PaintMaskColorKey, paintColor); } } } } foreach (var child in node.ChildNodes) { child.SetPaintColors(); } }