1.修改Mesh UV
九张小图合并到一张大图上,然后修改Quad的UV分别取出九张小图。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class MeshTest : MonoBehaviour
{
// Start is called before the first frame update
public GameObject quadGO;
void Start()
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
Vector2 leftBottom = new Vector2(0 + i * 1 / 3f, 0 + j * 1 / 3f);
Vector2 rightBottom = leftBottom + new Vector2(1 / 3f, 0);
Vector2 leftTop = leftBottom + new Vector2(0, 1 / 3f);
Vector2 rightTop = leftBottom + new Vector2(1 / 3f, 1 / 3f);
Vector2[] uv = { leftBottom, rightBottom,