您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
25 行
722 B
25 行
722 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class LODGroupOverride : MonoBehaviour {
|
|
|
|
public float lodSize = 1.0f;
|
|
public Vector3 localReference = Vector3.zero;
|
|
|
|
// Use this for initialization
|
|
void OnStart () {
|
|
GetComponent<LODGroup>().size = lodSize;
|
|
GetComponent<LODGroup>().localReferencePoint = localReference;
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
void Update () {
|
|
if (GetComponent<LODGroup>().size != lodSize)
|
|
GetComponent<LODGroup>().size = lodSize;
|
|
if (GetComponent<LODGroup>().localReferencePoint != localReference)
|
|
GetComponent<LODGroup>().localReferencePoint = localReference;
|
|
}
|
|
#endif
|
|
}
|