暂且修了LookAt

This commit is contained in:
SoulliesOfficial
2025-07-13 06:06:38 -04:00
parent 7642bf1d9d
commit b00eb6505b
52 changed files with 32852 additions and 16272 deletions

View File

@@ -1,28 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class ShaderExtension
{
/// <summary>
/// 对于从AssetBundle中加载的材质修改Shader参数可能会出现异常情况。
/// 此时需要在生成物体的时候重新初始化Shader。
/// </summary>
public static void InitializeShader(this Renderer renderer)
{
foreach (Material material in renderer.materials)
{
string shaderName = material.shader.name;
Shader shader = Shader.Find(shaderName);
if (shader != null)
{
material.shader = shader;
}
else
{
Debug.LogWarning($"Shader '{shaderName}' not found for material '{material.name}' on renderer '{renderer.name}'.");
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b74e31a7b06bb9743b629a923718f2c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: