源战役客户端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

25 行
772 B

  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using LuaFramework;
  5. public class MB3_DisableHiddenAnimations : MonoBehaviour {
  6. public List<Animation> animationsToCull = new List<Animation>();
  7. void Start () {
  8. if (GetComponent<SkinnedMeshRenderer> () == null) {
  9. LogManager.LogError ("The MB3_CullHiddenAnimations script was placed on and object " + name + " which has no SkinnedMeshRenderer attached");
  10. }
  11. }
  12. void OnBecameVisible(){
  13. for (int i = 0; i < animationsToCull.Count; i++) {
  14. if (animationsToCull[i] != null) animationsToCull[i].enabled = true;
  15. }
  16. }
  17. void OnBecameInvisible(){
  18. for (int i = 0; i < animationsToCull.Count; i++) {
  19. if (animationsToCull[i] != null) animationsToCull[i].enabled = false;
  20. }
  21. }
  22. }