摄像机区域的架构改动

This commit is contained in:
2026-05-15 14:47:24 +08:00
parent 1b37297585
commit f264329751
3591 changed files with 1687228 additions and 446503 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace SpriteShadersUltimate
{
public class MaterialInstancerSSU : InstancerSSU
{
void Awake()
{
Graphic graphic = GetComponent<Graphic>();
if(graphic != null)
{
graphic.material = Instantiate(graphic.material);
runtimeMaterial = graphic.materialForRendering;
}
Renderer renderer = GetComponent<Renderer>();
if(renderer != null)
{
Material[] materials = renderer.sharedMaterials;
for(int n = 0; n < materials.Length; n++)
{
materials[n] = Instantiate(materials[n]);
}
renderer.materials = renderer.sharedMaterials = materials;
runtimeMaterial = materials[0];
}
}
}
}