This commit is contained in:
CortexCore
2024-11-13 17:47:45 +08:00
parent c4af12acd7
commit 416e3322db
208 changed files with 2591757 additions and 1497 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections;
using System.Collections.Generic;
using MeshCombineStudio;
using NGS.AdvancedCullingSystem.Dynamic;
using UnityEngine;
namespace Net.Like.Xue.Tokyo
{
public class WorldOptimizeService : MonoBehaviour
{
[SerializeField] private Transform[] sources;
[SerializeField] private Camera minimapCamera;
private void Awake()
{
GetComponent<MeshCombiner>().onCombiningReady += OnReady;
}
private void OnReady(MeshCombiner meshcombiner)
{
minimapCamera.Render();
minimapCamera.enabled = false;
var controller = gameObject.AddComponent<DC_Controller>();
controller.AddCamera(Camera.main,3000);
foreach (var x in sources)
{
foreach (var renderer in x.GetComponentsInChildren<MeshRenderer>())
{
if (renderer.gameObject.activeInHierarchy)
controller.AddObjectForCulling(renderer);
}
}
}
}
}