Renderer.materials 和sharedMaterials一些用法上的区别
Not allowed to access Renderer.materials on prefab object. Use Renderer.sharedMaterials instead
UnityEngine.Renderer:get_materials()
如果是Resource.Load的预制件,在代码中用.materials访问会报上述错,要new一份再使用,即 GameObject.Instantiate (res) as GameObject;