Files
valheim/Assets/_Valheim/Scripts/MRWall.cs
2025-07-04 14:16:14 +08:00

26 lines
672 B
C#

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<MeshRenderer>();
if (mesh != null)
{
#if UNITY_EDITOR
mesh.material = Resources.Load<Material>("Materials/Wall");
#elif !UNITY_EDITOR && UNITY_ANDROID
mesh.material = Resources.Load<Material>("Materials/MRWall");
#endif
}
}
}
}