This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -0,0 +1,20 @@
{
"name": "BITKit.AdvancedCullingSystem.Runtime",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:a2097016d65c6554fb43a19198fc2220",
"GUID:37151e2099022af42afa90e2ee1b768a"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [
"BITKit_AdvancedCullingSystem"
],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b284ad199c316f24aa09a15a890f73ea
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,45 @@
using System;
using System.Collections;
using System.Collections.Generic;
using MeshCombineStudio;
using NGS.AdvancedCullingSystem.Dynamic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace BITKit.OpenWorld
{
public class OpenWorldCombiner : MonoBehaviour
{
[SerializeField] private MeshCombiner meshCombiner;
private void Start()
{
meshCombiner.onCombiningReady += AddCullingSource;
}
private void AddCullingSource(MeshCombiner meshcombiner)
{
AddCullingSource();
}
[BIT]
private void AddCullingSource()
{
var reportBuilder = new System.Text.StringBuilder();
var renderers = meshCombiner.GetComponentsInChildren<MeshRenderer>(true);
reportBuilder.AppendLine($"找到{renderers.Length}个Renderer");
foreach (var x in renderers)
{
if (x.GetComponent<DC_SourceSettings>()) continue;
x.gameObject.AddComponent<DC_SourceSettings>();
reportBuilder.AppendLine($"为{x.name}添加了DC_SourceSettings");
}
Debug.Log(reportBuilder.ToString());
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7ec9c7ceed8819847905c385597d70f0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: