Adding A* Algorythm and carpet roads

This commit is contained in:
Nicolas SANS
2023-04-24 15:49:03 +02:00
parent 75018ee6cd
commit 690e3fbd0b
685 changed files with 134125 additions and 19 deletions

View File

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: bd410e8a816334db3beb2aa458e97c12
folderAsset: yes
DefaultImporter:
userData:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 9df9f020877fb4842b75396ddf708b69
DefaultImporter:
userData:

View File

@ -0,0 +1,83 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 23: {fileID: 2300000}
- 65: {fileID: 6500000}
m_Layer: 0
m_Name: ProceduralGround
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 10}
m_Children: []
m_Father: {fileID: 0}
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 0
m_LightmapTilingOffset: {x: .390625, y: .78125, z: .000488280988, w: .000976561976}
m_Materials:
- {fileID: 2100000, guid: 3219de2d574674beb889c87b844502b5, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: .5
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &6500000
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 10, y: .00999999978, z: 10}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1
m_IsExploded: 1

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 61432558c555740a38a88fa99d358883
NativeFormatImporter:
userData:

View File

@ -0,0 +1,111 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
m_Layer: 1
m_Name: ProceduralPrefab1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400002}
- 33: {fileID: 3300000}
- 136: {fileID: 13600000}
- 23: {fileID: 2300000}
m_Layer: 1
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 28.3519249, y: 0, z: -8.94069672e-08}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 400002}
m_Father: {fileID: 0}
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400000}
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: 99dbb3f3abc3c4845a9b650ff678e7c1, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Mesh: {fileID: 4300000, guid: 436b69414b04047fca3929c70df57c4f, type: 3}
--- !u!136 &13600000
CapsuleCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: .5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1
m_IsExploded: 1

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: b11992e5e8afb4e63a1ccab9daf6f07c
NativeFormatImporter:
userData:

View File

@ -0,0 +1,253 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 136: {fileID: 13600000}
- 23: {fileID: 2300000}
m_Layer: 1
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400002}
m_Layer: 1
m_Name: ProceduralPrefab2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100004
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400004}
- 33: {fileID: 3300002}
- 136: {fileID: 13600002}
- 23: {fileID: 2300002}
m_Layer: 1
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100006
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400006}
- 33: {fileID: 3300004}
- 136: {fileID: 13600004}
- 23: {fileID: 2300004}
m_Layer: 1
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: .5, y: -.500000119, z: .5, w: .49999994}
m_LocalPosition: {x: 0, y: 1, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400002}
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 37.0020599, y: 0, z: 1.5534935}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 400006}
- {fileID: 400004}
- {fileID: 400000}
m_Father: {fileID: 0}
--- !u!4 &400004
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106709}
m_LocalPosition: {x: 0, y: 1, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400002}
--- !u!4 &400006
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400002}
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: 99dbb3f3abc3c4845a9b650ff678e7c1, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!23 &2300002
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: 99dbb3f3abc3c4845a9b650ff678e7c1, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!23 &2300004
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: 20e84239fa93246fe8f7f753e8ee4ef2, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 4300000, guid: 436b69414b04047fca3929c70df57c4f, type: 3}
--- !u!33 &3300002
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Mesh: {fileID: 4300000, guid: 436b69414b04047fca3929c70df57c4f, type: 3}
--- !u!33 &3300004
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Mesh: {fileID: 4300000, guid: 436b69414b04047fca3929c70df57c4f, type: 3}
--- !u!136 &13600000
CapsuleCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: .5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!136 &13600002
CapsuleCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: .5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!136 &13600004
CapsuleCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: .5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100002}
m_IsPrefabParent: 1
m_IsExploded: 1

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 1c63e47cea3074ee89305fd4cefa91e8
NativeFormatImporter:
userData:

View File

@ -0,0 +1,320 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 65: {fileID: 6500000}
- 23: {fileID: 2300000}
m_Layer: 1
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400002}
- 33: {fileID: 3300002}
- 65: {fileID: 6500002}
- 23: {fileID: 2300002}
m_Layer: 1
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100004
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400004}
- 33: {fileID: 3300004}
- 65: {fileID: 6500004}
- 23: {fileID: 2300004}
m_Layer: 1
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100006
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400006}
- 33: {fileID: 3300006}
- 65: {fileID: 6500006}
- 23: {fileID: 2300006}
m_Layer: 1
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &100008
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400008}
m_Layer: 1
m_Name: ProceduralPrefab3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: .270597726, y: .653281689, z: -.270597786, w: .653281569}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 400008}
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_LocalRotation: {x: .382683486, y: 0, z: 0, w: .923879504}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 400008}
--- !u!4 &400004
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_LocalRotation: {x: 0, y: .382683486, z: 0, w: .923879504}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 400008}
--- !u!4 &400006
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 400008}
--- !u!4 &400008
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100008}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 42.4285851, y: 0, z: -1.00235534}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 400006}
- {fileID: 400004}
- {fileID: 400002}
- {fileID: 400000}
m_Father: {fileID: 0}
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: b71b71b0a1f9a48768a27ca6eefcfbdf, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!23 &2300002
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: b71b71b0a1f9a48768a27ca6eefcfbdf, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!23 &2300004
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: b71b71b0a1f9a48768a27ca6eefcfbdf, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!23 &2300006
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: b71b71b0a1f9a48768a27ca6eefcfbdf, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingLayerID: 0
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3300002
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3300004
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3300006
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &6500000
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6500002
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6500004
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6500006
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100008}
m_IsPrefabParent: 1
m_IsExploded: 1

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 18cb121974c6b4be387c66d4e1ce5bf8
NativeFormatImporter:
userData:

View File

@ -0,0 +1,420 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &105088
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 402290}
- 33: {fileID: 3349068}
- 65: {fileID: 6568724}
- 23: {fileID: 2324352}
m_Layer: 1
m_Name: Cube (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &110528
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 443002}
- 33: {fileID: 3385636}
- 65: {fileID: 6541864}
- 23: {fileID: 2376014}
m_Layer: 1
m_Name: Cube (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &134312
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 485982}
- 33: {fileID: 3367740}
- 65: {fileID: 6559214}
- 23: {fileID: 2321278}
m_Layer: 1
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &144100
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 447580}
- 33: {fileID: 3300322}
- 65: {fileID: 6562542}
- 23: {fileID: 2328318}
m_Layer: 1
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &170398
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 465272}
- 33: {fileID: 3385444}
- 65: {fileID: 6579718}
- 23: {fileID: 2346316}
m_Layer: 1
m_Name: Cube (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &173226
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 441640}
m_Layer: 1
m_Name: ProceduralPrefab4
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &402290
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 105088}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.69000006, z: 0}
m_LocalScale: {x: .725257635, y: .221584246, z: .768708467}
m_Children: []
m_Father: {fileID: 441640}
m_RootOrder: 4
--- !u!4 &441640
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 173226}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 34.5099983, y: 0, z: -5.92999983}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 447580}
- {fileID: 485982}
- {fileID: 443002}
- {fileID: 465272}
- {fileID: 402290}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!4 &443002
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 110528}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.05999994, z: 0}
m_LocalScale: {x: 1.99168217, y: .608508468, z: 2.11100578}
m_Children: []
m_Father: {fileID: 441640}
m_RootOrder: 2
--- !u!4 &447580
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 144100}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.48285031, y: 5, z: 1.51245952}
m_Children: []
m_Father: {fileID: 441640}
m_RootOrder: 0
--- !u!4 &465272
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170398}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3.4000001, z: 0}
m_LocalScale: {x: 1.33442724, y: .407700717, z: 1.41437399}
m_Children: []
m_Father: {fileID: 441640}
m_RootOrder: 3
--- !u!4 &485982
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 134312}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.68000007, z: 0}
m_LocalScale: {x: 2.64951539, y: .809492886, z: 2.80825019}
m_Children: []
m_Father: {fileID: 441640}
m_RootOrder: 1
--- !u!23 &2321278
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 134312}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 57eb4c059e0b3467cac0a46a3b859a2d, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2324352
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 105088}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 57eb4c059e0b3467cac0a46a3b859a2d, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2328318
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 144100}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 57eb4c059e0b3467cac0a46a3b859a2d, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2346316
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170398}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 57eb4c059e0b3467cac0a46a3b859a2d, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2376014
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 110528}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 57eb4c059e0b3467cac0a46a3b859a2d, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3300322
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 144100}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3349068
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 105088}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3367740
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 134312}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3385444
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170398}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3385636
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 110528}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &6541864
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 110528}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6559214
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 134312}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6562542
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 144100}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6568724
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 105088}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!65 &6579718
BoxCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 170398}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 173226}
m_IsPrefabParent: 1

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: df2342a101fc54b44811414aaee023ba
timeCreated: 1537827455
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,281 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Pathfinding.Examples {
/// <summary>Example script for generating an infinite procedural world</summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_procedural_world.php")]
public class ProceduralWorld : MonoBehaviour {
public Transform target;
public ProceduralPrefab[] prefabs;
/// <summary>How far away to generate tiles</summary>
public int range = 1;
public int disableAsyncLoadWithinRange = 1;
/// <summary>World size of tiles</summary>
public float tileSize = 100;
public int subTiles = 20;
/// <summary>
/// Enable static batching on generated tiles.
/// Will improve overall FPS, but might cause FPS drops on
/// some frames when static batching is done
/// </summary>
public bool staticBatching = false;
Queue<IEnumerator> tileGenerationQueue = new Queue<IEnumerator>();
public enum RotationRandomness {
AllAxes,
Y
}
[System.Serializable]
public class ProceduralPrefab {
/// <summary>Prefab to use</summary>
public GameObject prefab;
/// <summary>Number of objects per square world unit</summary>
public float density = 0;
/// <summary>
/// Multiply by [perlin noise].
/// Value from 0 to 1 indicating weight.
/// </summary>
public float perlin = 0;
/// <summary>
/// Perlin will be raised to this power.
/// A higher value gives more distinct edges
/// </summary>
public float perlinPower = 1;
/// <summary>Some offset to avoid identical density maps</summary>
public Vector2 perlinOffset = Vector2.zero;
/// <summary>
/// Perlin noise scale.
/// A higher value spreads out the maximums and minimums of the density.
/// </summary>
public float perlinScale = 1;
/// <summary>
/// Multiply by [random].
/// Value from 0 to 1 indicating weight.
/// </summary>
public float random = 1;
public RotationRandomness randomRotation = RotationRandomness.AllAxes;
/// <summary>If checked, a single object will be created in the center of each tile</summary>
public bool singleFixed = false;
}
/// <summary>All tiles</summary>
Dictionary<Int2, ProceduralTile> tiles = new Dictionary<Int2, ProceduralTile>();
// Use this for initialization
void Start () {
// Calculate the closest tiles
// and then recalculate the graph
Update();
AstarPath.active.Scan();
StartCoroutine(GenerateTiles());
}
// Update is called once per frame
void Update () {
// Calculate the tile the target is standing on
Int2 p = new Int2(Mathf.RoundToInt((target.position.x - tileSize*0.5f) / tileSize), Mathf.RoundToInt((target.position.z - tileSize*0.5f) / tileSize));
// Clamp range
range = range < 1 ? 1 : range;
// Remove tiles which are out of range
bool changed = true;
while (changed) {
changed = false;
foreach (KeyValuePair<Int2, ProceduralTile> pair in tiles) {
if (Mathf.Abs(pair.Key.x-p.x) > range || Mathf.Abs(pair.Key.y-p.y) > range) {
pair.Value.Destroy();
tiles.Remove(pair.Key);
changed = true;
break;
}
}
}
// Add tiles which have come in range
// and start calculating them
for (int x = p.x-range; x <= p.x+range; x++) {
for (int z = p.y-range; z <= p.y+range; z++) {
if (!tiles.ContainsKey(new Int2(x, z))) {
ProceduralTile tile = new ProceduralTile(this, x, z);
var generator = tile.Generate();
// Tick it one step forward
generator.MoveNext();
// Calculate the rest later
tileGenerationQueue.Enqueue(generator);
tiles.Add(new Int2(x, z), tile);
}
}
}
// The ones directly adjacent to the current one
// should always be completely calculated
// make sure they are
for (int x = p.x-disableAsyncLoadWithinRange; x <= p.x+disableAsyncLoadWithinRange; x++) {
for (int z = p.y-disableAsyncLoadWithinRange; z <= p.y+disableAsyncLoadWithinRange; z++) {
tiles[new Int2(x, z)].ForceFinish();
}
}
}
IEnumerator GenerateTiles () {
while (true) {
if (tileGenerationQueue.Count > 0) {
var generator = tileGenerationQueue.Dequeue();
yield return StartCoroutine(generator);
}
yield return null;
}
}
class ProceduralTile {
int x, z;
System.Random rnd;
ProceduralWorld world;
public bool destroyed { get; private set; }
public ProceduralTile (ProceduralWorld world, int x, int z) {
this.x = x;
this.z = z;
this.world = world;
rnd = new System.Random((x * 10007) ^ (z*36007));
}
Transform root;
IEnumerator ie;
public IEnumerator Generate () {
ie = InternalGenerate();
GameObject rt = new GameObject("Tile " + x + " " + z);
root = rt.transform;
while (ie != null && root != null && ie.MoveNext()) yield return ie.Current;
ie = null;
}
public void ForceFinish () {
while (ie != null && root != null && ie.MoveNext()) {}
ie = null;
}
Vector3 RandomInside () {
Vector3 v = new Vector3();
v.x = (x + (float)rnd.NextDouble())*world.tileSize;
v.z = (z + (float)rnd.NextDouble())*world.tileSize;
return v;
}
Vector3 RandomInside (float px, float pz) {
Vector3 v = new Vector3();
v.x = (px + (float)rnd.NextDouble()/world.subTiles)*world.tileSize;
v.z = (pz + (float)rnd.NextDouble()/world.subTiles)*world.tileSize;
return v;
}
Quaternion RandomYRot (ProceduralPrefab prefab) {
return prefab.randomRotation == RotationRandomness.AllAxes ? Quaternion.Euler(360*(float)rnd.NextDouble(), 360*(float)rnd.NextDouble(), 360*(float)rnd.NextDouble()) : Quaternion.Euler(0, 360 * (float)rnd.NextDouble(), 0);
}
IEnumerator InternalGenerate () {
Debug.Log("Generating tile " + x + ", " + z);
int counter = 0;
float[, ] ditherMap = new float[world.subTiles+2, world.subTiles+2];
//List<GameObject> objs = new List<GameObject>();
for (int i = 0; i < world.prefabs.Length; i++) {
ProceduralPrefab pref = world.prefabs[i];
if (pref.singleFixed) {
Vector3 p = new Vector3((x+0.5f) * world.tileSize, 0, (z+0.5f) * world.tileSize);
GameObject ob = GameObject.Instantiate(pref.prefab, p, Quaternion.identity) as GameObject;
ob.transform.parent = root;
} else {
float subSize = world.tileSize/world.subTiles;
for (int sx = 0; sx < world.subTiles; sx++) {
for (int sz = 0; sz < world.subTiles; sz++) {
ditherMap[sx+1, sz+1] = 0;
}
}
for (int sx = 0; sx < world.subTiles; sx++) {
for (int sz = 0; sz < world.subTiles; sz++) {
float px = x + sx/(float)world.subTiles;//sx / world.tileSize;
float pz = z + sz/(float)world.subTiles;//sz / world.tileSize;
float perl = Mathf.Pow(Mathf.PerlinNoise((px + pref.perlinOffset.x)*pref.perlinScale, (pz + pref.perlinOffset.y)*pref.perlinScale), pref.perlinPower);
float density = pref.density * Mathf.Lerp(1, perl, pref.perlin) * Mathf.Lerp(1, (float)rnd.NextDouble(), pref.random);
float fcount = subSize*subSize*density + ditherMap[sx+1, sz+1];
int count = Mathf.RoundToInt(fcount);
// Apply dithering
// See http://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering
ditherMap[sx+1+1, sz+1+0] += (7f/16f) * (fcount - count);
ditherMap[sx+1-1, sz+1+1] += (3f/16f) * (fcount - count);
ditherMap[sx+1+0, sz+1+1] += (5f/16f) * (fcount - count);
ditherMap[sx+1+1, sz+1+1] += (1f/16f) * (fcount - count);
// Create a number of objects
for (int j = 0; j < count; j++) {
// Find a random position inside the current sub-tile
Vector3 p = RandomInside(px, pz);
GameObject ob = GameObject.Instantiate(pref.prefab, p, RandomYRot(pref)) as GameObject;
ob.transform.parent = root;
//ob.SetActive ( false );
//objs.Add ( ob );
counter++;
if (counter % 2 == 0)
yield return null;
}
}
}
}
}
ditherMap = null;
yield return null;
yield return null;
//Batch everything for improved performance
if (Application.HasProLicense() && world.staticBatching) {
StaticBatchingUtility.Combine(root.gameObject);
}
}
public void Destroy () {
if (root != null) {
Debug.Log("Destroying tile " + x + ", " + z);
GameObject.Destroy(root.gameObject);
root = null;
}
// Make sure the tile generator coroutine is destroyed
ie = null;
}
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b265527da9152484fa74392751085576
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TopDownOverlay
m_Shader: {fileID: 30, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0, a: .0980392173}

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: d3d92ca2f0e9e4bfb9c0fbe69453486a
NativeFormatImporter:
userData:

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3372638f4abd7758864ce1d546a5bea0444a158ab434ff3386bf1569dc0e9bef
size 64046

View File

@ -0,0 +1,64 @@
fileFormatVersion: 2
guid: 436b69414b04047fca3929c70df57c4f
ModelImporter:
serializedVersion: 15
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2300000: //RootNode
3300000: //RootNode
4300000: Cylinder
7400000: Default Take
9500000: //RootNode
materials:
importMaterials: 0
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
optimizeGameObjects: 0
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
animationScaleError: .5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 1
normalImportMode: 1
tangentImportMode: 1
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: .5
foreArmTwist: .5
upperLegTwist: .5
legTwist: .5
armStretch: .0500000007
legStretch: .0500000007
feetSpacing: 0
rootMotionBoneName:
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 2
userData:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0f600fff38cef414bbeb67121da1b7c1
folderAsset: yes
timeCreated: 1454764982
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 15c1a00768b91406da1023481bb6b04e
timeCreated: 1454764999
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2d3232507ad564e8c891011e5d6413bc

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b04e6b995408741cf8dc427c6173f5f8

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ce970816794dc4a6c8b5acdbc5953551

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: ee2523340e7944c4297a80937a51484c
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
textureType: -1
buildTargetSettings: []

View File

@ -0,0 +1,120 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: dynamicObstacle
serializedVersion: 3
m_AnimationType: 1
m_Compressed: 0
m_RotationCurves: []
m_CompressedRotationCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: {x: 0, y: 0, z: 0}
inSlope: {x: 0, y: 0, z: .0147868283}
outSlope: {x: 0, y: 0, z: .0147868283}
tangentMode: 0
- time: 10.0166664
value: {x: 0, y: 0, z: 14.9463282}
inSlope: {x: 0, y: 0, z: .00212520501}
outSlope: {x: 0, y: 0, z: .00212520501}
tangentMode: 1084227584
- time: 10.0333338
value: {x: 0, y: 0, z: 14.9462395}
inSlope: {x: 0, y: 0, z: -.012733344}
outSlope: {x: 0, y: 0, z: -.012733344}
tangentMode: 1084227584
m_PreInfinity: 2
m_PostInfinity: 2
path:
m_ScaleCurves: []
m_FloatCurves: []
m_SampleRate: 60
m_WrapMode: 4
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_MuscleClipInfo:
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 10.0166664
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
- time: 10.0166664
value: 0
inSlope: 0
outSlope: 0
tangentMode: 10
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: .0147868283
outSlope: .0147868283
tangentMode: 0
- time: 10.0333338
value: 14.9462395
inSlope: -.012733344
outSlope: -.012733344
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
m_EulerEditorCurves: []
m_Events: []
--- !u!1002 &7400001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: fca8a128acb4a4567ae3aacfdb0e4a13

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4b0e3c9cb27f44df7aacf2e67fbe110f

View File

@ -0,0 +1,42 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ListCubes
m_Shader: {fileID: 34, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .699999988
m_Colors:
data:
first:
name: _Color
second: {r: .332805037, g: 1, b: .17349565, a: 1}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 0}
data:
first:
name: _Emission
second: {r: .000488802558, g: .198979616, b: .0409471393, a: 0}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9c0721c9b4f3c4cb894656485acb9228

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 1cd57dbb745d9402f97fa830e41cd128
DefaultImporter:
userData:

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: blackText
m_Shader: {fileID: 10101, guid: 0000000000000000e000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 12}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 87dee5d03323e4003a9785eface0284a

View File

@ -0,0 +1,42 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ex5Ground
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: b0749c40ee03a46eaa0401867a08b963, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .699999988
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _Emission
second: {r: .825996995, g: .825996995, b: .825996995, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 46e0ecefe2ba442a5825f21e42530872

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: b0749c40ee03a46eaa0401867a08b963
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
textureType: -1
buildTargetSettings: []

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d2197e1d4298b416184ca8be586172de

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4576b010f30584c2c8b9ef066bcbd3d0

View File

@ -0,0 +1,27 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: navmesh-navmesh_example6navmeshMat
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .800000012, g: .800000012, b: .800000012, a: 1}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1f2d61fa60ed54991a4e629fdb13e1f3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 32536486e77cc4002ae78cd83c90bb2b

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:703c700b759e350b6437f6fefd4972d58a245c1a448f02dceeba0722cf9a040f
size 108567

View File

@ -0,0 +1,63 @@
fileFormatVersion: 2
guid: 7fdfb9a3e0fdf4df880ebc7fa5f56398
ModelImporter:
fileIDToRecycleName:
4300000: Plane_001
4300002: Plane
7400000: Default Take //// office
7400002: Default Take //// navmesh
7400004: Default Take //// example6
100100000: DataTemplate __Singleton__
serializedVersion: 10
materials:
importMaterials: 0
materialName: 3
materialSearch: 1
animations:
generateAnimations: 3
bakeSimulation: 0
splitAnimations: 1
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
animationScaleError: .5
animationWrapMode: 0
clipAnimations: []
meshes:
lODScreenPercentages: []
globalScale: 2
meshCompression: 0
addColliders: 1
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMesh: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 1
normalImportMode: 1
tangentImportMode: 1
textMetaNamesToFileIDs:
//RootNode:
data:
first: 1
second: a0860100
data:
first: 4
second: 801a0600
data:
first: 23
second: 60182300
data:
first: 33
second: a05a3200
data:
first: 64
second: 00a86100
data:
first: 111
second: 605fa900

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:af1975a52de466590f3b20ae6ab9d43376d1a54e93c2d7eb4ad525a7e432f1ef
size 3162

View File

@ -0,0 +1,67 @@
fileFormatVersion: 2
guid: 6ac6694dd977643948f7ae7305e370ba
ModelImporter:
serializedVersion: 15
fileIDToRecycleName:
100000: //RootNode
100002: navmesh_example6navmesh
400000: //RootNode
400002: navmesh_example6navmesh
2300000: navmesh_example6navmesh
3300000: navmesh_example6navmesh
4300000: example6navmesh
4300002: default
4300004: navmesh_example6navmesh
11100000: //RootNode
materials:
importMaterials: 1
materialName: 3
materialSearch: 1
animations:
legacyGenerateAnimations: 0
bakeSimulation: 0
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
animationScaleError: .5
animationWrapMode: 0
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 1
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 0
normalImportMode: 1
tangentImportMode: 1
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
handles: []
armTwist: .5
foreArmTwist: .5
upperLegTwist: .5
legTwist: .5
armStretch: .0500000007
legStretch: .0500000007
feetSpacing: 0
rootMotionBoneName:
lastHumanDescriptionAvatarSource: {instanceID: 0}
additionalBone: 1
animationType: 1
userData:

View File

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: a22bb0d2b6e4d4a50b5ef62e1219d9ea
folderAsset: yes
DefaultImporter:
userData:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: af5549f83cd6e498dbe788615aa953da
DefaultImporter:
userData:

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e6852ce581432417ba95e2115d89c478

View File

@ -0,0 +1,38 @@
using UnityEngine;
namespace Pathfinding.Examples {
/// <summary>
/// Smooth Camera Following.
/// \author http://wiki.unity3d.com/index.php/SmoothFollow2
/// </summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_astar_smooth_follow2.php")]
public class AstarSmoothFollow2 : MonoBehaviour {
public Transform target;
public float distance = 3.0f;
public float height = 3.0f;
public float damping = 5.0f;
public bool smoothRotation = true;
public bool followBehind = true;
public float rotationDamping = 10.0f;
public bool staticOffset = false;
void LateUpdate () {
Vector3 wantedPosition;
if (staticOffset) {
wantedPosition = target.position + new Vector3(0, height, distance);
} else {
if (followBehind)
wantedPosition = target.TransformPoint(0, height, -distance);
else
wantedPosition = target.TransformPoint(0, height, distance);
}
transform.position = Vector3.Lerp(transform.position, wantedPosition, Time.deltaTime * damping);
if (smoothRotation) {
Quaternion wantedRotation = Quaternion.LookRotation(target.position - transform.position, target.up);
transform.rotation = Quaternion.Slerp(transform.rotation, wantedRotation, Time.deltaTime * rotationDamping);
} else transform.LookAt(target, target.up);
}
}
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 46fb00c7e6ad9485282a146ad398a2a5
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

View File

@ -0,0 +1,59 @@
using UnityEngine;
namespace Pathfinding.Examples {
/// <summary>Example script used in the example scenes</summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_door_controller.php")]
public class DoorController : MonoBehaviour {
private bool open = false;
public int opentag = 1;
public int closedtag = 1;
public bool updateGraphsWithGUO = true;
public float yOffset = 5;
Bounds bounds;
public void Start () {
// Capture the bounds of the collider while it is closed
bounds = GetComponent<Collider>().bounds;
// Initially open the door
SetState(open);
}
void OnGUI () {
// Show a UI button for opening and closing the door
if (GUI.Button(new Rect(5, yOffset, 100, 22), "Toggle Door")) {
SetState(!open);
}
}
public void SetState (bool open) {
this.open = open;
if (updateGraphsWithGUO) {
// Update the graph below the door
// Set the tag of the nodes below the door
// To something indicating that the door is open or closed
GraphUpdateObject guo = new GraphUpdateObject(bounds);
int tag = open ? opentag : closedtag;
// There are only 32 tags
if (tag > 31) { Debug.LogError("tag > 31"); return; }
guo.modifyTag = true;
guo.setTag = tag;
guo.updatePhysics = false;
AstarPath.active.UpdateGraphs(guo);
}
// Play door animations
if (open) {
GetComponent<Animation>().Play("Open");
} else {
GetComponent<Animation>().Play("Close");
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e96422fbb088f477baaf6f2ada396863
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,55 @@
using UnityEngine;
namespace Pathfinding.Examples {
/// <summary>
/// AI controller specifically made for the spider robot.
/// Deprecated: This script has been replaced by Pathfinding.Examples.MineBotAnimation. Any uses of this script in the Unity editor will be automatically replaced by one AIPath component and one MineBotAnimation component.
/// </summary>
[RequireComponent(typeof(Seeker))]
[System.Obsolete("This script has been replaced by Pathfinding.Examples.MineBotAnimation. Any uses of this script in the Unity editor will be automatically replaced by one AIPath component and one MineBotAnimation component.")]
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_mine_bot_a_i.php")]
public class MineBotAI : AIPath {
/// <summary>
/// Animation component.
/// Should hold animations "awake" and "forward"
/// </summary>
public Animation anim;
/// <summary>Minimum velocity for moving</summary>
public float sleepVelocity = 0.4F;
/// <summary>Speed relative to velocity with which to play animations</summary>
public float animationSpeed = 0.2F;
/// <summary>
/// Effect which will be instantiated when end of path is reached.
/// See: OnTargetReached
/// </summary>
public GameObject endOfPathEffect;
#if UNITY_EDITOR
protected override int OnUpgradeSerializedData (int version, bool unityThread) {
if (unityThread) {
var components = gameObject.GetComponents<Component>();
int index = System.Array.IndexOf(components, this);
foreach (System.Type newType in new [] { typeof(AIPath), typeof(MineBotAnimation) }) {
var newComp = gameObject.AddComponent(newType);
foreach (var field in newComp.GetType().GetFields(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public)) {
var oldField = this.GetType().GetField(field.Name);
try {
if (oldField != null) field.SetValue(newComp, oldField.GetValue(this));
} catch (System.Exception e) {
Debug.LogError("Failed to upgrade some fields.\n" + e);
}
}
for (int i = components.Length - 1; i > index; i--) UnityEditorInternal.ComponentUtility.MoveComponentUp(newComp);
}
GameObject.DestroyImmediate(this);
return 0;
} else {
return base.OnUpgradeSerializedData(version, unityThread);
}
}
#endif
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3f35b84b127b849e38b74966118e7e0f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,73 @@
using UnityEngine;
namespace Pathfinding.Examples {
/// <summary>
/// Animation helper specifically made for the spider robot in the example scenes.
/// The spider robot (or mine-bot) which has been copied from the Unity Example Project
/// can have this script attached to be able to pathfind around with animations working properly.\n
/// This script should be attached to a parent GameObject however since the original bot has Z+ as up.
/// This component requires Z+ to be forward and Y+ to be up.\n
///
/// A movement script (e.g AIPath) must also be attached to the same GameObject to actually move the unit.
///
/// Animation is handled by this component. The Animator component refered to in <see cref="anim"/> should have a single parameter called NormalizedSpeed.
/// When the end of path is reached, if the <see cref="endOfPathEffect"/> is not null, it will be instantiated at the current position. However a check will be
/// done so that it won't spawn effects too close to the previous spawn-point.
/// [Open online documentation to see images]
/// </summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_mine_bot_animation.php")]
public class MineBotAnimation : VersionedMonoBehaviour {
/// <summary>
/// Animation component.
/// Should hold animations "awake" and "forward"
/// </summary>
public Animator anim;
/// <summary>
/// Effect which will be instantiated when end of path is reached.
/// See: <see cref="OnTargetReached"/>
/// </summary>
public GameObject endOfPathEffect;
bool isAtDestination;
IAstarAI ai;
Transform tr;
protected override void Awake () {
base.Awake();
ai = GetComponent<IAstarAI>();
tr = GetComponent<Transform>();
}
/// <summary>Point for the last spawn of <see cref="endOfPathEffect"/></summary>
protected Vector3 lastTarget;
/// <summary>
/// Called when the end of path has been reached.
/// An effect (<see cref="endOfPathEffect)"/> is spawned when this function is called
/// However, since paths are recalculated quite often, we only spawn the effect
/// when the current position is some distance away from the previous spawn-point
/// </summary>
void OnTargetReached () {
if (endOfPathEffect != null && Vector3.Distance(tr.position, lastTarget) > 1) {
GameObject.Instantiate(endOfPathEffect, tr.position, tr.rotation);
lastTarget = tr.position;
}
}
protected void Update () {
if (ai.reachedEndOfPath) {
if (!isAtDestination) OnTargetReached();
isAtDestination = true;
} else isAtDestination = false;
// Calculate the velocity relative to this transform's orientation
Vector3 relVelocity = tr.InverseTransformDirection(ai.velocity);
relVelocity.y = 0;
// Speed relative to the character size
anim.SetFloat("NormalizedSpeed", relVelocity.magnitude / anim.transform.lossyScale.x);
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8503d71a898994d3288ce1708e2707fe
timeCreated: 1516539312
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,78 @@
using UnityEngine;
using System.Collections;
namespace Pathfinding.Examples {
/// <summary>Small sample script for placing obstacles</summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_examples_1_1_object_placer.php")]
public class ObjectPlacer : MonoBehaviour {
/// <summary>
/// GameObject to place.
/// When using a Grid Graph you need to make sure the object's layer is included in the collision mask in the GridGraph settings.
/// </summary>
public GameObject go;
/// <summary>Flush Graph Updates directly after placing. Slower, but updates are applied immidiately</summary>
public bool direct = false;
/// <summary>Issue a graph update object after placement</summary>
public bool issueGUOs = true;
/// <summary>Update is called once per frame</summary>
void Update () {
if (Input.GetKeyDown("p")) {
PlaceObject();
}
if (Input.GetKeyDown("r")) {
StartCoroutine(RemoveObject());
}
}
public void PlaceObject () {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
// Figure out where the ground is
if (Physics.Raycast(ray, out hit, Mathf.Infinity)) {
Vector3 p = hit.point;
GameObject obj = GameObject.Instantiate(go, p, Quaternion.identity) as GameObject;
if (issueGUOs) {
Bounds b = obj.GetComponent<Collider>().bounds;
GraphUpdateObject guo = new GraphUpdateObject(b);
AstarPath.active.UpdateGraphs(guo);
if (direct) {
AstarPath.active.FlushGraphUpdates();
}
}
}
}
public IEnumerator RemoveObject () {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
// Check what object is under the mouse cursor
if (Physics.Raycast(ray, out hit, Mathf.Infinity)) {
// Ignore ground and triggers
if (hit.collider.isTrigger || hit.transform.gameObject.name == "Ground") yield break;
Bounds b = hit.collider.bounds;
Destroy(hit.collider);
Destroy(hit.collider.gameObject);
if (issueGUOs) {
// In Unity, object destruction is actually delayed until the end of the Update loop.
// This means that we need to wait until the end of the frame (or until the next frame) before
// we update the graph. Otherwise the graph would still think that the objects are there.
yield return new WaitForEndOfFrame();
GraphUpdateObject guo = new GraphUpdateObject(b);
AstarPath.active.UpdateGraphs(guo);
if (direct) {
AstarPath.active.FlushGraphUpdates();
}
}
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 687e3bc0934ac46d3957e59872965f3c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
using Pathfinding;
/// <summary>
/// Helper editor script to snap an object to the closest node.
/// Used in the "Turn Based" example scene for snapping obstacles to the hexagon grid.
/// </summary>
[ExecuteInEditMode]
[HelpURL("http://arongranberg.com/astar/docs/class_snap_to_node.php")]
public class SnapToNode : MonoBehaviour {
void Update () {
if (transform.hasChanged && AstarPath.active != null) {
var node = AstarPath.active.GetNearest(transform.position, NNConstraint.None).node;
if (node != null) {
transform.position = (Vector3)node.position;
transform.hasChanged = false;
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c0acfdba178b145239678a03b9df938a
timeCreated: 1453723051
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,77 @@
using UnityEngine;
using System.Linq;
namespace Pathfinding {
/// <summary>
/// Moves the target in example scenes.
/// This is a simple script which has the sole purpose
/// of moving the target point of agents in the example
/// scenes for the A* Pathfinding Project.
///
/// It is not meant to be pretty, but it does the job.
/// </summary>
[HelpURL("http://arongranberg.com/astar/docs/class_pathfinding_1_1_target_mover.php")]
public class TargetMover : MonoBehaviour {
/// <summary>Mask for the raycast placement</summary>
public LayerMask mask;
public Transform target;
IAstarAI[] ais;
/// <summary>Determines if the target position should be updated every frame or only on double-click</summary>
public bool onlyOnDoubleClick;
public bool use2D;
Camera cam;
public void Start () {
//Cache the Main Camera
cam = Camera.main;
// Slightly inefficient way of finding all AIs, but this is just an example script, so it doesn't matter much.
// FindObjectsOfType does not support interfaces unfortunately.
ais = FindObjectsOfType<MonoBehaviour>().OfType<IAstarAI>().ToArray();
useGUILayout = false;
}
public void OnGUI () {
if (onlyOnDoubleClick && cam != null && Event.current.type == EventType.MouseDown && Event.current.clickCount == 2) {
UpdateTargetPosition();
}
}
/// <summary>Update is called once per frame</summary>
void Update () {
if (!onlyOnDoubleClick && cam != null) {
UpdateTargetPosition();
}
}
public void UpdateTargetPosition () {
Vector3 newPosition = Vector3.zero;
bool positionFound = false;
if (use2D) {
newPosition = cam.ScreenToWorldPoint(Input.mousePosition);
newPosition.z = 0;
positionFound = true;
} else {
// Fire a ray through the scene at the mouse position and place the target where it hits
RaycastHit hit;
if (Physics.Raycast(cam.ScreenPointToRay(Input.mousePosition), out hit, Mathf.Infinity, mask)) {
newPosition = hit.point;
positionFound = true;
}
}
if (positionFound && newPosition != target.position) {
target.position = newPosition;
if (onlyOnDoubleClick) {
for (int i = 0; i < ais.Length; i++) {
if (ais[i] != null) ais[i].SearchPath();
}
}
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f903c2eb621d8418d88f8dad81b13dc6
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d2fa9a928cd7a49c8afd1146a49db3ce

View File

@ -0,0 +1,64 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: AI
m_Shader: {fileID: 4800000, guid: 5c4aad560e4da4a59aa10f6f2f6e84ce, type: 3}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .284990668
data:
first:
name: _Parallax
second: .0199999996
m_Colors:
data:
first:
name: _Color
second: {r: .71938777, g: .451387316, b: 0, a: 1}
data:
first:
name: _SpecColor
second: {r: .5, g: .5, b: .5, a: 1}
data:
first:
name: _Emission
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _NotVisibleColor
second: {r: 0, g: 1, b: 0, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: db55ebdb9473a4a80a0037f64aafccce

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BlueBox
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .176163018, g: .421043277, b: .568627477, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 99dbb3f3abc3c4845a9b650ff678e7c1

View File

@ -0,0 +1,42 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BlueCheckerGround
m_Shader: {fileID: 200, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: ee2523340e7944c4297a80937a51484c, type: 3}
m_Scale: {x: 110, y: 110}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _InvFade
second: 3
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _TintColor
second: {r: .0447761416, g: .0447761416, b: .0447761416, a: 1}
data:
first:
name: _EmisColor
second: {r: .649253726, g: .649253726, b: .649253726, a: .156862751}

View File

@ -0,0 +1,4 @@
fileFormatVersion: 2
guid: 8f4d5503fdeab441e8c6c041504cf535
NativeFormatImporter:
userData:

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: BlueGround
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 50, y: 50}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .194386765, g: .46459946, b: .627451003, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b71b71b0a1f9a48768a27ca6eefcfbdf

View File

@ -0,0 +1,45 @@
Shader "Diffuse - Always visible" {
Properties {
_NotVisibleColor ("X-ray color (RGB)", Color) = (0,1,0,1)
_Color ("Main Color",Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque-1" }
LOD 200
Pass {
ZTest LEqual
Material {
Diffuse [_Color]
Ambient [_Color]
}
Lighting On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
}
Pass {
ZTest Greater
Material {
Diffuse [_NotVisibleColor]
}
Color [_NotVisibleColor]
}
}
FallBack "Diffuse"
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5c4aad560e4da4a59aa10f6f2f6e84ce

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Door
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .638857961, g: .854667306, b: 1, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 863174fbef875425ca78e4c949f12318

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Ground
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .813432813, g: .802395761, b: .734517694, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 3219de2d574674beb889c87b844502b5

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GroundRTS
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .922599792, g: .839560509, b: .747126341, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 48404990b059d4ad881cae67992eb592

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OrangeGround
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .776470602, g: .343709856, b: .185743943, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 20e84239fa93246fe8f7f753e8ee4ef2

View File

@ -0,0 +1,42 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: PathBlueArea
m_Shader: {fileID: 6, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .699999988
m_Colors:
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 0}
data:
first:
name: _Emission
second: {r: .263175696, g: .324492931, b: .427450985, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6e0bae036cdbd42bfb17a675c07df5f9

View File

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: PathGreyCube
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .518715024, g: .518715024, b: .518715024, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 48e8130f8426d4539a2879304cc512fb

View File

@ -0,0 +1,42 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: PathRedArea
m_Shader: {fileID: 6, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .699999988
m_Colors:
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 0}
data:
first:
name: _Emission
second: {r: .427450985, g: .263175696, b: .263175696, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: deda211578c2d47f69bee1211faed775

View File

@ -0,0 +1,26 @@
Shader "Projector/Light" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ShadowTex ("Cookie", 2D) = "" { TexGen ObjectLinear }
_FalloffTex ("FallOff", 2D) = "" { TexGen ObjectLinear }
}
Subshader {
Pass {
ZWrite off
Fog { Color (0, 0, 0) }
Color [_Color]
ColorMask RGB
Blend DstColor One
Offset -1, -1
SetTexture [_ShadowTex] {
combine texture * primary, ONE - texture
Matrix [_Projector]
}
SetTexture [_FalloffTex] {
constantColor (0,0,0,0)
combine previous lerp (texture) constant
Matrix [_ProjectorClip]
}
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2bec400a4eb5244d5b08b2425411bc8b

View File

@ -0,0 +1,56 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SomeBox
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 527965173b00f43f9a1b8fc9e8c2e64b, type: 3}
m_Scale: {x: 15, y: 15}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _Detail
second:
m_Texture: {fileID: 2800000, guid: 527965173b00f43f9a1b8fc9e8c2e64b, type: 3}
m_Scale: {x: 10, y: 10}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: 1
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: .800000012, b: .400000006, a: .968627453}
data:
first:
name: _SpecColor
second: {r: .5, g: .5, b: .5, a: 1}
data:
first:
name: _NotVisibleColor
second: {r: 0, g: 1, b: 0, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 86ebf3c4b42174d2a9d3c1dfd2476f32

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: afffbd3e47ed044a3b8245b974754305

Some files were not shown because too many files have changed in this diff Show More