一、不使用MaterialPropertyBlock效果
每更改一次颜色会重新实例化一份材质、不能进行动态合批,当物体比较多时Drawcall会比较高
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MaterialTest : MonoBehaviour
{
public List< MeshRenderer> list;
// Start is called before the first frame update
void Start()
{
for (int i = 0; i <list.Count ; i++)
{
if (i % 2 == 0)
{
list[i].material.color = Color.white;
}
else
{