protected override void UpdateAndApply(Unity3DTilesetStyle targetStyle, Unity3DTileContent content) { SimpleShaderTilesetStyle target = (SimpleShaderTilesetStyle)targetStyle; // Check to see if style attributes are out of date and lazily update if (target.Shader != this.Shader) { this.Shader = target.Shader; var renderers = content.GetRenderers(); for (int i = 0; i < renderers.Length; i++) { var r = renderers[i]; for (int j = 0; j < r.materials.Length; j++) { r.materials[j].shader = this.Shader; } } } }
/// <summary> /// This method should copy any relevant attributes from the target style to 'this' style /// In cases where the attributes are different the method should update materials on the tile accordingly /// </summary> /// <param name="targetStyle"></param> /// <param name="tile"></param> protected abstract void UpdateAndApply(Unity3DTilesetStyle targetStyle, Unity3DTileContent content);