Add terrain alignment to tortoise. Adjust patrol points

This commit is contained in:
Brian Gunn committed 2021-01-12 11:27:53 -08:00
1 parent 3cd4759b26
commit 71ca4cd8bd
6 files changed
+49 -51

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: c814d2df27a2eb14d9f6198b08046609
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: c1a880a7693de5647aa7ad099e908b3a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8f68dd1e5500b174190f64e4013d4916
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+26 -23
View File
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 705507994} m_Sun: {fileID: 705507994}
m_IndirectSpecularColor: {r: 0.46205088, g: 0.16661629, b: 0.08875446, a: 1} m_IndirectSpecularColor: {r: 0.462051, g: 0.16661629, b: 0.08875446, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@@ -594,7 +594,7 @@ PrefabInstance:
- target: {fileID: 3419380671730723436, guid: 2405ec89026ce24488bdf9b73ba73229, - target: {fileID: 3419380671730723436, guid: 2405ec89026ce24488bdf9b73ba73229,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 11 value: 12
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3419380671730723436, guid: 2405ec89026ce24488bdf9b73ba73229, - target: {fileID: 3419380671730723436, guid: 2405ec89026ce24488bdf9b73ba73229,
type: 3} type: 3}
@@ -1996,7 +1996,7 @@ Transform:
m_Children: m_Children:
- {fileID: 1235649820} - {fileID: 1235649820}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &160123520 --- !u!1001 &160123520
PrefabInstance: PrefabInstance:
@@ -2121,7 +2121,7 @@ PrefabInstance:
- target: {fileID: 2535473794561774150, guid: 628e2a0410032204785de27e4a6cbb3c, - target: {fileID: 2535473794561774150, guid: 628e2a0410032204785de27e4a6cbb3c,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 8 value: 9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2535473794561774150, guid: 628e2a0410032204785de27e4a6cbb3c, - target: {fileID: 2535473794561774150, guid: 628e2a0410032204785de27e4a6cbb3c,
type: 3} type: 3}
@@ -4597,7 +4597,7 @@ PrefabInstance:
- target: {fileID: 6367628354273301364, guid: 2a06588b2a6965e4bb22878e344fa32e, - target: {fileID: 6367628354273301364, guid: 2a06588b2a6965e4bb22878e344fa32e,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 12 value: 13
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6367628354273301364, guid: 2a06588b2a6965e4bb22878e344fa32e, - target: {fileID: 6367628354273301364, guid: 2a06588b2a6965e4bb22878e344fa32e,
type: 3} type: 3}
@@ -5067,7 +5067,7 @@ PrefabInstance:
- target: {fileID: 6565259026102315539, guid: 930395c10b17fcc469ce3f738d10fbd5, - target: {fileID: 6565259026102315539, guid: 930395c10b17fcc469ce3f738d10fbd5,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 7 value: 8
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6565259026102315539, guid: 930395c10b17fcc469ce3f738d10fbd5, - target: {fileID: 6565259026102315539, guid: 930395c10b17fcc469ce3f738d10fbd5,
type: 3} type: 3}
@@ -5336,7 +5336,7 @@ Transform:
- {fileID: 1811955221} - {fileID: 1811955221}
- {fileID: 2067988149} - {fileID: 2067988149}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 14 m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &264104762 --- !u!1001 &264104762
PrefabInstance: PrefabInstance:
@@ -6143,7 +6143,7 @@ Transform:
m_Children: m_Children:
- {fileID: 1705947251} - {fileID: 1705947251}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 18 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &298121435 --- !u!1001 &298121435
PrefabInstance: PrefabInstance:
@@ -10243,7 +10243,7 @@ PrefabInstance:
- target: {fileID: 6845963354267829052, guid: 796f4ee7253909f498dff415ec2534e8, - target: {fileID: 6845963354267829052, guid: 796f4ee7253909f498dff415ec2534e8,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 3
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6845963354267829052, guid: 796f4ee7253909f498dff415ec2534e8, - target: {fileID: 6845963354267829052, guid: 796f4ee7253909f498dff415ec2534e8,
type: 3} type: 3}
@@ -12646,7 +12646,7 @@ Transform:
m_LocalScale: {x: 10, y: 10, z: 10} m_LocalScale: {x: 10, y: 10, z: 10}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 13 m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &604397324 --- !u!1001 &604397324
PrefabInstance: PrefabInstance:
@@ -16376,7 +16376,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 779035077} m_GameObject: {fileID: 779035077}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -87.1, y: -0.83, z: 43.4} m_LocalPosition: {x: -55.7, y: -0.83, z: 52.3}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 1705947251} m_Father: {fileID: 1705947251}
@@ -17055,7 +17055,7 @@ PrefabInstance:
- target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf, - target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf, - target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf,
type: 3} type: 3}
@@ -23840,7 +23840,7 @@ Transform:
- {fileID: 499475312} - {fileID: 499475312}
- {fileID: 411303041} - {fileID: 411303041}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 15 m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &965859544 --- !u!1 &965859544
GameObject: GameObject:
@@ -25117,7 +25117,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 17 m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!136 &1007957010 --- !u!136 &1007957010
CapsuleCollider: CapsuleCollider:
@@ -27495,7 +27495,7 @@ Transform:
m_Children: m_Children:
- {fileID: 1454683303} - {fileID: 1454683303}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 16 m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1050841375 --- !u!1001 &1050841375
PrefabInstance: PrefabInstance:
@@ -28562,7 +28562,7 @@ PrefabInstance:
- target: {fileID: 1848836457607822493, guid: 810faf30e433cb74fbecc70347f1bfb4, - target: {fileID: 1848836457607822493, guid: 810faf30e433cb74fbecc70347f1bfb4,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 10 value: 11
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1848836457607822493, guid: 810faf30e433cb74fbecc70347f1bfb4, - target: {fileID: 1848836457607822493, guid: 810faf30e433cb74fbecc70347f1bfb4,
type: 3} type: 3}
@@ -40413,6 +40413,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c847780c843a61a40ae54c515ba77b1b, type: 3} m_Script: {fileID: 11500000, guid: c847780c843a61a40ae54c515ba77b1b, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
terainMask:
serializedVersion: 2
m_Bits: 1
--- !u!114 &1238994334 --- !u!114 &1238994334
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -59615,7 +59618,7 @@ PrefabInstance:
- target: {fileID: 7763361116735412208, guid: 4732a9066c81e2445bf39d35c978aaf3, - target: {fileID: 7763361116735412208, guid: 4732a9066c81e2445bf39d35c978aaf3,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7763361116735412208, guid: 4732a9066c81e2445bf39d35c978aaf3, - target: {fileID: 7763361116735412208, guid: 4732a9066c81e2445bf39d35c978aaf3,
type: 3} type: 3}
@@ -60021,7 +60024,7 @@ PrefabInstance:
- target: {fileID: 4759011978276858401, guid: 00cf35c5d8315444cacbb611b11b2967, - target: {fileID: 4759011978276858401, guid: 00cf35c5d8315444cacbb611b11b2967,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 9 value: 10
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4759011978276858401, guid: 00cf35c5d8315444cacbb611b11b2967, - target: {fileID: 4759011978276858401, guid: 00cf35c5d8315444cacbb611b11b2967,
type: 3} type: 3}
@@ -62300,7 +62303,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1705947250} m_GameObject: {fileID: 1705947250}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 286, y: 26, z: 227} m_LocalPosition: {x: 272.44, y: 26, z: 220.99}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 115099253} - {fileID: 115099253}
@@ -62444,7 +62447,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: ce372616532d17b49beb67d280603118, - target: {fileID: -8679921383154817045, guid: ce372616532d17b49beb67d280603118,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: ce372616532d17b49beb67d280603118, - target: {fileID: -8679921383154817045, guid: ce372616532d17b49beb67d280603118,
type: 3} type: 3}
@@ -64063,7 +64066,7 @@ PrefabInstance:
- target: {fileID: 6595420649996950820, guid: abfdab393729e9c4590e4d8100295a52, - target: {fileID: 6595420649996950820, guid: abfdab393729e9c4590e4d8100295a52,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 4 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6595420649996950820, guid: abfdab393729e9c4590e4d8100295a52, - target: {fileID: 6595420649996950820, guid: abfdab393729e9c4590e4d8100295a52,
type: 3} type: 3}
@@ -75516,7 +75519,7 @@ PrefabInstance:
- target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf, - target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 5 value: 6
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf, - target: {fileID: 3301982758317484751, guid: 3be228291c2777f4bb158a8f309acfcf,
type: 3} type: 3}
@@ -80124,7 +80127,7 @@ Material:
- _WaveSteepness: 0.1 - _WaveSteepness: 0.1
m_Colors: m_Colors:
- _AmbientColor: {r: 0.5840786, g: 0.49693304, b: 0.60382754, a: 1} - _AmbientColor: {r: 0.5840786, g: 0.49693304, b: 0.60382754, a: 1}
- _EdgeWaterColor: {r: 0.099970944, g: 0.099970944, b: 0.1999712, a: 1} - _EdgeWaterColor: {r: 0.09995217, g: 0.09995217, b: 0.19995251, a: 1}
- _PW_MainLightColor: {r: 1, g: 0.4268818, b: 0.119498275, a: 1} - _PW_MainLightColor: {r: 1, g: 0.4268818, b: 0.119498275, a: 1}
- _PW_MainLightDir: {r: 0.8365165, g: 0.2588191, b: 0.48296306, a: 0} - _PW_MainLightDir: {r: 0.8365165, g: 0.2588191, b: 0.48296306, a: 0}
- _PW_MainLightSpecular: {r: 0.3137255, g: 0.27189302, b: 0.22345544, a: 1} - _PW_MainLightSpecular: {r: 0.3137255, g: 0.27189302, b: 0.22345544, a: 1}
+17 -7
View File
@@ -1,18 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class TortoiseController : MonoBehaviour public class TortoiseController : MonoBehaviour
{ {
// Start is called before the first frame update RaycastHit hit;
void Start() Vector3 theRay;
{
public LayerMask terainMask;
void FixedUpdate()
{
Align();
} }
// Update is called once per frame private void Align()
void Update() {
theRay = -transform.up;
if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y, transform.position.z),
theRay, out hit, 20, terainMask))
{ {
Quaternion targetRotation = Quaternion.FromToRotation(transform.up, hit.normal) * transform.parent.rotation;
transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, Time.deltaTime / 0.15f);
}
} }
} }