Random colors for NPC and player + Added a wall
This commit is contained in:
parent
810d76520c
commit
c622cc2b97
5 changed files with 139 additions and 57 deletions
|
@ -122,7 +122,6 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 08ac21f34fab492479c8ba517d134d33, type: 3}
|
m_Script: {fileID: 11500000, guid: 08ac21f34fab492479c8ba517d134d33, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
moveSpeed: 1.25
|
|
||||||
updateTime: 2
|
updateTime: 2
|
||||||
--- !u!195 &195715453755731944
|
--- !u!195 &195715453755731944
|
||||||
NavMeshAgent:
|
NavMeshAgent:
|
||||||
|
|
|
@ -159,7 +159,7 @@ Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Modification:
|
m_Modification:
|
||||||
m_TransformParent: {fileID: 1265248828}
|
m_TransformParent: {fileID: 0}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
|
@ -167,47 +167,74 @@ Prefab:
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
value: -2.2143593
|
value: 3
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 2.512637
|
value: -4.5
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
value: -0.12059054
|
value: 0.5
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalRotation.y
|
propertyPath: m_LocalRotation.y
|
||||||
value: -0.23296288
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalRotation.z
|
propertyPath: m_LocalRotation.z
|
||||||
value: 0.30360317
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
value: 0.9159756
|
value: 0.8660254
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
value: 0
|
value: 5
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 1889434021946074, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 1889434021946074, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 0
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalScale.x
|
propertyPath: m_LocalScale.x
|
||||||
value: 0.5857144
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalScale.y
|
propertyPath: m_LocalScale.y
|
||||||
value: 1.3149345
|
value: 0.625
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
propertyPath: m_LocalScale.z
|
propertyPath: m_LocalScale.z
|
||||||
value: 0.3425328
|
value: 1.7499999
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 20437103875467350, guid: c67fa24334c0f364cad8798522e92116,
|
||||||
|
type: 2}
|
||||||
|
propertyPath: m_NormalizedViewPortRect.x
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 20437103875467350, guid: c67fa24334c0f364cad8798522e92116,
|
||||||
|
type: 2}
|
||||||
|
propertyPath: m_NormalizedViewPortRect.width
|
||||||
|
value: 0.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 20437103875467350, guid: c67fa24334c0f364cad8798522e92116,
|
||||||
|
type: 2}
|
||||||
|
propertyPath: m_NormalizedViewPortRect.height
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.x
|
||||||
|
value: 60.000004
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
|
propertyPath: m_LocalEulerAnglesHint.z
|
||||||
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: c67fa24334c0f364cad8798522e92116, type: 2}
|
||||||
|
@ -263,11 +290,6 @@ Transform:
|
||||||
m_PrefabParentObject: {fileID: 4550573785341638, guid: b25e969032ebb1f4089308db11ee93b1,
|
m_PrefabParentObject: {fileID: 4550573785341638, guid: b25e969032ebb1f4089308db11ee93b1,
|
||||||
type: 2}
|
type: 2}
|
||||||
m_PrefabInternal: {fileID: 1032732991}
|
m_PrefabInternal: {fileID: 1032732991}
|
||||||
--- !u!4 &413537378 stripped
|
|
||||||
Transform:
|
|
||||||
m_PrefabParentObject: {fileID: 4661043116803332, guid: c67fa24334c0f364cad8798522e92116,
|
|
||||||
type: 2}
|
|
||||||
m_PrefabInternal: {fileID: 339319393}
|
|
||||||
--- !u!1001 &415128191
|
--- !u!1001 &415128191
|
||||||
Prefab:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -641,36 +663,6 @@ Transform:
|
||||||
m_Father: {fileID: 1430923538}
|
m_Father: {fileID: 1430923538}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1265248827
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
serializedVersion: 5
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 1265248828}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Cameras
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &1265248828
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_PrefabParentObject: {fileID: 0}
|
|
||||||
m_PrefabInternal: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 1265248827}
|
|
||||||
m_LocalRotation: {x: 0.5, y: -0, z: -0, w: 0.8660254}
|
|
||||||
m_LocalPosition: {x: 0, y: 7.5, z: -5.5}
|
|
||||||
m_LocalScale: {x: 1, y: 0.625, z: 1.7499999}
|
|
||||||
m_Children:
|
|
||||||
- {fileID: 413537378}
|
|
||||||
- {fileID: 1353476744}
|
|
||||||
m_Father: {fileID: 0}
|
|
||||||
m_RootOrder: 5
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!1 &1267399098
|
--- !u!1 &1267399098
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -859,7 +851,7 @@ Camera:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
y: 0
|
y: 0
|
||||||
width: 1
|
width: 0.5
|
||||||
height: 1
|
height: 1
|
||||||
near clip plane: 0.3
|
near clip plane: 0.3
|
||||||
far clip plane: 1000
|
far clip plane: 1000
|
||||||
|
@ -887,12 +879,12 @@ Transform:
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1353476739}
|
m_GameObject: {fileID: 1353476739}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: 0.5, y: -0, z: -0, w: 0.8660254}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 7.5, z: -5.5}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 0.625, z: 1.7499999}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1265248828}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 6
|
||||||
m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0}
|
||||||
--- !u!114 &1353476745
|
--- !u!114 &1353476745
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -905,6 +897,88 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 5277ef44f4e110947993697cba721d20, type: 3}
|
m_Script: {fileID: 11500000, guid: 5277ef44f4e110947993697cba721d20, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!1 &1430656044
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 5
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1430656045}
|
||||||
|
- component: {fileID: 1430656048}
|
||||||
|
- component: {fileID: 1430656047}
|
||||||
|
- component: {fileID: 1430656046}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Inner Wall
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1430656045
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1430656044}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: -1.53, z: -3.26}
|
||||||
|
m_LocalScale: {x: 0.099999994, y: 1, z: 3}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1430923538}
|
||||||
|
m_RootOrder: 4
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!23 &1430656046
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1430656044}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: 773533f606fb73d4fb27b5a2ed5cf8d6, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_PreserveUVs: 1
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_SelectedEditorRenderState: 3
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
--- !u!65 &1430656047
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1430656044}
|
||||||
|
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!33 &1430656048
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1430656044}
|
||||||
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
--- !u!1 &1430923537
|
--- !u!1 &1430923537
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -934,6 +1008,7 @@ Transform:
|
||||||
- {fileID: 1267399102}
|
- {fileID: 1267399102}
|
||||||
- {fileID: 1954217024}
|
- {fileID: 1954217024}
|
||||||
- {fileID: 1475431002}
|
- {fileID: 1475431002}
|
||||||
|
- {fileID: 1430656045}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 2
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d7eb36ff892a3a7438b868633aac89d0
|
guid: d7eb36ff892a3a7438b868633aac89d0
|
||||||
timeCreated: 1505749249
|
timeCreated: 1505764510
|
||||||
licenseType: Free
|
licenseType: Free
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
mainObjectFileID: 23800000
|
mainObjectFileID: 23800000
|
||||||
|
|
|
@ -12,6 +12,7 @@ public class PlayerController : MonoBehaviour
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
agent = GetComponent<NavMeshAgent> ();
|
agent = GetComponent<NavMeshAgent> ();
|
||||||
|
this.GetComponent<Renderer> ().material.color = Random.ColorHSV (0f, 1f, 1f, 1f, 0f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
|
|
|
@ -4,13 +4,20 @@ using UnityEngine.AI;
|
||||||
|
|
||||||
public class SimpleNPCBehavior : MonoBehaviour
|
public class SimpleNPCBehavior : MonoBehaviour
|
||||||
{
|
{
|
||||||
public float moveSpeed;
|
|
||||||
public int updateTime;
|
public int updateTime;
|
||||||
|
|
||||||
private Vector3 target;
|
private Vector3 target;
|
||||||
private NavMeshAgent agent;
|
private NavMeshAgent agent;
|
||||||
|
|
||||||
|
enum State {
|
||||||
|
idle,
|
||||||
|
walking,
|
||||||
|
talking
|
||||||
|
};
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
this.GetComponent<Renderer> ().material.color = Random.ColorHSV (0f, 1f, 1f, 1f, 0f, 1f);
|
||||||
target.Set (4.0f - (8.0f * Random.value), 0.5f, 4.0f - (8.0f * Random.value));
|
target.Set (4.0f - (8.0f * Random.value), 0.5f, 4.0f - (8.0f * Random.value));
|
||||||
agent = GetComponent<NavMeshAgent> ();
|
agent = GetComponent<NavMeshAgent> ();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue