using System.Collections; using System.Collections.Generic; using UnityEngine; public class MRWall : MonoBehaviour { // Start is called before the first frame update void Start() { for (int i = 0; i < transform.childCount; i++) { Transform child = transform.GetChild(i); MeshRenderer mesh = child.GetComponent(); if (mesh != null) { #if UNITY_EDITOR mesh.material = Resources.Load("Materials/Wall"); #elif !UNITY_EDITOR && UNITY_ANDROID mesh.material = Resources.Load("Materials/MRWall"); #endif } } } }