From 143ce8ddc963469117240132131ec43a88381baa Mon Sep 17 00:00:00 2001 From: ALoTron <34157676+ALoTron@users.noreply.github.com> Date: Sun, 22 Apr 2018 02:07:00 +0200 Subject: [PATCH] First enemy. KI WIP --- Assets/Prefabs/Enemy.prefab | 208 +++++++++++++ Assets/Prefabs/Enemy.prefab.meta | 8 + Assets/Scenes/JanDevScene.unity | 491 +++++++++++++++++++++++++++---- Assets/Scripts/EnemyAI.cs | 36 +++ Assets/Scripts/EnemyAI.cs.meta | 11 + 5 files changed, 702 insertions(+), 52 deletions(-) create mode 100644 Assets/Prefabs/Enemy.prefab create mode 100644 Assets/Prefabs/Enemy.prefab.meta create mode 100644 Assets/Scripts/EnemyAI.cs create mode 100644 Assets/Scripts/EnemyAI.cs.meta diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab new file mode 100644 index 0000000..b192d01 --- /dev/null +++ b/Assets/Prefabs/Enemy.prefab @@ -0,0 +1,208 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1971451785855062} + m_IsPrefabParent: 1 +--- !u!1 &1336247710664522 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4340855217109864} + m_Layer: 0 + m_Name: Graphics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1659126864891018 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4161383188196848} + - component: {fileID: 212571453617041228} + m_Layer: 0 + m_Name: enemyTMP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1971451785855062 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4702455771231736} + - component: {fileID: 50727245938404542} + - component: {fileID: 61080315530130294} + - component: {fileID: 114170512691432560} + m_Layer: 0 + m_Name: Enemy + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4161383188196848 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1659126864891018} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4340855217109864} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4340855217109864 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1336247710664522} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4161383188196848} + m_Father: {fileID: 4702455771231736} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4702455771231736 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1971451785855062} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} + m_Children: + - {fileID: 4340855217109864} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &50727245938404542 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1971451785855062} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_Interpolate: 1 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &61080315530130294 +BoxCollider2D: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1971451785855062} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.30773532, y: -2.1199532} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 5.3082895, y: 6.402458} + m_EdgeRadius: 0 +--- !u!114 &114170512691432560 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1971451785855062} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 582bfd99a32c0ea45a7d09ef4f308d88, type: 3} + m_Name: + m_EditorClassIdentifier: + victim: {fileID: 0} + agressor: {fileID: 1971451785855062} + speed: 0.2 + rotaionSpeedWIP: 1 +--- !u!212 &212571453617041228 +SpriteRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1659126864891018} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 9b162ca64fa9bfc498e046c2c8f02e86, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10, y: 10} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 diff --git a/Assets/Prefabs/Enemy.prefab.meta b/Assets/Prefabs/Enemy.prefab.meta new file mode 100644 index 0000000..6d322c3 --- /dev/null +++ b/Assets/Prefabs/Enemy.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff87b9de73979cd40a9853419833a91f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/JanDevScene.unity b/Assets/Scenes/JanDevScene.unity index e99567f..950ed60 100644 --- a/Assets/Scenes/JanDevScene.unity +++ b/Assets/Scenes/JanDevScene.unity @@ -113,6 +113,51 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &44210378 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 44210379} + - component: {fileID: 44210380} + m_Layer: 0 + m_Name: Enemy + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &44210379 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 44210378} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -10, y: -10, z: -9.52} + m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} + m_Children: + - {fileID: 1827889599} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &44210380 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 44210378} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 582bfd99a32c0ea45a7d09ef4f308d88, type: 3} + m_Name: + m_EditorClassIdentifier: + victim: {fileID: 1276948095} + agressor: {fileID: 44210378} + speed: 0.5 + rotaionSpeedWIP: 1 --- !u!1001 &60318631 Prefab: m_ObjectHideFlags: 0 @@ -120,83 +165,261 @@ Prefab: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4079161515917916, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + - target: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} - - target: {fileID: 1679161327080020, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: turnpower - value: 2.5 - objectReference: {fileID: 0} - - target: {fileID: 4564951497896744, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4564951497896744, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: curveSpeed - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: turnSpeed - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: drift - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: friction - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 114874769993434856, guid: 3d1911457c1e44f53b6b4044334db52f, - type: 2} - propertyPath: acceleration - value: 5 + - target: {fileID: 1022616452846170, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} + propertyPath: m_Name + value: Player objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 3d1911457c1e44f53b6b4044334db52f, type: 2} + m_ParentPrefab: {fileID: 100100000, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, type: 2} m_IsPrefabParent: 0 +--- !u!1 &499157100 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 499157102} + - component: {fileID: 499157101} + m_Layer: 0 + m_Name: wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &499157101 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 499157100} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: f6c7f559c457cfe4ab5bd6ed39038ee9, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 2 + m_Size: {x: 500, y: 500} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 +--- !u!4 &499157102 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 499157100} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.2, y: 0.2, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1198295280 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1252940346499858, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + serializedVersion: 5 + m_Component: + - component: {fileID: 1198295281} + m_Layer: 0 + m_Name: Graphics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1198295281 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4366016793085106, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1198295280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2110222043} + m_Father: {fileID: 1276948098} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1276948095 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1022616452846170, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + serializedVersion: 5 + m_Component: + - component: {fileID: 1276948098} + - component: {fileID: 1276948097} + - component: {fileID: 1276948096} + - component: {fileID: 1276948100} + - component: {fileID: 1276948099} + m_Layer: 0 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1276948096 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 114273554511762994, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1276948095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2cf81aa4a8d45468f8184f8d5862d7eb, type: 3} + m_Name: + m_EditorClassIdentifier: + acceleration: 10 + friction: 0.1 + turnSpeed: 3 + drift: 0 + brake: 1 +--- !u!50 &1276948097 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 50301691402120602, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1276948095} + m_BodyType: 0 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0 + m_GravityScale: 0 + m_Material: {fileID: 0} + m_Interpolate: 1 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!4 &1276948098 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4161101831125614, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1276948095} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.25, y: 0.25, z: 0.25} + m_Children: + - {fileID: 1198295281} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!61 &1276948099 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 61196223608375284, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1276948095} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.30773532, y: -2.1199532} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 5.3082895, y: 6.402458} + m_EdgeRadius: 0 +--- !u!114 &1276948100 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 114151842412819366, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 1276948095} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4a1319c82afce6e47b9ec0980f156e39, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1409772000 GameObject: m_ObjectHideFlags: 0 @@ -208,6 +431,7 @@ GameObject: - component: {fileID: 1409772003} - component: {fileID: 1409772002} - component: {fileID: 1409772001} + - component: {fileID: 1409772005} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -249,7 +473,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 5 + orthographic size: 9.23785 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -259,7 +483,7 @@ Camera: m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 1 - m_AllowMSAA: 1 + m_AllowMSAA: 0 m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 @@ -278,3 +502,166 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1409772005 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1409772000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5d9a051e822e2cf4ea3ca01c5a4df37c, type: 3} + m_Name: + m_EditorClassIdentifier: + followThis: {fileID: 1276948095} +--- !u!1 &1827889598 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1827889599} + - component: {fileID: 1827889600} + m_Layer: 0 + m_Name: enemyTMP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1827889599 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1827889598} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 44210379} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1827889600 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1827889598} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 9b162ca64fa9bfc498e046c2c8f02e86, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10, y: 10} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 +--- !u!1 &2110222042 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 1394041200713184, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + serializedVersion: 5 + m_Component: + - component: {fileID: 2110222043} + - component: {fileID: 2110222044} + m_Layer: 0 + m_Name: vehicleTMP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2110222043 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 4233771866423556, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 2110222042} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1198295281} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2110222044 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 212182168784073764, guid: 5e6d7ab21e0f8d1429d88e33b07c5c02, + type: 2} + m_PrefabInternal: {fileID: 60318631} + m_GameObject: {fileID: 2110222042} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 6cab053583d7b91469a214e0bb8c0da0, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10, y: 10} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 diff --git a/Assets/Scripts/EnemyAI.cs b/Assets/Scripts/EnemyAI.cs new file mode 100644 index 0000000..8877f7b --- /dev/null +++ b/Assets/Scripts/EnemyAI.cs @@ -0,0 +1,36 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class EnemyAI : MonoBehaviour { + + [SerializeField] + private GameObject victim; + [SerializeField] + private GameObject agressor; + [SerializeField] + private float speed = 1; + [SerializeField] + private float rotaionSpeedWIP = 1; + + /* + * Die destructive dumme deutsche Dungeon Diktator Drifter DLC Debakel Distribution Dokumentations - Druck Datei + * */ + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () + { + // movement + agressor.transform.Translate (Vector3.Scale ((victim.transform.position - agressor.transform.position).normalized, new Vector2 (speed, speed))); + + // rotation + agressor.transform.Rotate(agressor.transform.forward, Vector3.Angle(victim.transform.position - agressor.transform.position, agressor.transform.rotation * new Vector3(1, 1, 1))); + } + + +} diff --git a/Assets/Scripts/EnemyAI.cs.meta b/Assets/Scripts/EnemyAI.cs.meta new file mode 100644 index 0000000..694ed9a --- /dev/null +++ b/Assets/Scripts/EnemyAI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 582bfd99a32c0ea45a7d09ef4f308d88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: