test : opti

This commit is contained in:
Ferlat Thibaud
2026-07-03 11:49:25 +02:00
parent 85ab8ebabd
commit fea082bb6f
399 changed files with 1912806 additions and 1893 deletions
@@ -0,0 +1,25 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MB3_DisableHiddenAnimations : MonoBehaviour {
public List<Animation> animationsToCull = new List<Animation>();
void Start () {
if (GetComponent<SkinnedMeshRenderer> () == null) {
Debug.LogError ("The MB3_CullHiddenAnimations script was placed on and object " + name + " which has no SkinnedMeshRenderer attached");
}
}
void OnBecameVisible(){
for (int i = 0; i < animationsToCull.Count; i++) {
if (animationsToCull[i] != null) animationsToCull[i].enabled = true;
}
}
void OnBecameInvisible(){
for (int i = 0; i < animationsToCull.Count; i++) {
if (animationsToCull[i] != null) animationsToCull[i].enabled = false;
}
}
}