BITFALL/Assets/BITKit/Unity/Scripts/Components/AutoFixSkinnedMeshRenderer.cs

24 lines
472 B
C#
Raw Normal View History

2023-11-21 18:05:18 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class AutoFixSkinnedMeshRenderer : MonoBehaviour
{
private void Start()
{
2023-12-15 00:08:02 +08:00
foreach (var x in GetComponentsInChildren<Renderer>(true))
2023-11-21 18:05:18 +08:00
{
2023-12-15 00:08:02 +08:00
if (x is SkinnedMeshRenderer skinnedMeshRenderer)
{
skinnedMeshRenderer.updateWhenOffscreen = true;
}
2023-11-21 18:05:18 +08:00
x.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
}
}
}
}