浏览代码

Fixed custom renderer for latest SRP

Updated Navmesh
Tweaked some materials
/main
Andre McGrail 6 年前
当前提交
b1f6c73f
共有 27 个文件被更改,包括 1762 次插入1757 次删除
  1. 1001
      Assets/MainIsland.asset
  2. 2
      Assets/NavMeshComponents.meta
  3. 149
      Assets/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs
  4. 47
      Assets/NavMeshComponents/Scripts/NavMeshSurface.cs
  5. 5
      Assets/Objects/boats/Interceptor.mat
  6. 8
      Assets/Objects/environment/Trees/Materials/Softvegetation.mat
  7. 8
      Assets/Objects/environment/Trees/Materials/Trees.mat
  8. 5
      Assets/Objects/environment/Trees/Materials/Trees_billboards.mat
  9. 13
      Assets/Objects/props/houses/Materials/Matr_BuildingsJettys.mat
  10. 5
      Assets/Objects/props/props/Matr_Props.mat
  11. 5
      Assets/Objects/props/props/Matr_Props_Hue.mat
  12. 225
      Assets/Objects/props/props/Prefabs/Geo_Props_Paraglider.prefab
  13. 127
      Assets/Scripts/Rendering/MyLWRenderer.cs
  14. 19
      Assets/Scripts/Rendering/WaterFXPass.cs
  15. 16
      Assets/Shaders/LWVegetationShader.shader
  16. 16
      Assets/Shaders/PackedPBR.ShaderGraph
  17. 5
      Assets/Textures/Island/Materials/BushTest.mat
  18. 904
      Assets/scenes/Island.unity
  19. 23
      Assets/scenes/Island_Profiles/PostVolumeGlobal Profile.asset
  20. 174
      Assets/scenes/Testing/meshSetups.unity
  21. 325
      Assets/NavMeshComponents/Editor/NavMeshAssetManager.cs
  22. 11
      Assets/NavMeshComponents/Editor/NavMeshAssetManager.cs.meta
  23. 8
      Assets/Plugins.meta
  24. 71
      Assets/_TerrainAutoUpgrade/Terrain.mat
  25. 8
      Assets/_TerrainAutoUpgrade/Terrain.mat.meta
  26. 332
      Assets/scenes/Testing/Terrain.unity
  27. 7
      Assets/scenes/Testing/Terrain.unity.meta

1001
Assets/MainIsland.asset
文件差异内容过多而无法显示
查看文件

2
Assets/NavMeshComponents.meta


fileFormatVersion: 2
guid: 9f8f6a817c109fe4695cc1dc9bc269c1
guid: 7ba59ca44540c45eea584dbe9a47c28a
folderAsset: yes
DefaultImporter:
externalObjects: {}

149
Assets/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs


#define NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
using UnityEditor.Experimental.SceneManagement;
using UnityEditor.IMGUI.Controls;
using UnityEditor.SceneManagement;
using UnityEditorInternal;

SerializedProperty m_UseGeometry;
SerializedProperty m_VoxelSize;
#if NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
SerializedProperty m_NavMeshData;
#endif
class Styles
{
public readonly GUIContent m_LayerMask = new GUIContent("Include Layers");

public readonly GUIContent m_ShowPolyMeshDetail = new GUIContent("Show Poly Mesh Detail");
}
struct AsyncBakeOperation
{
public NavMeshSurface surface;
public NavMeshData bakeData;
public AsyncOperation bakeOperation;
}
static List<AsyncBakeOperation> s_BakeOperations = new List<AsyncBakeOperation>();
static Styles s_Styles;
static bool s_ShowDebugOptions;

m_UseGeometry = serializedObject.FindProperty("m_UseGeometry");
m_VoxelSize = serializedObject.FindProperty("m_VoxelSize");
#if NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
m_NavMeshData = serializedObject.FindProperty("m_NavMeshData");
#endif
NavMeshVisualizationSettings.showNavigation++;
}

}
static string GetAndEnsureTargetPath(NavMeshSurface surface)
{
// Create directory for the asset if it does not exist yet.
var activeScenePath = surface.gameObject.scene.path;
var targetPath = "Assets";
if (!string.IsNullOrEmpty(activeScenePath))
targetPath = Path.Combine(Path.GetDirectoryName(activeScenePath), Path.GetFileNameWithoutExtension(activeScenePath));
if (!Directory.Exists(targetPath))
Directory.CreateDirectory(targetPath);
return targetPath;
}
static void CreateNavMeshAsset(NavMeshSurface surface)
{
var targetPath = GetAndEnsureTargetPath(surface);
var combinedAssetPath = Path.Combine(targetPath, "NavMesh-" + surface.name + ".asset");
combinedAssetPath = AssetDatabase.GenerateUniqueAssetPath(combinedAssetPath);
AssetDatabase.CreateAsset(surface.navMeshData, combinedAssetPath);
}
static NavMeshData GetNavMeshAssetToDelete(NavMeshSurface navSurface)
{
var prefabType = PrefabUtility.GetPrefabType(navSurface);
if (prefabType == PrefabType.PrefabInstance || prefabType == PrefabType.DisconnectedPrefabInstance)
{
// Don't allow deleting the asset belonging to the prefab parent
var parentSurface = PrefabUtility.GetCorrespondingObjectFromSource(navSurface) as NavMeshSurface;
if (parentSurface && navSurface.navMeshData == parentSurface.navMeshData)
return null;
}
return navSurface.navMeshData;
}
void ClearSurface(NavMeshSurface navSurface)
{
var assetToDelete = GetNavMeshAssetToDelete(navSurface);
navSurface.RemoveData();
navSurface.navMeshData = null;
EditorUtility.SetDirty(navSurface);
if (assetToDelete)
{
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(assetToDelete));
EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene);
}
}
Bounds GetBounds()
{
var navSurface = (NavMeshSurface)target;

EditorGUILayout.PropertyField(m_LayerMask, s_Styles.m_LayerMask);
EditorGUILayout.PropertyField(m_UseGeometry);
EditorGUILayout.Space();
EditorGUILayout.Space();

if (!m_OverrideTileSize.hasMultipleDifferentValues)
{
if (m_OverrideTileSize.boolValue)
EditorGUILayout.HelpBox("Tile size controls the how local the changes to the world are (rebuild or carve). Small tile size allows more local changes, while potentially generating more data in overal.", MessageType.None);
EditorGUILayout.HelpBox("Tile size controls the how local the changes to the world are (rebuild or carve). Small tile size allows more local changes, while potentially generating more data overall.", MessageType.None);
}
EditorGUI.indentLevel--;
}

if (hadError)
EditorGUILayout.Space();
#if NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
var nmdRect = EditorGUILayout.GetControlRect(true, EditorGUIUtility.singleLineHeight);
EditorGUI.BeginProperty(nmdRect, GUIContent.none, m_NavMeshData);
var rectLabel = EditorGUI.PrefixLabel(nmdRect, GUIUtility.GetControlID(FocusType.Passive), new GUIContent(m_NavMeshData.displayName));
EditorGUI.EndProperty();
using (new EditorGUI.DisabledScope(true))
{
EditorGUI.BeginProperty(nmdRect, GUIContent.none, m_NavMeshData);
EditorGUI.ObjectField(rectLabel, m_NavMeshData, GUIContent.none);
EditorGUI.EndProperty();
}
#endif
using (new EditorGUI.DisabledScope(Application.isPlaying || m_AgentTypeID.intValue == -1))
{
GUILayout.BeginHorizontal();

foreach (NavMeshSurface s in targets)
ClearSurface(s);
NavMeshAssetManager.instance.ClearSurfaces(targets);
// Remove first to avoid double registration of the callback
EditorApplication.update -= UpdateAsyncBuildOperations;
EditorApplication.update += UpdateAsyncBuildOperations;
foreach (NavMeshSurface surf in targets)
{
var oper = new AsyncBakeOperation();
oper.bakeData = InitializeBakeData(surf);
oper.bakeOperation = surf.UpdateNavMesh(oper.bakeData);
oper.surface = surf;
s_BakeOperations.Add(oper);
}
NavMeshAssetManager.instance.StartBakingSurfaces(targets);
}
GUILayout.EndHorizontal();

for (int i = s_BakeOperations.Count - 1; i >= 0; --i)
var bakeOperations = NavMeshAssetManager.instance.GetBakeOperations();
for (int i = bakeOperations.Count - 1; i >= 0; --i)
if (!targets.Contains(s_BakeOperations[i].surface))
if (!targets.Contains(bakeOperations[i].surface))
var oper = s_BakeOperations[i].bakeOperation;
var oper = bakeOperations[i].bakeOperation;
if (oper == null)
continue;

if (GUILayout.Button("Cancel", EditorStyles.miniButton))
{
var bakeData = s_BakeOperations[i].bakeData;
var bakeData = bakeOperations[i].bakeData;
s_BakeOperations.RemoveAt(i);
bakeOperations.RemoveAt(i);
}
EditorGUI.ProgressBar(EditorGUILayout.GetControlRect(), p, "Baking: " + (int)(100 * p) + "%");

GUILayout.EndHorizontal();
}
}
static NavMeshData InitializeBakeData(NavMeshSurface surface)
{
var emptySources = new List<NavMeshBuildSource>();
var emptyBounds = new Bounds();
return UnityEngine.AI.NavMeshBuilder.BuildNavMeshData(surface.GetBuildSettings(), emptySources, emptyBounds
, surface.transform.position, surface.transform.rotation);
}
static void UpdateAsyncBuildOperations()
{
foreach (var oper in s_BakeOperations)
{
if (oper.surface == null || oper.bakeOperation == null)
continue;
if (oper.bakeOperation.isDone)
{
var surface = oper.surface;
var delete = GetNavMeshAssetToDelete(surface);
if (delete != null)
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(delete));
surface.RemoveData();
surface.navMeshData = oper.bakeData;
if (surface.isActiveAndEnabled)
surface.AddData();
CreateNavMeshAsset(surface);
EditorSceneManager.MarkSceneDirty(surface.gameObject.scene);
}
}
s_BakeOperations.RemoveAll(o => o.bakeOperation == null || o.bakeOperation.isDone);
if (s_BakeOperations.Count == 0)
EditorApplication.update -= UpdateAsyncBuildOperations;
}
[DrawGizmo(GizmoType.Selected | GizmoType.Active | GizmoType.Pickable)]

47
Assets/NavMeshComponents/Scripts/NavMeshSurface.cs


using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.SceneManagement;
#endif
namespace UnityEngine.AI
{

Children = 2,
}
[ExecuteInEditMode]
[ExecuteAlways]
[DefaultExecutionOrder(-102)]
[AddComponentMenu("Navigation/NavMeshSurface", 30)]
[HelpURL("https://github.com/Unity-Technologies/NavMeshComponents#documentation-draft")]

public void AddData()
{
#if UNITY_EDITOR
var isInPreviewScene = EditorSceneManager.IsPreviewSceneObject(this);
var isPrefab = isInPreviewScene || EditorUtility.IsPersistent(this);
if (isPrefab)
{
//Debug.LogFormat("NavMeshData from {0}.{1} will not be added to the NavMesh world because the gameObject is a prefab.",
// gameObject.name, name);
return;
}
#endif
if (m_NavMeshDataInstance.valid)
return;

static void Register(NavMeshSurface surface)
{
#if UNITY_EDITOR
var isInPreviewScene = EditorSceneManager.IsPreviewSceneObject(surface);
var isPrefab = isInPreviewScene || EditorUtility.IsPersistent(surface);
if (isPrefab)
{
//Debug.LogFormat("NavMeshData from {0}.{1} will not be added to the NavMesh world because the gameObject is a prefab.",
// surface.gameObject.name, surface.name);
return;
}
#endif
if (s_NavMeshSurfaces.Count == 0)
NavMesh.onPreUpdate += UpdateActive;

void AppendModifierVolumes(ref List<NavMeshBuildSource> sources)
{
#if UNITY_EDITOR
var myStage = StageUtility.GetStage(gameObject);
if (!myStage.IsValid())
return;
#endif
// Modifiers
List<NavMeshModifierVolume> modifiers;
if (m_CollectObjects == CollectObjects.Children)

continue;
if (!m.AffectsAgentType(m_AgentTypeID))
continue;
#if UNITY_EDITOR
if (!myStage.Contains(m.gameObject))
continue;
#endif
var mcenter = m.transform.TransformPoint(m.center);
var scale = m.transform.lossyScale;
var msize = new Vector3(m.size.x * Mathf.Abs(scale.x), m.size.y * Mathf.Abs(scale.y), m.size.z * Mathf.Abs(scale.z));

markups.Add(markup);
}
var scene = gameObject.scene;
NavMeshBuilder.CollectSources(null, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
NavMeshBuilder.CollectSources(null, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
NavMeshBuilder.CollectSources(transform, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
NavMeshBuilder.CollectSources(transform, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
NavMeshBuilder.CollectSources(worldBounds, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
NavMeshBuilder.CollectSources(worldBounds, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
}
if (m_IgnoreNavMeshAgent)

return false;
// Prefab parent owns the asset reference
var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this);
if (prefabType == UnityEditor.PrefabType.Prefab)
var isInPreviewScene = EditorSceneManager.IsPreviewSceneObject(this);
var isPersistentObject = EditorUtility.IsPersistent(this);
if (isInPreviewScene || isPersistentObject)
return false;
// An instance can share asset reference only with its prefab parent

5
Assets/Objects/boats/Interceptor.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

8
Assets/Objects/environment/Trees/Materials/Softvegetation.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS_OFF _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_NORMALMAP _VERTEXANIMATION
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS_OFF _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _VERTEXANIMATION
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: 2100
stringTagMap: {}

8
Assets/Objects/environment/Trees/Materials/Trees.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS _METALLICGLOSSMAP _METALLICSPECGLOSSMAP
_NORMALMAP _VERTEXANIMATION
m_ShaderKeywords: _ALPHATEST_ON _CORRECTNORMALS _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP _VERTEXANIMATION
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: 2090
stringTagMap: {}

5
Assets/Objects/environment/Trees/Materials/Trees_billboards.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

13
Assets/Objects/props/houses/Materials/Matr_BuildingsJettys.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_ShaderKeywords: _METALLICGLOSSMAP _METALLICSPECGLOSSMAP _NORMALMAP
m_LightmapFlags: 6
m_ShaderKeywords: _ALPHATEST_ON _NORMALMAP _SPECULAR_SETUP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1

m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _AlphaClip: 1
- _Blend: 1
- _BumpScale: 1
- _Cull: 2
- _Cutoff: 0.5

- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _WorkflowMode: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}

5
Assets/Objects/props/props/Matr_Props.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

5
Assets/Objects/props/props/Matr_Props_Hue.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}

225
Assets/Objects/props/props/Prefabs/Geo_Props_Paraglider.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1259152042251220}
m_IsPrefabAsset: 1
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4737683640255136}

m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1946923849596348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4634696468443324}
- component: {fileID: 198632074567173708}
- component: {fileID: 199631009938714948}
m_Layer: 0
m_Name: SmokeStream
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4634696468443324
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1946923849596348}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.09, y: 0.38, z: 1.84}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 4737683640255136}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1259152042251220}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: -0, y: 0, z: 0}

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 3.134923, y: 180, z: -13.045592}
--- !u!33 &33756715387083732
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1259152042251220}
m_Mesh: {fileID: 4300012, guid: 92a669df93f0d4f99bd8fa27767e8c9e, type: 3}
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1259152042251220}
m_Enabled: 1
m_CastShadows: 1

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 6c4afa94b8fa7420db63510a39dd63ba, type: 2}
m_StaticBatchInfo:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &33756715387083732
MeshFilter:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1259152042251220}
m_Mesh: {fileID: 4300012, guid: 92a669df93f0d4f99bd8fa27767e8c9e, type: 3}
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1259152042251220}
m_Enabled: 1
serializedVersion: 3

m_CullingType: 1
--- !u!114 &114362669963921510
MonoBehaviour:
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1259152042251220}
m_Enabled: 1
m_EditorHideFlags: 0

--- !u!1 &1946923849596348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4634696468443324}
- component: {fileID: 198632074567173708}
- component: {fileID: 199631009938714948}
m_Layer: 0
m_Name: SmokeStream
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4634696468443324
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1946923849596348}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.09, y: 0.38, z: 1.84}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 4737683640255136}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
looping: 1
prewarm: 0
playOnAwake: 1

m_PostInfinity: 2
m_RotationOrder: 4
ShapeModule:
serializedVersion: 5
serializedVersion: 6
enabled: 1
type: 4
angle: 25

placementMode: 0
m_MeshMaterialIndex: 0
m_MeshNormalOffset: 0
m_MeshSpawn:
mode: 0
spread: 0
speed:
serializedVersion: 2
minMaxState: 0
scalar: 1
minScalar: 1
maxCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
minCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Mesh: {fileID: 0}
m_MeshRenderer: {fileID: 0}
m_SkinnedMeshRenderer: {fileID: 0}

m_Curve:
- serializedVersion: 3
time: 0
value: 0.064293124
value: 0.1729891
inSlope: 1.4217017
outSlope: 1.4217017
tangentMode: 0

serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 0}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0.4716981, g: 0.4716981, b: 0.4716981, a: 0}
key2: {r: 0.21698111, g: 0.21698111, b: 0.21698111, a: 0.45882353}
key3: {r: 0.21698111, g: 0.21698111, b: 0.21698111, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}

ctime1: 18119
ctime2: 53199
ctime1: 65535
ctime2: 65535
ctime3: 65535
ctime4: 0
ctime5: 0

atime1: 5204
atime2: 65535
atime3: 0
atime2: 16769
atime3: 65535
m_NumColorKeys: 4
m_NumAlphaKeys: 3
m_NumColorKeys: 2
m_NumAlphaKeys: 4
minGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}

UVModule:
enabled: 1
mode: 0
timeMode: 0
fps: 30
frameOverTime:
serializedVersion: 2
minMaxState: 1

m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
speedRange: {x: 0, y: 1}
tilesX: 8
tilesY: 8
animationType: 0

flipU: 0
flipV: 0
flipU: 0
flipV: 0
VelocityModule:
enabled: 0
x:

ExternalForcesModule:
enabled: 0
multiplier: 1
influenceFilter: 0
influenceMask:
serializedVersion: 2
m_Bits: 4294967295
influenceList: []
ClampVelocityModule:
enabled: 0
x:

enabled: 1
strength:
serializedVersion: 2
minMaxState: 0
scalar: 0.2
minScalar: 1
minMaxState: 3
scalar: 0.5
minScalar: 0.1
maxCurve:
serializedVersion: 2
m_Curve:

m_RotationOrder: 4
strengthY:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 1
minScalar: 1
maxCurve:

m_RotationOrder: 4
strengthZ:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 1
minScalar: 1
maxCurve:

separateAxes: 0
frequency: 0.2
damping: 1
octaves: 1
octaves: 2
octaveMultiplier: 0.5
octaveScale: 2
quality: 0

--- !u!199 &199631009938714948
ParticleSystemRenderer:
serializedVersion: 6
m_ObjectHideFlags: 1
m_ObjectHideFlags: 0
m_PrefabInternal: {fileID: 100100000}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1946923849596348}
m_Enabled: 1
m_CastShadows: 0

m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 2f77972d56f1441e6b793a07e4088a6e, type: 2}
- {fileID: 0}

m_NormalDirection: 0
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_AllowRoll: 1
m_VertexStreams: 000304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}

127
Assets/Scripts/Rendering/MyLWRenderer.cs


namespace UnityEngine.Experimental.Rendering.LightweightPipeline
{
public class SceneViewDepthCopyPassCustom : ScriptableRenderPass
{
private RenderTargetHandle source { get; set; }
public SceneViewDepthCopyPassCustom(LightweightForwardRenderer renderer) : base(renderer)
{}
public void Setup(RenderTargetHandle source)
{
this.source = source;
}
public override void Execute(ref ScriptableRenderContext context, ref CullResults cullResults, ref RenderingData renderingData)
{
// Restore Render target for additional editor rendering.
// Note: Scene view camera always perform depth prepass
CommandBuffer cmd = CommandBufferPool.Get("Copy Depth to Camera");
CoreUtils.SetRenderTarget(cmd, BuiltinRenderTextureType.CameraTarget);
cmd.SetGlobalTexture("_CameraDepthAttachment", source.Identifier());
cmd.EnableShaderKeyword(LightweightKeywordStrings.DepthNoMsaa);
cmd.DisableShaderKeyword(LightweightKeywordStrings.DepthMsaa2);
cmd.DisableShaderKeyword(LightweightKeywordStrings.DepthMsaa4);
cmd.Blit(source.Identifier(), BuiltinRenderTextureType.CameraTarget, renderer.GetMaterial(MaterialHandles.DepthCopy));
context.ExecuteCommandBuffer(cmd);
CommandBufferPool.Release(cmd);
}
}
/// <summary>
/// A Custom tweaking of the LWRP using the passes system, in this example a 'WaterFXPass' is added
/// </summary>
public class MyLWRenderer : MonoBehaviour, IRendererSetup
{
private DepthOnlyPass m_DepthOnlyPass;

private FinalBlitPass m_FinalBlitPass;
private EndXRRenderingPass m_EndXrRenderingPass;
#if UNITY_EDITOR
private SceneViewDepthCopyPassCustom m_SceneViewDepthCopyPass;
#endif
#if UNITY_EDITOR
private SceneViewDepthCopyPass m_SceneViewDepthCopyPass;
#endif
private RenderTargetHandle Color;
private RenderTargetHandle DepthAttachment;

[NonSerialized]
private bool m_Initialized = false;
// Add this custom renderer component to the scene camera(I'm not looking at removing so could cause issues)
if(m_addToSceneCamera)
{

}
}
m_DepthOnlyPass = new DepthOnlyPass(renderer);
m_DirectionalShadowPass = new DirectionalShadowsPass(renderer);
m_LocalShadowPass = new LocalShadowsPass(renderer);
m_SetupForwardRenderingPass = new SetupForwardRenderingPass(renderer);
m_ScreenSpaceShadowResovePass = new ScreenSpaceShadowResolvePass(renderer);
m_CreateLightweightRenderTexturesPass = new CreateLightweightRenderTexturesPass(renderer);
m_BeginXrRenderingPass = new BeginXRRenderingPass(renderer);
m_SetupLightweightConstants = new SetupLightweightConstanstPass(renderer);
m_RenderOpaqueForwardPass = new RenderOpaqueForwardPass(renderer);
m_OpaquePostProcessPass = new OpaquePostProcessPass(renderer);
m_DrawSkyboxPass = new DrawSkyboxPass(renderer);
m_CopyDepthPass = new CopyDepthPass(renderer);
m_CopyColorPass = new CopyColorPass(renderer);
m_RenderTransparentForwardPass = new RenderTransparentForwardPass(renderer);
m_TransparentPostProcessPass = new TransparentPostProcessPass(renderer);
m_FinalBlitPass = new FinalBlitPass(renderer);
m_EndXrRenderingPass = new EndXRRenderingPass(renderer);
m_WaterFXPass = new WaterFXPass(renderer);
m_DepthOnlyPass = new DepthOnlyPass();
m_DirectionalShadowPass = new DirectionalShadowsPass();
m_LocalShadowPass = new LocalShadowsPass();
m_SetupForwardRenderingPass = new SetupForwardRenderingPass();
m_ScreenSpaceShadowResovePass = new ScreenSpaceShadowResolvePass(renderer.GetMaterial(MaterialHandles.ScrenSpaceShadow));
m_CreateLightweightRenderTexturesPass = new CreateLightweightRenderTexturesPass();
m_BeginXrRenderingPass = new BeginXRRenderingPass();
m_SetupLightweightConstants = new SetupLightweightConstanstPass();
m_RenderOpaqueForwardPass = new RenderOpaqueForwardPass(renderer.GetMaterial(MaterialHandles.Error));
m_OpaquePostProcessPass = new OpaquePostProcessPass();
m_DrawSkyboxPass = new DrawSkyboxPass();
m_CopyDepthPass = new CopyDepthPass(renderer.GetMaterial(MaterialHandles.DepthCopy));
m_CopyColorPass = new CopyColorPass(renderer.GetMaterial(MaterialHandles.Sampling));
m_RenderTransparentForwardPass = new RenderTransparentForwardPass(renderer.GetMaterial(MaterialHandles.Error));
m_TransparentPostProcessPass = new TransparentPostProcessPass();
m_FinalBlitPass = new FinalBlitPass(renderer.GetMaterial(MaterialHandles.Blit));
m_EndXrRenderingPass = new EndXRRenderingPass();
#if UNITY_EDITOR
m_SceneViewDepthCopyPass = new SceneViewDepthCopyPassCustom(renderer);
#endif
m_WaterFXPass = new WaterFXPass();
#if UNITY_EDITOR
m_SceneViewDepthCopyPass = new SceneViewDepthCopyPass(renderer.GetMaterial(MaterialHandles.DepthCopy));
#endif
// RenderTexture format depends on camera and pipeline (HDR, non HDR, etc)
// Samples (MSAA) depend on camera and pipeline
Color.Init("_CameraColorTexture");

DirectionalShadowmap.Init("_DirectionalShadowmapTexture");
LocalShadowmap.Init("_LocalShadowmapTexture");
ScreenSpaceShadowmap.Init("_ScreenSpaceShadowMapTexture");
m_Initialized = true;
}

renderer.Clear();
renderer.SetupPerObjectLightIndices(ref cullResults, ref renderingData.lightData);
RenderTextureDescriptor baseDescriptor = renderer.CreateRTDesc(ref renderingData.cameraData);
RenderTextureDescriptor baseDescriptor = LightweightForwardRenderer.CreateRTDesc(ref renderingData.cameraData);
RenderTextureDescriptor shadowDescriptor = baseDescriptor;
shadowDescriptor.dimension = TextureDimension.Tex2D;

if (renderingData.shadowData.renderLocalShadows)
{
m_LocalShadowPass.Setup(LocalShadowmap);
m_LocalShadowPass.Setup(LocalShadowmap, renderer.maxVisibleLocalLights);
renderer.EnqueuePass(m_LocalShadowPass);
}

RenderTargetHandle colorHandle = (requiresColorAttachment) ? Color : RenderTargetHandle.CameraTarget;
RenderTargetHandle depthHandle = (requiresDepthAttachment) ? DepthAttachment : RenderTargetHandle.CameraTarget;
var sampleCount = (SampleCount)renderingData.cameraData.msaaSamples;
var sampleCount = (SampleCount) renderingData.cameraData.msaaSamples;
m_CreateLightweightRenderTexturesPass.Setup(baseDescriptor, colorHandle, depthHandle, sampleCount);
renderer.EnqueuePass(m_CreateLightweightRenderTexturesPass);

bool dynamicBatching = renderingData.supportsDynamicBatching;
RendererConfiguration rendererConfiguration = LightweightForwardRenderer.GetRendererConfiguration(renderingData.lightData.totalAdditionalLightsCount);
m_SetupLightweightConstants.Setup(renderer.maxVisibleLocalLights, renderer.perObjectLightIndices);
renderer.EnqueuePass(m_WaterFXPass);
m_RenderOpaqueForwardPass.Setup(baseDescriptor, colorHandle, depthHandle, LightweightForwardRenderer.GetCameraClearFlag(camera), camera.backgroundColor, rendererConfiguration, dynamicBatching);
m_RenderOpaqueForwardPass.Setup(baseDescriptor, colorHandle, depthHandle, LightweightForwardRenderer.GetCameraClearFlag(camera), camera.backgroundColor, rendererConfiguration,dynamicBatching);
m_OpaquePostProcessPass.Setup(baseDescriptor, colorHandle);
m_OpaquePostProcessPass.Setup(renderer.postProcessRenderContext, baseDescriptor, colorHandle);
renderer.EnqueuePass(m_OpaquePostProcessPass);
}

m_CopyColorPass.Setup(colorHandle, OpaqueColor);
renderer.EnqueuePass(m_CopyColorPass);
}
renderer.EnqueuePass(m_WaterFXPass);
m_RenderTransparentForwardPass.Setup(baseDescriptor, colorHandle, depthHandle, ClearFlag.None, camera.backgroundColor, rendererConfiguration, dynamicBatching);
renderer.EnqueuePass(m_RenderTransparentForwardPass);

m_TransparentPostProcessPass.Setup(baseDescriptor, colorHandle);
m_TransparentPostProcessPass.Setup(renderer.postProcessRenderContext, baseDescriptor, colorHandle);
renderer.EnqueuePass(m_TransparentPostProcessPass);
}
else if (!renderingData.cameraData.isOffscreenRender && colorHandle != RenderTargetHandle.CameraTarget)

{
renderer.EnqueuePass(m_EndXrRenderingPass);
}
#if UNITY_EDITOR
if (renderingData.cameraData.isSceneViewCamera)
{
m_SceneViewDepthCopyPass.Setup(DepthTexture);
renderer.EnqueuePass(m_SceneViewDepthCopyPass);
}
#endif
#if UNITY_EDITOR
if (renderingData.cameraData.isSceneViewCamera)
{
m_SceneViewDepthCopyPass.Setup(DepthTexture);
renderer.EnqueuePass(m_SceneViewDepthCopyPass);
}
#endif
}
}
}

19
Assets/Scripts/Rendering/WaterFXPass.cs


const string k_RenderWaterFXTag = "Render Water FX";
private RenderTargetHandle m_WaterFX = RenderTargetHandle.CameraTarget;
public WaterFXPass(LightweightForwardRenderer renderer) : base(renderer)
private FilterRenderersSettings transparentFilterSettings { get; set; }
public WaterFXPass()
transparentFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.transparent,
};
}
public override void Execute(ref ScriptableRenderContext context, ref CullResults cullResults, ref RenderingData renderingData)

RenderTextureDescriptor descriptor = renderer.CreateRTDesc(ref renderingData.cameraData);
RenderTextureDescriptor descriptor = LightweightForwardRenderer.CreateRTDesc(ref renderingData.cameraData);
descriptor.width = (int)(descriptor.width * 0.5f);
descriptor.height = (int)(descriptor.height * 0.5f);

{
Camera camera = renderingData.cameraData.camera;
context.StartMultiEye(camera);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, renderer.transparentFilterSettings);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, renderer.transparentFilterSettings);
context.DrawRenderers(cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
}
context.ExecuteCommandBuffer(cmd);

public override void Dispose(CommandBuffer cmd)
public override void FrameCleanup(CommandBuffer cmd)
base.FrameCleanup(cmd);
if (m_WaterFX != RenderTargetHandle.CameraTarget)
{
cmd.ReleaseTemporaryRT(m_WaterFX.id);

16
Assets/Shaders/LWVegetationShader.shader


#pragma multi_compile _ _VERTEX_LIGHTS
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
#pragma multi_compile _ _SHADOWS_ENABLED
#pragma multi_compile _ _LOCAL_SHADOWS_ENABLED
#pragma multi_compile _ _SHADOWS_SOFT
#pragma multi_compile _ _SHADOWS_CASCADE
// -------------------------------------

#endif
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
#ifdef _SHADOWS_ENABLED
#if SHADOWS_SCREEN
o.shadowCoord = ComputeShadowCoord(o.clipPos);
#else
o.shadowCoord = TransformWorldToShadowCoord(posWS);
#endif
#endif
#ifdef _SHADOWS_ENABLED
#if SHADOWS_SCREEN
o.shadowCoord = ComputeShadowCoord(o.clipPos);
#else
o.shadowCoord = TransformWorldToShadowCoord(posWS);
#endif
#endif
o.occlusion = v.color.a;

16
Assets/Shaders/PackedPBR.ShaderGraph
文件差异内容过多而无法显示
查看文件

5
Assets/Textures/Island/Materials/BushTest.mat


serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_EnableInstancingVariants: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1
m_CustomRenderQueue: -1
stringTagMap: {}

904
Assets/scenes/Island.unity
文件差异内容过多而无法显示
查看文件

23
Assets/scenes/Island_Profiles/PostVolumeGlobal Profile.asset


MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

value: {x: 0.5, y: 0.5}
intensity:
overrideState: 1
value: 0.323
value: 0.27
value: 0.202
value: 0.35
roundness:
overrideState: 1
value: 1

MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

value: 37.5
tint:
overrideState: 1
value: 41.5
value: 47.4
colorFilter:
overrideState: 1
value: {r: 0.7761659, g: 0.9622642, b: 0.85592234, a: 1}

value: {x: 0.9581366, y: 1, z: 0.98246086, w: 0.040346242}
gamma:
overrideState: 1
value: {x: 0.94426316, y: 1, z: 0.9683714, w: 0.004811565}
value: {x: 0.9419476, y: 1, z: 0.9915541, w: 0.004811565}
gain:
overrideState: 1
value: {x: 0.9467026, y: 1, z: 0.93602777, w: 0.19708326}

174
Assets/scenes/Testing/meshSetups.unity


m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 112000002, guid: 192b546d1becff040a17bff180883f70,
type: 2}
m_LightingDataAsset: {fileID: 112000002, guid: 192b546d1becff040a17bff180883f70, type: 2}
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:

m_IsPrefabAsset: 0
--- !u!4 &205223692 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4737683640255136, guid: aaef2c234fe6c4fe6ad88fe05905b60f,
type: 2}
m_CorrespondingSourceObject: {fileID: 4737683640255136, guid: aaef2c234fe6c4fe6ad88fe05905b60f, type: 2}
m_PrefabInternal: {fileID: 2032565617}
--- !u!1001 &206679127
Prefab:

m_IsPrefabAsset: 0
--- !u!4 &404755428 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4932471864557294, guid: c3d58a4b3ca744acf803225ae9cec836,
type: 2}
m_CorrespondingSourceObject: {fileID: 4932471864557294, guid: c3d58a4b3ca744acf803225ae9cec836, type: 2}
m_PrefabInternal: {fileID: 404755427}
--- !u!1001 &487006766
Prefab:

m_IsPrefabAsset: 0
--- !u!4 &487006767 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4950301651628742, guid: a8cf78d9746e449f69179132e78d867f,
type: 2}
m_CorrespondingSourceObject: {fileID: 4950301651628742, guid: a8cf78d9746e449f69179132e78d867f, type: 2}
--- !u!4 &680080999 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4342439216018976, guid: e79a3231c5d774922a6b873b075d6864,
type: 2}
--- !u!1 &557759810
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1728912414}
m_Layer: 0
m_Name: Missing Prefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1001 &834481481
Prefab:
m_ObjectHideFlags: 0

m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6108635b0aac04aada0cdeaae825f776, type: 2}
m_IsPrefabAsset: 0
--- !u!1 &904086588
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 1728912413}
serializedVersion: 6
m_Component:
- component: {fileID: 904086589}
m_Layer: 0
m_Name: Missing Prefab (Dummy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &904086589
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 1728912413}
m_GameObject: {fileID: 904086588}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1728912414}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &939156860
Prefab:
m_ObjectHideFlags: 0

m_IsPrefabAsset: 0
--- !u!4 &1009700512 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4226095984308140, guid: e273ea20cef2d43fabb2f46111866497,
type: 2}
m_CorrespondingSourceObject: {fileID: 4226095984308140, guid: e273ea20cef2d43fabb2f46111866497, type: 2}
m_PrefabInternal: {fileID: 1009700511}
--- !u!1001 &1108466201
Prefab:

serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1268823827
MeshRenderer:

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
m_StaticBatchInfo:

m_IsPrefabAsset: 0
--- !u!4 &1542469731 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4422286388676066, guid: e77c5d66f9ece49a9aaf971f1cab072d,
type: 2}
m_CorrespondingSourceObject: {fileID: 4422286388676066, guid: e77c5d66f9ece49a9aaf971f1cab072d, type: 2}
--- !u!1 &1610847811
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 1408765209143820, guid: e36ff37fdf1674447881905f66ffe923, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1610847814}
- component: {fileID: 1610847813}
- component: {fileID: 1610847812}
m_Layer: 0
m_Name: PalmB_LOD1 (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 120
m_IsActive: 1
--- !u!23 &1610847812
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 23946328909453918, guid: e36ff37fdf1674447881905f66ffe923, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1610847811}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7e3016a4668af4ed0879281ab8cfda9b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1610847813
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 33279750512658176, guid: e36ff37fdf1674447881905f66ffe923, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1610847811}
m_Mesh: {fileID: 4300002, guid: cf7e1f705443e4d5fab1a3bc22b86fce, type: 3}
--- !u!4 &1610847814
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 4605543733983386, guid: e36ff37fdf1674447881905f66ffe923, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1610847811}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 14.54, y: 0, z: -1.36}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1627600246
Prefab:
m_ObjectHideFlags: 0

--- !u!1 &1654216348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 100016, guid: 92a669df93f0d4f99bd8fa27767e8c9e,
type: 3}
m_CorrespondingSourceObject: {fileID: 100016, guid: 92a669df93f0d4f99bd8fa27767e8c9e, type: 3}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:

--- !u!4 &1654216349
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 400016, guid: 92a669df93f0d4f99bd8fa27767e8c9e,
type: 3}
m_CorrespondingSourceObject: {fileID: 400016, guid: 92a669df93f0d4f99bd8fa27767e8c9e, type: 3}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1654216348}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}

- {fileID: 487006767}
- {fileID: 205223692}
- {fileID: 1009700512}
- {fileID: 680080999}
- {fileID: 1728912414}
m_Father: {fileID: 0}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e79a3231c5d774922a6b873b075d6864, type: 2}
m_IsPrefabAsset: 0
--- !u!4 &1728912414
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 1728912413}
m_GameObject: {fileID: 557759810}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 904086589}
m_Father: {fileID: 1654216349}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1792388192
Prefab:
m_ObjectHideFlags: 0

m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_HDR: 0
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1820287036}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalPosition: {x: 1.7, y: 1.7, z: 0.73}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}

m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1820287036}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
m_Name:

size: 256
exposure: 0.12
overlaySettings:
linearDepth: 0
motionColorIntensity: 4
motionGridSize: 64
colorBlindnessType: 0

m_IsPrefabAsset: 0
--- !u!4 &2128084007 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4203461003883598, guid: c809c76e5a12443498dc83d3bf205842,
type: 2}
m_CorrespondingSourceObject: {fileID: 4203461003883598, guid: c809c76e5a12443498dc83d3bf205842, type: 2}
m_PrefabInternal: {fileID: 986589375}

325
Assets/NavMeshComponents/Editor/NavMeshAssetManager.cs


using System.Collections.Generic;
using System.IO;
using UnityEditor.Experimental.SceneManagement;
using UnityEditor.SceneManagement;
using UnityEngine.AI;
using UnityEngine;
namespace UnityEditor.AI
{
public class NavMeshAssetManager : ScriptableSingleton<NavMeshAssetManager>
{
internal struct AsyncBakeOperation
{
public NavMeshSurface surface;
public NavMeshData bakeData;
public AsyncOperation bakeOperation;
}
List<AsyncBakeOperation> m_BakeOperations = new List<AsyncBakeOperation>();
internal List<AsyncBakeOperation> GetBakeOperations() { return m_BakeOperations; }
struct SavedPrefabNavMeshData
{
public NavMeshSurface surface;
public NavMeshData navMeshData;
}
List<SavedPrefabNavMeshData> m_PrefabNavMeshDataAssets = new List<SavedPrefabNavMeshData>();
static string GetAndEnsureTargetPath(NavMeshSurface surface)
{
// Create directory for the asset if it does not exist yet.
var activeScenePath = surface.gameObject.scene.path;
var targetPath = "Assets";
if (!string.IsNullOrEmpty(activeScenePath))
{
targetPath = Path.Combine(Path.GetDirectoryName(activeScenePath), Path.GetFileNameWithoutExtension(activeScenePath));
}
else
{
var prefabStage = PrefabStageUtility.GetPrefabStage(surface.gameObject);
var isPartOfPrefab = prefabStage != null && prefabStage.IsPartOfPrefabContents(surface.gameObject);
if (isPartOfPrefab && !string.IsNullOrEmpty(prefabStage.prefabAssetPath))
{
var prefabDirectoryName = Path.GetDirectoryName(prefabStage.prefabAssetPath);
if (!string.IsNullOrEmpty(prefabDirectoryName))
targetPath = prefabDirectoryName;
}
}
if (!Directory.Exists(targetPath))
Directory.CreateDirectory(targetPath);
return targetPath;
}
static void CreateNavMeshAsset(NavMeshSurface surface)
{
var targetPath = GetAndEnsureTargetPath(surface);
var combinedAssetPath = Path.Combine(targetPath, "NavMesh-" + surface.name + ".asset");
combinedAssetPath = AssetDatabase.GenerateUniqueAssetPath(combinedAssetPath);
AssetDatabase.CreateAsset(surface.navMeshData, combinedAssetPath);
}
NavMeshData GetNavMeshAssetToDelete(NavMeshSurface navSurface)
{
if (PrefabUtility.IsPartOfPrefabInstance(navSurface) && !PrefabUtility.IsPartOfModelPrefab(navSurface))
{
// Don't allow deleting the asset belonging to the prefab parent
var parentSurface = PrefabUtility.GetCorrespondingObjectFromSource(navSurface) as NavMeshSurface;
if (parentSurface && navSurface.navMeshData == parentSurface.navMeshData)
return null;
}
// Do not delete the NavMeshData asset referenced from a prefab until the prefab is saved
var prefabStage = PrefabStageUtility.GetPrefabStage(navSurface.gameObject);
var isPartOfPrefab = prefabStage != null && prefabStage.IsPartOfPrefabContents(navSurface.gameObject);
if (isPartOfPrefab && IsCurrentPrefabNavMeshDataStored(navSurface))
return null;
return navSurface.navMeshData;
}
void ClearSurface(NavMeshSurface navSurface)
{
var hasNavMeshData = navSurface.navMeshData != null;
StoreNavMeshDataIfInPrefab(navSurface);
var assetToDelete = GetNavMeshAssetToDelete(navSurface);
navSurface.RemoveData();
if (hasNavMeshData)
{
SetNavMeshData(navSurface, null);
EditorSceneManager.MarkSceneDirty(navSurface.gameObject.scene);
}
if (assetToDelete)
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(assetToDelete));
}
public void StartBakingSurfaces(UnityEngine.Object[] surfaces)
{
// Remove first to avoid double registration of the callback
EditorApplication.update -= UpdateAsyncBuildOperations;
EditorApplication.update += UpdateAsyncBuildOperations;
foreach (NavMeshSurface surf in surfaces)
{
StoreNavMeshDataIfInPrefab(surf);
var oper = new AsyncBakeOperation();
oper.bakeData = InitializeBakeData(surf);
oper.bakeOperation = surf.UpdateNavMesh(oper.bakeData);
oper.surface = surf;
m_BakeOperations.Add(oper);
}
}
static NavMeshData InitializeBakeData(NavMeshSurface surface)
{
var emptySources = new List<NavMeshBuildSource>();
var emptyBounds = new Bounds();
return UnityEngine.AI.NavMeshBuilder.BuildNavMeshData(surface.GetBuildSettings(), emptySources, emptyBounds
, surface.transform.position, surface.transform.rotation);
}
void UpdateAsyncBuildOperations()
{
foreach (var oper in m_BakeOperations)
{
if (oper.surface == null || oper.bakeOperation == null)
continue;
if (oper.bakeOperation.isDone)
{
var surface = oper.surface;
var delete = GetNavMeshAssetToDelete(surface);
if (delete != null)
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(delete));
surface.RemoveData();
SetNavMeshData(surface, oper.bakeData);
if (surface.isActiveAndEnabled)
surface.AddData();
CreateNavMeshAsset(surface);
EditorSceneManager.MarkSceneDirty(surface.gameObject.scene);
}
}
m_BakeOperations.RemoveAll(o => o.bakeOperation == null || o.bakeOperation.isDone);
if (m_BakeOperations.Count == 0)
EditorApplication.update -= UpdateAsyncBuildOperations;
}
public bool IsSurfaceBaking(NavMeshSurface surface)
{
if (surface == null)
return false;
foreach (var oper in m_BakeOperations)
{
if (oper.surface == null || oper.bakeOperation == null)
continue;
if (oper.surface == surface)
return true;
}
return false;
}
public void ClearSurfaces(UnityEngine.Object[] surfaces)
{
foreach (NavMeshSurface s in surfaces)
ClearSurface(s);
}
static void SetNavMeshData(NavMeshSurface navSurface, NavMeshData navMeshData)
{
var so = new SerializedObject(navSurface);
var navMeshDataProperty = so.FindProperty("m_NavMeshData");
navMeshDataProperty.objectReferenceValue = navMeshData;
so.ApplyModifiedPropertiesWithoutUndo();
}
void StoreNavMeshDataIfInPrefab(NavMeshSurface surfaceToStore)
{
var prefabStage = PrefabStageUtility.GetPrefabStage(surfaceToStore.gameObject);
var isPartOfPrefab = prefabStage != null && prefabStage.IsPartOfPrefabContents(surfaceToStore.gameObject);
if (!isPartOfPrefab)
return;
// check if data has already been stored for this surface
foreach (var storedAssetInfo in m_PrefabNavMeshDataAssets)
if (storedAssetInfo.surface == surfaceToStore)
return;
if (m_PrefabNavMeshDataAssets.Count == 0)
{
PrefabStage.prefabSaving -= DeleteStoredNavMeshDataAssetsForOwnedSurfaces;
PrefabStage.prefabSaving += DeleteStoredNavMeshDataAssetsForOwnedSurfaces;
PrefabStage.prefabStageClosing -= ForgetUnsavedNavMeshDataChanges;
PrefabStage.prefabStageClosing += ForgetUnsavedNavMeshDataChanges;
}
var isDataOwner = true;
if (PrefabUtility.IsPartOfPrefabInstance(surfaceToStore) && !PrefabUtility.IsPartOfModelPrefab(surfaceToStore))
{
var basePrefabSurface = PrefabUtility.GetCorrespondingObjectFromSource(surfaceToStore) as NavMeshSurface;
isDataOwner = basePrefabSurface == null || surfaceToStore.navMeshData != basePrefabSurface.navMeshData;
}
m_PrefabNavMeshDataAssets.Add(new SavedPrefabNavMeshData { surface = surfaceToStore, navMeshData = isDataOwner ? surfaceToStore.navMeshData : null });
}
bool IsCurrentPrefabNavMeshDataStored(NavMeshSurface surface)
{
if (surface == null)
return false;
foreach (var storedAssetInfo in m_PrefabNavMeshDataAssets)
{
if (storedAssetInfo.surface == surface)
return storedAssetInfo.navMeshData == surface.navMeshData;
}
return false;
}
void DeleteStoredNavMeshDataAssetsForOwnedSurfaces(GameObject gameObjectInPrefab)
{
// Debug.LogFormat("DeleteStoredNavMeshDataAsset() when saving prefab {0}", gameObjectInPrefab.name);
var surfaces = gameObjectInPrefab.GetComponentsInChildren<NavMeshSurface>(true);
foreach (var surface in surfaces)
DeleteStoredPrefabNavMeshDataAsset(surface);
}
void DeleteStoredPrefabNavMeshDataAsset(NavMeshSurface surface)
{
for (var i = m_PrefabNavMeshDataAssets.Count - 1; i >= 0; i--)
{
var storedAssetInfo = m_PrefabNavMeshDataAssets[i];
if (storedAssetInfo.surface == surface)
{
var storedNavMeshData = storedAssetInfo.navMeshData;
if (storedNavMeshData != null && storedNavMeshData != surface.navMeshData)
{
var assetPath = AssetDatabase.GetAssetPath(storedNavMeshData);
AssetDatabase.DeleteAsset(assetPath);
}
m_PrefabNavMeshDataAssets.RemoveAt(i);
break;
}
}
if (m_PrefabNavMeshDataAssets.Count == 0)
{
PrefabStage.prefabSaving -= DeleteStoredNavMeshDataAssetsForOwnedSurfaces;
PrefabStage.prefabStageClosing -= ForgetUnsavedNavMeshDataChanges;
}
}
void ForgetUnsavedNavMeshDataChanges(PrefabStage prefabStage)
{
// Debug.Log("On prefab closing - forget about this object's surfaces and stop caring about prefab saving");
if (prefabStage == null)
return;
var allSurfacesInPrefab = prefabStage.prefabContentsRoot.GetComponentsInChildren<NavMeshSurface>(true);
NavMeshSurface surfaceInPrefab = null;
var index = 0;
do
{
if (allSurfacesInPrefab.Length > 0)
surfaceInPrefab = allSurfacesInPrefab[index];
for (var i = m_PrefabNavMeshDataAssets.Count - 1; i >= 0; i--)
{
var storedPrefabInfo = m_PrefabNavMeshDataAssets[i];
if (storedPrefabInfo.surface == null)
{
// Debug.LogFormat("A surface from the prefab got deleted after it has baked a new NavMesh but it hasn't saved it. Now the unsaved asset gets deleted. ({0})", storedPrefabInfo.navMeshData);
// surface got deleted, thus delete its initial NavMeshData asset
if (storedPrefabInfo.navMeshData != null)
{
var assetPath = AssetDatabase.GetAssetPath(storedPrefabInfo.navMeshData);
AssetDatabase.DeleteAsset(assetPath);
}
m_PrefabNavMeshDataAssets.RemoveAt(i);
}
else if (surfaceInPrefab != null && storedPrefabInfo.surface == surfaceInPrefab)
{
//Debug.LogFormat("The surface {0} from the prefab was storing the original navmesh data and now will be forgotten", surfaceInPrefab);
var baseSurface = PrefabUtility.GetCorrespondingObjectFromSource(surfaceInPrefab) as NavMeshSurface;
if (baseSurface == null || surfaceInPrefab.navMeshData != baseSurface.navMeshData)
{
var assetPath = AssetDatabase.GetAssetPath(surfaceInPrefab.navMeshData);
AssetDatabase.DeleteAsset(assetPath);
//Debug.LogFormat("The surface {0} from the prefab has baked new NavMeshData but did not save this change so the asset has been now deleted. ({1})",
// surfaceInPrefab, assetPath);
}
m_PrefabNavMeshDataAssets.RemoveAt(i);
}
}
} while (++index < allSurfacesInPrefab.Length);
if (m_PrefabNavMeshDataAssets.Count == 0)
{
PrefabStage.prefabSaving -= DeleteStoredNavMeshDataAssetsForOwnedSurfaces;
PrefabStage.prefabStageClosing -= ForgetUnsavedNavMeshDataChanges;
}
}
}
}

11
Assets/NavMeshComponents/Editor/NavMeshAssetManager.cs.meta


fileFormatVersion: 2
guid: 178d8366aa1616849b91b66285c51454
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Plugins.meta


fileFormatVersion: 2
guid: 37f591b3d23b24a118d3b6978de8ab76
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

71
Assets/_TerrainAutoUpgrade/Terrain.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Terrain
m_Shader: {fileID: 4800000, guid: 69c1f799e772cb6438f56c23efccb782, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _Control:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Splat0:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Splat1:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Splat2:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Splat3:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Metallic0: 0
- _Metallic1: 0
- _Metallic2: 0
- _Metallic3: 0
- _Smoothness0: 0.5
- _Smoothness1: 0.5
- _Smoothness2: 0.5
- _Smoothness3: 0.5
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}

8
Assets/_TerrainAutoUpgrade/Terrain.mat.meta


fileFormatVersion: 2
guid: ceddfe3ad8e46440a847d6f58a5b909e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

332
Assets/scenes/Testing/Terrain.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028373, g: 0.22571406, b: 0.3069228, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1013239195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1013239197}
- component: {fileID: 1013239196}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1013239196
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1013239195}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1013239197
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1013239195}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1423289014
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1423289017}
- component: {fileID: 1423289016}
- component: {fileID: 1423289015}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1423289015
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1423289014}
m_Enabled: 1
--- !u!20 &1423289016
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1423289014}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1423289017
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1423289014}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2119493324
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2119493327}
- component: {fileID: 2119493326}
- component: {fileID: 2119493325}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!154 &2119493325
TerrainCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2119493324}
m_Material: {fileID: 0}
m_Enabled: 1
m_TerrainData: {fileID: 15600000, guid: f46269ea1099c4fb4bc7191f76fcfab3, type: 2}
m_EnableTreeColliders: 1
--- !u!218 &2119493326
Terrain:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2119493324}
m_Enabled: 1
serializedVersion: 3
m_TerrainData: {fileID: 15600000, guid: f46269ea1099c4fb4bc7191f76fcfab3, type: 2}
m_TreeDistance: 2000
m_TreeBillboardDistance: 50
m_TreeCrossFadeLength: 5
m_TreeMaximumFullLODCount: 50
m_DetailObjectDistance: 80
m_DetailObjectDensity: 1
m_HeightmapPixelError: 5
m_SplatMapDistance: 1000
m_HeightmapMaximumLOD: 0
m_CastShadows: 1
m_DrawHeightmap: 1
m_DrawInstanced: 0
m_DrawTreesAndFoliage: 1
m_ReflectionProbeUsage: 1
m_MaterialType: 3
m_LegacySpecular:
serializedVersion: 2
rgba: 4286545791
m_LegacyShininess: 0.078125
m_MaterialTemplate: {fileID: 2100000, guid: ceddfe3ad8e46440a847d6f58a5b909e, type: 2}
m_BakeLightProbesForTrees: 1
m_PreserveTreePrototypeLayers: 0
m_ScaleInLightmap: 1
m_LightmapParameters: {fileID: 15203, guid: 0000000000000000f000000000000000, type: 0}
--- !u!4 &2119493327
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2119493324}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -22.6, y: 2.6, z: 30.55}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

7
Assets/scenes/Testing/Terrain.unity.meta


fileFormatVersion: 2
guid: 4ef3ff9e63a9a492b9437a4d2d6ca316
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存