准备使用二进制缓存来全面实现高速加载
This commit is contained in:
8
Assets/Assets/Resources/Volume.meta
Normal file
8
Assets/Assets/Resources/Volume.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 09bf3e667692a1341a327b7560df35aa
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
294
Assets/Assets/Resources/Volume/Default.asset
Normal file
294
Assets/Assets/Resources/Volume/Default.asset
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &-6930818438622466647
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 6bd486065ce11414fa40e631affc4900, type: 3}
|
||||||
|
m_Name: ProbeVolumesOptions
|
||||||
|
m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.ProbeVolumesOptions
|
||||||
|
active: 1
|
||||||
|
normalBias:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.05
|
||||||
|
viewBias:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.1
|
||||||
|
scaleBiasWithMinProbeDistance:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
samplingNoise:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.1
|
||||||
|
animateSamplingNoise:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
leakReductionMode:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 2
|
||||||
|
minValidDotProductValue:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.1
|
||||||
|
occlusionOnlyReflectionNormalization:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
intensityMultiplier:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
skyOcclusionIntensityMultiplier:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
worldOffset:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &-3285242745950591362
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
|
||||||
|
m_Name: Bloom
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
active: 1
|
||||||
|
skipIterations:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
threshold:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.9
|
||||||
|
intensity:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
scatter:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.7
|
||||||
|
clamp:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 65472
|
||||||
|
tint:
|
||||||
|
m_OverrideState: 1
|
||||||
|
m_Value: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
highQualityFiltering:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
downscale:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
maxIterations:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 6
|
||||||
|
dirtTexture:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: {fileID: 0}
|
||||||
|
dimension: 1
|
||||||
|
dirtIntensity:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
--- !u!114 &-2940743133789450860
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a074ec59f6e910b4e8c49f57e56cf95a, type: 3}
|
||||||
|
m_Name: VolumetricFogVolumeComponent
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
active: 1
|
||||||
|
distance:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 64
|
||||||
|
baseHeight:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
maximumHeight:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 50
|
||||||
|
enableGround:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
groundHeight:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
density:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.2
|
||||||
|
attenuationDistance:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 128
|
||||||
|
enableAPVContribution:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
APVContributionWeight:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
enableMainLightContribution:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
anisotropy:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.4
|
||||||
|
scattering:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.15
|
||||||
|
tint:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
enableAdditionalLightsContribution:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
maxSteps:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 128
|
||||||
|
blurIterations:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 2
|
||||||
|
enabled:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
renderPassEvent:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 550
|
||||||
|
--- !u!114 &-2307326953841441124
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
|
||||||
|
m_Name: Tonemapping
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
active: 1
|
||||||
|
mode:
|
||||||
|
m_OverrideState: 1
|
||||||
|
m_Value: 2
|
||||||
|
neutralHDRRangeReductionMode:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 2
|
||||||
|
acesPreset:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 3
|
||||||
|
hueShiftAmount:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
detectPaperWhite:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
paperWhite:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 300
|
||||||
|
detectBrightnessLimits:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1
|
||||||
|
minNits:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.005
|
||||||
|
maxNits:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 1000
|
||||||
|
--- !u!114 &11400000
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
|
||||||
|
m_Name: Default
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
components:
|
||||||
|
- {fileID: -2940743133789450860}
|
||||||
|
- {fileID: -3285242745950591362}
|
||||||
|
- {fileID: 531387521984870518}
|
||||||
|
- {fileID: -2307326953841441124}
|
||||||
|
- {fileID: 4550874325240702303}
|
||||||
|
- {fileID: -6930818438622466647}
|
||||||
|
- {fileID: 6698165480939181587}
|
||||||
|
--- !u!114 &531387521984870518
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3}
|
||||||
|
m_Name: ColorAdjustments
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
active: 1
|
||||||
|
postExposure:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
contrast:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
colorFilter:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
hueShift:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
saturation:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
--- !u!114 &4550874325240702303
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 221518ef91623a7438a71fef23660601, type: 3}
|
||||||
|
m_Name: WhiteBalance
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
active: 1
|
||||||
|
temperature:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
tint:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
--- !u!114 &6698165480939181587
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 3
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3}
|
||||||
|
m_Name: MotionBlur
|
||||||
|
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.MotionBlur
|
||||||
|
active: 1
|
||||||
|
mode:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
quality:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0
|
||||||
|
intensity:
|
||||||
|
m_OverrideState: 1
|
||||||
|
m_Value: 0
|
||||||
|
clamp:
|
||||||
|
m_OverrideState: 0
|
||||||
|
m_Value: 0.05
|
||||||
8
Assets/Assets/Resources/Volume/Default.asset.meta
Normal file
8
Assets/Assets/Resources/Volume/Default.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 25c4b60273b147748b67dfd9bd7a6a4d
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Submodule Assets/Convention updated: a3483f23d8...c12d4a3754
@@ -10,8 +10,10 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Unity.Collections;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
namespace Demo
|
namespace Demo
|
||||||
{
|
{
|
||||||
@@ -36,6 +38,53 @@ namespace Demo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ScriptLoadableConfig
|
||||||
|
{
|
||||||
|
public Vector3 EnterGameLocalPosition, EnterGameEulerAngles, EnterGameLocalScaling;
|
||||||
|
public bool IsSetObjectDisable;
|
||||||
|
public int UpdatePerFrame;
|
||||||
|
public string ScriptName;
|
||||||
|
private string[] ChildTypes;
|
||||||
|
public ScriptLoadableConfig[] childs;
|
||||||
|
|
||||||
|
public readonly static Dictionary<string, Func<ScriptLoadableConfig>> ConfigGeneraters = new()
|
||||||
|
{
|
||||||
|
{ nameof(ScriptLoadableConfig), ()=>new ScriptLoadableConfig() }
|
||||||
|
};
|
||||||
|
|
||||||
|
public virtual void Deserialize(BinaryReader reader)
|
||||||
|
{
|
||||||
|
EnterGameLocalPosition = BinarySerializeUtility.ReadVec3(reader);
|
||||||
|
EnterGameEulerAngles = BinarySerializeUtility.ReadVec3(reader);
|
||||||
|
EnterGameLocalScaling = BinarySerializeUtility.ReadVec3(reader);
|
||||||
|
IsSetObjectDisable = BinarySerializeUtility.ReadBool(reader);
|
||||||
|
UpdatePerFrame = BinarySerializeUtility.ReadInt(reader);
|
||||||
|
ScriptName = BinarySerializeUtility.ReadString(reader);
|
||||||
|
ChildTypes = BinarySerializeUtility.DeserializeStringArray(reader);
|
||||||
|
int childCount = ChildTypes.Length;
|
||||||
|
childs = new ScriptLoadableConfig[childCount];
|
||||||
|
for (int i = 0; i < childCount; i++)
|
||||||
|
{
|
||||||
|
childs[i] = ConfigGeneraters[ChildTypes[i]].Invoke();
|
||||||
|
childs[i].Deserialize(reader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public virtual void Serialize(BinaryWriter writer)
|
||||||
|
{
|
||||||
|
BinarySerializeUtility.WriteVec3(writer, EnterGameLocalPosition);
|
||||||
|
BinarySerializeUtility.WriteVec3(writer, EnterGameEulerAngles);
|
||||||
|
BinarySerializeUtility.WriteVec3(writer, EnterGameLocalScaling);
|
||||||
|
BinarySerializeUtility.WriteBool(writer, IsSetObjectDisable);
|
||||||
|
BinarySerializeUtility.WriteInt(writer, UpdatePerFrame);
|
||||||
|
BinarySerializeUtility.WriteString(writer, ScriptName);
|
||||||
|
BinarySerializeUtility.SerializeArray(writer, ChildTypes);
|
||||||
|
foreach (var child in childs)
|
||||||
|
{
|
||||||
|
child.Serialize(writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public partial class ScriptableObject : IScriptableObject
|
public partial class ScriptableObject : IScriptableObject
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user