|
@@ -30,9 +30,13 @@ public class StaticLod : MonoBehaviour
|
|
|
StaticImportant si = this.transform.GetChild(i).GetComponent<StaticImportant>();
|
|
|
if (si != null)
|
|
|
{
|
|
|
- staticImportants.Add(si);
|
|
|
+ if (si.important)
|
|
|
+ {
|
|
|
+ staticImportants.Add(si);
|
|
|
+ //si.Hide();
|
|
|
+ }
|
|
|
staticImportantsDic.Add(si.gameObject.name, si);
|
|
|
- si.Hide();
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -72,40 +76,48 @@ public class StaticLod : MonoBehaviour
|
|
|
void Update()
|
|
|
{
|
|
|
interVal -= Time.deltaTime;
|
|
|
- if (lodAvalible)
|
|
|
+ if (CameraManager.instance.mainCamera.enabled)
|
|
|
{
|
|
|
- if (interVal < 0.0f)
|
|
|
+ if (lodAvalible)
|
|
|
{
|
|
|
- interVal = 0.8f;
|
|
|
- for (int i = 0; i < staticImportants.Count; i++)
|
|
|
+ if (interVal < 0.0f)
|
|
|
{
|
|
|
- if (Vector3.Distance(CameraManager.instance.mainCamera.transform.position, staticImportants[i].foucusPos) < 3200)
|
|
|
+ interVal = 0.8f;
|
|
|
+ for (int i = 0; i < staticImportants.Count; i++)
|
|
|
{
|
|
|
- staticImportants[i].Show();
|
|
|
+ if (Vector3.Distance(CameraManager.instance.mainCamera.transform.position, staticImportants[i].foucusPos) < 3200)
|
|
|
+ {
|
|
|
+ staticImportants[i].Show();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ staticImportants[i].Hide();
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- staticImportants[i].Hide();
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- if (hetiGaoLiang != null) {
|
|
|
- if (CameraManager.instance.mainCamera.transform.position.y > 3000)
|
|
|
+ if (hetiGaoLiang != null)
|
|
|
{
|
|
|
- hetiGaoLiang.gameObject.SetActive(true);
|
|
|
- }
|
|
|
- else{
|
|
|
- hetiGaoLiang.gameObject.SetActive(false);
|
|
|
+ if (CameraManager.instance.mainCamera.transform.position.y > 3000)
|
|
|
+ {
|
|
|
+ hetiGaoLiang.gameObject.SetActive(true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ hetiGaoLiang.gameObject.SetActive(false);
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
- for (int i = 0; i < staticImportants.Count; i++)
|
|
|
+ else
|
|
|
{
|
|
|
- staticImportants[i].Show();
|
|
|
+ for (int i = 0; i < staticImportants.Count; i++)
|
|
|
+ {
|
|
|
+ staticImportants[i].Show();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|