Fixed indoor scene
This commit is contained in:
@@ -617,69 +617,6 @@ MonoBehaviour:
|
|||||||
m_LightCookieSize: {x: 1, y: 1}
|
m_LightCookieSize: {x: 1, y: 1}
|
||||||
m_LightCookieOffset: {x: 0, y: 0}
|
m_LightCookieOffset: {x: 0, y: 0}
|
||||||
m_SoftShadowQuality: 0
|
m_SoftShadowQuality: 0
|
||||||
--- !u!1 &2893261721717734074
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 2049321954311866650}
|
|
||||||
- component: {fileID: 3666780865748288649}
|
|
||||||
m_Layer: 3
|
|
||||||
m_Name: Navigation
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &2049321954311866650
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2893261721717734074}
|
|
||||||
serializedVersion: 2
|
|
||||||
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_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 1434832187885695643}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!114 &3666780865748288649
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2893261721717734074}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
m_AgentTypeID: 0
|
|
||||||
m_CollectObjects: 3
|
|
||||||
m_Size: {x: 10, y: 10, z: 10}
|
|
||||||
m_Center: {x: 0, y: 2, z: 0}
|
|
||||||
m_LayerMask:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 4294967295
|
|
||||||
m_UseGeometry: 0
|
|
||||||
m_DefaultArea: 0
|
|
||||||
m_GenerateLinks: 0
|
|
||||||
m_IgnoreNavMeshAgent: 1
|
|
||||||
m_IgnoreNavMeshObstacle: 1
|
|
||||||
m_OverrideTileSize: 0
|
|
||||||
m_TileSize: 256
|
|
||||||
m_OverrideVoxelSize: 0
|
|
||||||
m_VoxelSize: 0.1
|
|
||||||
m_MinRegionArea: 2
|
|
||||||
m_NavMeshData: {fileID: 23800000, guid: 03459dcde19b5a54e815e307356234e8, type: 2}
|
|
||||||
m_BuildHeightMesh: 0
|
|
||||||
--- !u!1 &3087505573828710561
|
--- !u!1 &3087505573828710561
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1669,7 +1606,6 @@ Transform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 2049321954311866650}
|
|
||||||
- {fileID: 6199626506931386910}
|
- {fileID: 6199626506931386910}
|
||||||
- {fileID: 8888767863032200945}
|
- {fileID: 8888767863032200945}
|
||||||
- {fileID: 7761237621210299497}
|
- {fileID: 7761237621210299497}
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 650146556}
|
- component: {fileID: 650146556}
|
||||||
- component: {fileID: 650146555}
|
- component: {fileID: 650146555}
|
||||||
|
- component: {fileID: 650146557}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Controller
|
m_Name: Controller
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -163,6 +164,37 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &650146557
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 650146554}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 7a5ac11cc976e418e8d13136b07e1f52, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_AgentTypeID: 0
|
||||||
|
m_CollectObjects: 0
|
||||||
|
m_Size: {x: 10, y: 10, z: 10}
|
||||||
|
m_Center: {x: 0, y: 2, z: 0}
|
||||||
|
m_LayerMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 8
|
||||||
|
m_UseGeometry: 0
|
||||||
|
m_DefaultArea: 0
|
||||||
|
m_GenerateLinks: 0
|
||||||
|
m_IgnoreNavMeshAgent: 1
|
||||||
|
m_IgnoreNavMeshObstacle: 1
|
||||||
|
m_OverrideTileSize: 0
|
||||||
|
m_TileSize: 256
|
||||||
|
m_OverrideVoxelSize: 0
|
||||||
|
m_VoxelSize: 0.1
|
||||||
|
m_MinRegionArea: 2
|
||||||
|
m_NavMeshData: {fileID: 0}
|
||||||
|
m_BuildHeightMesh: 0
|
||||||
--- !u!850595691 &1709286000
|
--- !u!850595691 &1709286000
|
||||||
LightingSettings:
|
LightingSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ MonoBehaviour:
|
|||||||
m_OverrideVoxelSize: 0
|
m_OverrideVoxelSize: 0
|
||||||
m_VoxelSize: 0.1
|
m_VoxelSize: 0.1
|
||||||
m_MinRegionArea: 2
|
m_MinRegionArea: 2
|
||||||
m_NavMeshData: {fileID: 23800000, guid: fb4c26949a10ca4418d40f5b186f1a77, type: 2}
|
m_NavMeshData: {fileID: 0}
|
||||||
m_BuildHeightMesh: 0
|
m_BuildHeightMesh: 0
|
||||||
--- !u!4 &2018736431
|
--- !u!4 &2018736431
|
||||||
Transform:
|
Transform:
|
||||||
@@ -904,7 +904,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 2018736429}
|
m_GameObject: {fileID: 2018736429}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: -5.7014427, y: 10.649784, z: -0.07274848}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fb4c26949a10ca4418d40f5b186f1a77
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 23800000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -58,13 +58,7 @@ public class Player : BaseCharacter
|
|||||||
|
|
||||||
public void SetPosition(Transform desiredPosition)
|
public void SetPosition(Transform desiredPosition)
|
||||||
{
|
{
|
||||||
if (!_navAgent.isOnNavMesh)
|
_navAgent.Warp(desiredPosition.position);
|
||||||
{
|
|
||||||
transform.position = desiredPosition.position;
|
|
||||||
_navAgent.enabled = false;
|
|
||||||
_navAgent.enabled = true;
|
|
||||||
}
|
|
||||||
var t=_navAgent.Warp(desiredPosition.position);
|
|
||||||
_navAgent.updatePosition = false;
|
_navAgent.updatePosition = false;
|
||||||
Rotate(desiredPosition.forward * -1);
|
Rotate(desiredPosition.forward * -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class IndoorController : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
// If the NavMeshSurface is not assigned in the Inspector, try to find it
|
// If the NavMeshSurface is not assigned in the Inspector, try to find it
|
||||||
var navMeshSurface = transform.GetComponentInChildren<NavMeshSurface>();
|
var navMeshSurface = GetComponent<NavMeshSurface>();
|
||||||
|
|
||||||
// Build the NavMesh
|
// Build the NavMesh
|
||||||
if (navMeshSurface != null)
|
if (navMeshSurface != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user