From d00afd6a48297f99a96b621b24d94d944d8ece33 Mon Sep 17 00:00:00 2001 From: Santi Date: Wed, 7 Aug 2024 12:37:51 +0100 Subject: [PATCH] Beating-With-Sticks: Created AIScript, AI moves randomly and runs away from player when close. Added NavMesh to scene. Updated documentation and tags. --- Assets/Scenes/Beating-With-Sticks.meta | 8 + ...cene 1.unity => Beating-With-Sticks.unity} | 519 +++++++++++++----- ...ty.meta => Beating-With-Sticks.unity.meta} | 0 .../Scenes/Beating-With-Sticks/NavMesh.asset | Bin 0 -> 6700 bytes .../Beating-With-Sticks/NavMesh.asset.meta | 8 + Assets/Scenes/SampleScene 1.meta | 8 + Assets/Scenes/SampleScene 1/NavMesh.asset | Bin 0 -> 6700 bytes .../Scenes/SampleScene 1/NavMesh.asset.meta | 8 + Assets/Scripts/StickBeatings.meta | 8 + Assets/Scripts/StickBeatings/AIScript.cs | 113 ++++ Assets/Scripts/StickBeatings/AIScript.cs.meta | 11 + .../Mini-Game-Concepts/Beating With Sticks.md | 6 +- ProjectSettings/TagManager.asset | 3 +- 13 files changed, 565 insertions(+), 127 deletions(-) create mode 100644 Assets/Scenes/Beating-With-Sticks.meta rename Assets/Scenes/{SampleScene 1.unity => Beating-With-Sticks.unity} (61%) rename Assets/Scenes/{SampleScene 1.unity.meta => Beating-With-Sticks.unity.meta} (100%) create mode 100644 Assets/Scenes/Beating-With-Sticks/NavMesh.asset create mode 100644 Assets/Scenes/Beating-With-Sticks/NavMesh.asset.meta create mode 100644 Assets/Scenes/SampleScene 1.meta create mode 100644 Assets/Scenes/SampleScene 1/NavMesh.asset create mode 100644 Assets/Scenes/SampleScene 1/NavMesh.asset.meta create mode 100644 Assets/Scripts/StickBeatings.meta create mode 100644 Assets/Scripts/StickBeatings/AIScript.cs create mode 100644 Assets/Scripts/StickBeatings/AIScript.cs.meta diff --git a/Assets/Scenes/Beating-With-Sticks.meta b/Assets/Scenes/Beating-With-Sticks.meta new file mode 100644 index 0000000..046876e --- /dev/null +++ b/Assets/Scenes/Beating-With-Sticks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e225693e2679fa64eaee41733ef14697 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene 1.unity b/Assets/Scenes/Beating-With-Sticks.unity similarity index 61% rename from Assets/Scenes/SampleScene 1.unity rename to Assets/Scenes/Beating-With-Sticks.unity index 64c02fe..4eb1744 100644 --- a/Assets/Scenes/SampleScene 1.unity +++ b/Assets/Scenes/Beating-With-Sticks.unity @@ -122,7 +122,7 @@ NavMeshSettings: preserveTilesOutsideBounds: 0 debug: m_Flags: 0 - m_NavMeshData: {fileID: 0} + m_NavMeshData: {fileID: 23800000, guid: ad41150ae7e034348ad7e7be379d8056, type: 2} --- !u!1 &705507993 GameObject: m_ObjectHideFlags: 0 @@ -215,9 +215,9 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1 &765999529 +--- !u!1 &1423233316 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -225,26 +225,109 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 765999533} - - component: {fileID: 765999532} - - component: {fileID: 765999531} - - component: {fileID: 765999530} - - component: {fileID: 765999535} - - component: {fileID: 765999534} - m_Layer: 0 + - component: {fileID: 1423233324} + - component: {fileID: 1423233323} + - component: {fileID: 1423233322} + - component: {fileID: 1423233321} + - component: {fileID: 1423233320} + - component: {fileID: 1423233319} + - component: {fileID: 1423233318} + - component: {fileID: 1423233317} + m_Layer: 3 m_Name: Capsule - m_TagString: Untagged + m_TagString: Player m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!136 &765999530 +--- !u!143 &1423233317 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423233316} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 2 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0, z: 0} +--- !u!54 &1423233318 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423233316} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 112 + m_CollisionDetection: 0 +--- !u!114 &1423233319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423233316} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eca94ba4e2f880644ab196f816624ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + carryPosition: {fileID: 0} + insideTrigger: 0 + playerIsCarrying: 0 + nearestCarriableObject: {fileID: 0} + previousObject: {fileID: 0} + heldObject: {fileID: 0} + throwForce: 5 + cooldownSeconds: 1 + cooldownActive: 0 + interactKey: 102 +--- !u!114 &1423233320 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1423233316} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 93424cdca660b854faec02bc3325bc31, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 5 + turnSpeed: 720 + sprintSpeed: 10 + jumpForce: 2.5 + gravity: 9.8 + throwForce: {fileID: 1423233319} + forwardsKey: 119 + backwardsKey: 115 + leftKey: 97 + rightKey: 101 + sprintKey: 304 + jumpKey: 32 + hammer: 0 +--- !u!136 &1423233321 CapsuleCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} + m_GameObject: {fileID: 1423233316} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 @@ -252,13 +335,13 @@ CapsuleCollider: m_Height: 2 m_Direction: 1 m_Center: {x: 0, y: 0, z: 0} ---- !u!23 &765999531 +--- !u!23 &1423233322 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} + m_GameObject: {fileID: 1423233316} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -294,72 +377,30 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &765999532 +--- !u!33 &1423233323 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} + m_GameObject: {fileID: 1423233316} m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &765999533 +--- !u!4 &1423233324 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} + m_GameObject: {fileID: 1423233316} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.21045552, y: 2.21, z: 0.096935526} + m_LocalPosition: {x: -8.31, y: 2, z: 6.61} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!143 &765999534 -CharacterController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Height: 2 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &765999535 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 765999529} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 93424cdca660b854faec02bc3325bc31, type: 3} - m_Name: - m_EditorClassIdentifier: - speed: 5 - turnSpeed: 0 - sprintSpeed: 10 - jumpForce: 5 - gravity: 9.8 - throwForce: {fileID: 0} - forwardsKey: 119 - backwardsKey: 115 - leftKey: 97 - rightKey: 100 - sprintKey: 304 - jumpKey: 32 ---- !u!1 &963194225 +--- !u!1 &1664811009 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -367,82 +408,151 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 963194228} - - component: {fileID: 963194227} - - component: {fileID: 963194226} + - component: {fileID: 1664811013} + - component: {fileID: 1664811012} + - component: {fileID: 1664811011} + - component: {fileID: 1664811010} + - component: {fileID: 1664811014} + - component: {fileID: 1664811015} + - component: {fileID: 1664811016} m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera + m_Name: Sphere + m_TagString: Touch m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!81 &963194226 -AudioListener: +--- !u!135 &1664811010 +SphereCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 963194225} - m_Enabled: 1 ---- !u!20 &963194227 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 963194225} + m_GameObject: {fileID: 1664811009} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &963194228 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1664811011 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1664811009} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, 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_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + 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 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1664811012 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1664811009} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1664811013 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 963194225} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 11.79, z: 0} + m_GameObject: {fileID: 1664811009} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 7.42, y: 3.24, z: -8.59} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!195 &1664811014 +NavMeshAgent: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1664811009} + m_Enabled: 1 + m_AgentTypeID: 0 + m_Radius: 0.5 + m_Speed: 5 + m_Acceleration: 8 + avoidancePriority: 50 + m_AngularSpeed: 120 + m_StoppingDistance: 0 + m_AutoTraverseOffMeshLink: 1 + m_AutoBraking: 1 + m_AutoRepath: 1 + m_Height: 1 + m_BaseOffset: 0.5 + m_WalkableMask: 4294967295 + m_ObstacleAvoidanceType: 4 +--- !u!114 &1664811015 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1664811009} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b478d0ab1ff19cb4cb9e6161ea2a14d5, type: 3} + m_Name: + m_EditorClassIdentifier: + player: {fileID: 0} + agent: {fileID: 0} + walkPoint: {x: 0, y: 0, z: 0} + walkPointSet: 0 + walkPointRange: 7 + playerInSightRange: 0 +--- !u!135 &1664811016 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1664811009} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 9 + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &1947815994 GameObject: m_ObjectHideFlags: 0 @@ -460,7 +570,7 @@ GameObject: m_TagString: Floor m_Icon: {fileID: 0} m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 + m_StaticEditorFlags: 40 m_IsActive: 1 --- !u!23 &1947815996 MeshRenderer: @@ -521,11 +631,11 @@ Transform: m_GameObject: {fileID: 1947815994} 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_LocalScale: {x: 2, y: 1, z: 2} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!64 &1947815999 MeshCollider: @@ -541,3 +651,166 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2064354429 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2064354434} + - component: {fileID: 2064354433} + - component: {fileID: 2064354432} + - component: {fileID: 2064354431} + - component: {fileID: 2064354430} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2064354430 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064354429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} + m_Name: + m_EditorClassIdentifier: + sharedProfile: {fileID: 11400000, guid: 3c8dc5f9b0a9b3746a34c440291297b3, type: 2} + isGlobal: 1 + blendDistance: 0 + weight: 1 + priority: 0 +--- !u!114 &2064354431 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064354429} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} + m_Name: + m_EditorClassIdentifier: + volumeTrigger: {fileID: 2064354434} + volumeLayer: + serializedVersion: 2 + m_Bits: 4294967295 + stopNaNPropagation: 1 + finalBlitToCameraTarget: 0 + antialiasingMode: 0 + temporalAntialiasing: + jitterSpread: 0.75 + sharpness: 0.25 + stationaryBlending: 0.95 + motionBlending: 0.85 + subpixelMorphologicalAntialiasing: + quality: 2 + fastApproximateAntialiasing: + fastMode: 0 + keepAlpha: 0 + fog: + enabled: 1 + excludeSkybox: 1 + debugLayer: + lightMeter: + width: 512 + height: 256 + showCurves: 1 + histogram: + width: 512 + height: 256 + channel: 3 + waveform: + exposure: 0.12 + height: 256 + vectorscope: + size: 256 + exposure: 0.12 + overlaySettings: + linearDepth: 0 + motionColorIntensity: 4 + motionGridSize: 64 + colorBlindnessType: 0 + colorBlindnessStrength: 1 + m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} + m_ShowToolkit: 0 + m_ShowCustomSorter: 0 + breakBeforeColorGrading: 0 + m_BeforeTransparentBundles: [] + m_BeforeStackBundles: [] + m_AfterStackBundles: [] +--- !u!81 &2064354432 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064354429} + m_Enabled: 1 +--- !u!20 &2064354433 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064354429} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 36 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &2064354434 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064354429} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0.42, y: 28.94, z: -0.09} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} diff --git a/Assets/Scenes/SampleScene 1.unity.meta b/Assets/Scenes/Beating-With-Sticks.unity.meta similarity index 100% rename from Assets/Scenes/SampleScene 1.unity.meta rename to Assets/Scenes/Beating-With-Sticks.unity.meta diff --git a/Assets/Scenes/Beating-With-Sticks/NavMesh.asset b/Assets/Scenes/Beating-With-Sticks/NavMesh.asset new file mode 100644 index 0000000000000000000000000000000000000000..a4ad29a9302026a16eccbd8399c380e21a146ba7 GIT binary patch literal 6700 zcmbuDU2Ggz702(`YrEysrkFwtbO{9dMVhsfCWSPtzlsyu#EBC(khGie?${o(A7*AY ziNn{lfk0_N;(-T5g~$U%N*+M;g+3r9eM4=fB88Ve^Z_XFfRI4q1tHA;e?NBT?(9t> zIMUp?bAI=pbI&=m_l_+@N8Z=ziSZw*{vG$L`}pgIO>CbiZJXRSxof2){3JZ3 zBi-D*_U8*He;xcNe(?{-54|#T{_o#|_ROFV1H_PBLZq0oDIZeV%El9(cwtbazw|^} zfQBY{86kfM9_9)n<(>9yJ|NzN?JdxAK3syQXq9-Fu?_a`!{aTul#f(Fw6wnicVF8d zlDZBCwe1f}o^}TG+8@brPh1!fX{7CQ4cA-$t-1O3`rnr0o|s2`mk~7c`*!k_UX);c zUJ3c(Ma~?0J*@4!!Mv zSo{R>nfUobv3Wr}gWAT>Gq&4vd`Qke2R-xmeg{9V`3D^QInD2I@E>S?r-T1k^A9@s z&ouv#ga1PF4?Flvn&0K%FKb?O@K-edh=X6#oWFBB|0=)O17vfnFT{9_LO56!na z_`fy(xPuR)xUBCddiVgeqX1iRJq&g?uF({Y7PG(X0q5`U9$b8njF4Z%yFah_y#W3A z5zV>J_2VZszu&=6Y5qwEKdt#T2fv{C0}lSY=G*&l?%$U*FZJOU!C%sRq7Uc%mo=Ys z@ZW0Ay}ma;od1UAJNs~+Pk+_?!9JYx|D`$3xt#rR99j?H!Vs~WJVm30`ycn0oti%c z{b<=x&Qbg8!{FTCK1H5pxxK%Cn!KFl_Wrtuyo+IdQ0#|o?r+?i_>S7VAl}0Ij$sVX zj=ho>(JJx8kbFOVaK68v!8Iz13ZgZ(b2fgioSk{mJS-(dmFQQfAi4m)Qk3ntMM{!fX0}gKL zcQD7*`TV?&Z-G2TqXqTx@SE>^pB#ezdhs15H(!@1ZYJZ-{QU;DS)U@FPvWxqh|K>RI(}dBB3dQ<7R}~= z8EQNKiktYW4sPPF<+$?yruHA?xb1(%!Hxe_2RHutoocUtMDAa|hkw4Qq2y?^@b}66 z?T?xxk3IQQ``4eqxqqD^PxWNndcVKx%qtGQQj4 zpY=Ns+&G~nPJ)g5gIt|YK?aO@12)`eB zew+R6E0PsEBUs;TeZK18CO=xbgqAgB$EOoy1qV0&zvbX3;Ggfuw{slpLw%kE=lSzYj@#?|j)R-^J?r3R zeb42%C-;|7ukX8(cbfzL>BoY2ZPrhGv9ORtd**6k(u(HJCP6a}Tg|G`|+As-bjM@`1U7sr(`-4 zrZZ_eJ4|P%={#sUyG&=d={#gQrLO6Y?NY~hsbjs=F<*jxz3%CDSg$PxNfI_!<8ExW z+FuQt$&rn9CP(%U`?atgtNwftuC67jzgTar2dX<$4;#y(9@JKY*{HRyM>YJj``eB6 zscO`Ut00ZazGhAL z^vW8Q8AK99VDc43P?ZC%nq_8si5g~)5#z+gy>f76h5jB5o2Ozi)lOO&h4#Cc_z~^R zHEU>fEgKb1VUeLzbbFbb+Nz(!@U)sCtrcbM5qd`Zq=%7V!QW@la({s861e&ufd zW!{w&+(iCQ8Nq!09?L!H8lIP?4$N|YqiKbA}`@h&}ki{4a5u7_+{Z zTS~s3O3yeMFY8GSV`Ge_&%3E%wy(x?>nYOVl$>(2^%Sz6yVax{w7vB-!;LTADcv~b zBkIYRR6YB}Y3j+l>C2gNo_V)3aY8?w7E;`9Do&2$e}abPe}mN1O|<;iN?C{<)33ey g>fX$F=ortvN@s%33~+agQ(#+#koU~6l)fzaFP`2{bN~PV literal 0 HcmV?d00001 diff --git a/Assets/Scenes/Beating-With-Sticks/NavMesh.asset.meta b/Assets/Scenes/Beating-With-Sticks/NavMesh.asset.meta new file mode 100644 index 0000000..6ed863e --- /dev/null +++ b/Assets/Scenes/Beating-With-Sticks/NavMesh.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad41150ae7e034348ad7e7be379d8056 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 23800000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene 1.meta b/Assets/Scenes/SampleScene 1.meta new file mode 100644 index 0000000..55a617e --- /dev/null +++ b/Assets/Scenes/SampleScene 1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e039091e66d77cf47a998fb931c89317 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene 1/NavMesh.asset b/Assets/Scenes/SampleScene 1/NavMesh.asset new file mode 100644 index 0000000000000000000000000000000000000000..a4ad29a9302026a16eccbd8399c380e21a146ba7 GIT binary patch literal 6700 zcmbuDU2Ggz702(`YrEysrkFwtbO{9dMVhsfCWSPtzlsyu#EBC(khGie?${o(A7*AY ziNn{lfk0_N;(-T5g~$U%N*+M;g+3r9eM4=fB88Ve^Z_XFfRI4q1tHA;e?NBT?(9t> zIMUp?bAI=pbI&=m_l_+@N8Z=ziSZw*{vG$L`}pgIO>CbiZJXRSxof2){3JZ3 zBi-D*_U8*He;xcNe(?{-54|#T{_o#|_ROFV1H_PBLZq0oDIZeV%El9(cwtbazw|^} zfQBY{86kfM9_9)n<(>9yJ|NzN?JdxAK3syQXq9-Fu?_a`!{aTul#f(Fw6wnicVF8d zlDZBCwe1f}o^}TG+8@brPh1!fX{7CQ4cA-$t-1O3`rnr0o|s2`mk~7c`*!k_UX);c zUJ3c(Ma~?0J*@4!!Mv zSo{R>nfUobv3Wr}gWAT>Gq&4vd`Qke2R-xmeg{9V`3D^QInD2I@E>S?r-T1k^A9@s z&ouv#ga1PF4?Flvn&0K%FKb?O@K-edh=X6#oWFBB|0=)O17vfnFT{9_LO56!na z_`fy(xPuR)xUBCddiVgeqX1iRJq&g?uF({Y7PG(X0q5`U9$b8njF4Z%yFah_y#W3A z5zV>J_2VZszu&=6Y5qwEKdt#T2fv{C0}lSY=G*&l?%$U*FZJOU!C%sRq7Uc%mo=Ys z@ZW0Ay}ma;od1UAJNs~+Pk+_?!9JYx|D`$3xt#rR99j?H!Vs~WJVm30`ycn0oti%c z{b<=x&Qbg8!{FTCK1H5pxxK%Cn!KFl_Wrtuyo+IdQ0#|o?r+?i_>S7VAl}0Ij$sVX zj=ho>(JJx8kbFOVaK68v!8Iz13ZgZ(b2fgioSk{mJS-(dmFQQfAi4m)Qk3ntMM{!fX0}gKL zcQD7*`TV?&Z-G2TqXqTx@SE>^pB#ezdhs15H(!@1ZYJZ-{QU;DS)U@FPvWxqh|K>RI(}dBB3dQ<7R}~= z8EQNKiktYW4sPPF<+$?yruHA?xb1(%!Hxe_2RHutoocUtMDAa|hkw4Qq2y?^@b}66 z?T?xxk3IQQ``4eqxqqD^PxWNndcVKx%qtGQQj4 zpY=Ns+&G~nPJ)g5gIt|YK?aO@12)`eB zew+R6E0PsEBUs;TeZK18CO=xbgqAgB$EOoy1qV0&zvbX3;Ggfuw{slpLw%kE=lSzYj@#?|j)R-^J?r3R zeb42%C-;|7ukX8(cbfzL>BoY2ZPrhGv9ORtd**6k(u(HJCP6a}Tg|G`|+As-bjM@`1U7sr(`-4 zrZZ_eJ4|P%={#sUyG&=d={#gQrLO6Y?NY~hsbjs=F<*jxz3%CDSg$PxNfI_!<8ExW z+FuQt$&rn9CP(%U`?atgtNwftuC67jzgTar2dX<$4;#y(9@JKY*{HRyM>YJj``eB6 zscO`Ut00ZazGhAL z^vW8Q8AK99VDc43P?ZC%nq_8si5g~)5#z+gy>f76h5jB5o2Ozi)lOO&h4#Cc_z~^R zHEU>fEgKb1VUeLzbbFbb+Nz(!@U)sCtrcbM5qd`Zq=%7V!QW@la({s861e&ufd zW!{w&+(iCQ8Nq!09?L!H8lIP?4$N|YqiKbA}`@h&}ki{4a5u7_+{Z zTS~s3O3yeMFY8GSV`Ge_&%3E%wy(x?>nYOVl$>(2^%Sz6yVax{w7vB-!;LTADcv~b zBkIYRR6YB}Y3j+l>C2gNo_V)3aY8?w7E;`9Do&2$e}abPe}mN1O|<;iN?C{<)33ey g>fX$F=ortvN@s%33~+agQ(#+#koU~6l)fzaFP`2{bN~PV literal 0 HcmV?d00001 diff --git a/Assets/Scenes/SampleScene 1/NavMesh.asset.meta b/Assets/Scenes/SampleScene 1/NavMesh.asset.meta new file mode 100644 index 0000000..fd58ffd --- /dev/null +++ b/Assets/Scenes/SampleScene 1/NavMesh.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a389199382966ca4d8633d20a83e0eca +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 23800000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/StickBeatings.meta b/Assets/Scripts/StickBeatings.meta new file mode 100644 index 0000000..669b3fe --- /dev/null +++ b/Assets/Scripts/StickBeatings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2e3b1de8c68c5f49880cb3e8ef7d3c9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/StickBeatings/AIScript.cs b/Assets/Scripts/StickBeatings/AIScript.cs new file mode 100644 index 0000000..c985f2f --- /dev/null +++ b/Assets/Scripts/StickBeatings/AIScript.cs @@ -0,0 +1,113 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.AI; + +//* General Comments or Finished Tasks +//TODO Tasks left to be done for game +//! Bugs or Issues +//? Questions or Suggestions + +//TODO AI Script for the Stick Beating Game +//* AI for enemies to run away from the character once in range +//* AI should change direction every few seconds to make it harder for the player to hit them +//TODO AI should not go into a direction within the player's range +//* If player is not in range, AI should move randomly + +public class AIScript : MonoBehaviour +{ + private bool runningCoroutine = false; + public GameObject player; + public NavMeshAgent agent; + + //* Patroling + public Vector3 walkPoint; + public bool walkPointSet; + public float walkPointRange; + + //* States + public bool playerInSightRange = false; + + void Start() + { + + player = GameObject.Find("Capsule"); + agent = GetComponent(); + } + + // Update is called once per frame + void Update() + { + if(!playerInSightRange) Patroling(); + if(playerInSightRange) Running(); + } + + private void Patroling() + { + agent.speed = 3.5f; + if(!walkPointSet) SetWalkPointPatroling(); + + if(walkPointSet) + agent.SetDestination(walkPoint); + + Vector3 distanceToWalkPoint = transform.position - walkPoint; + + if(distanceToWalkPoint.magnitude < 1f) + walkPointSet = false; + } + + private void SetWalkPointPatroling() + { + float randomZ = Random.Range(-walkPointRange, walkPointRange); + float randomX = Random.Range(-walkPointRange, walkPointRange); + + walkPoint = new Vector3(randomX, transform.position.y, randomZ); + walkPointSet = true; + } + private void Running() + { + agent.speed = 6f; + if(!walkPointSet) SetWalkPointRunning(); + + if(walkPointSet) + agent.SetDestination(walkPoint); + if(!runningCoroutine) StartCoroutine(WaitTime()); + + Vector3 distanceToWalkPoint = transform.position - walkPoint; + + if(distanceToWalkPoint.magnitude < 1f) + walkPointSet = false; + + } + + private void SetWalkPointRunning() + { + float randomZ = Random.Range(-walkPointRange, walkPointRange); + float randomX = Random.Range(-walkPointRange, walkPointRange); + + walkPoint = new Vector3(randomX, transform.position.y, randomZ); + + walkPointSet = true; + } + + IEnumerator WaitTime() + { + runningCoroutine = true; + yield return new WaitForSeconds(Random.Range(2, 5)); + walkPointSet = false; + runningCoroutine = false; + } + + private void OnTriggerEnter(Collider other) { + if(other.gameObject == player) + { + playerInSightRange = true; + } + } + private void OnTriggerExit(Collider other) { + if(other.gameObject == player) + { + playerInSightRange = false; + } + } +} diff --git a/Assets/Scripts/StickBeatings/AIScript.cs.meta b/Assets/Scripts/StickBeatings/AIScript.cs.meta new file mode 100644 index 0000000..ebf0d7c --- /dev/null +++ b/Assets/Scripts/StickBeatings/AIScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b478d0ab1ff19cb4cb9e6161ea2a14d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Documentation/Mini-Game-Concepts/Beating With Sticks.md b/Documentation/Mini-Game-Concepts/Beating With Sticks.md index b35c512..24d4de0 100644 --- a/Documentation/Mini-Game-Concepts/Beating With Sticks.md +++ b/Documentation/Mini-Game-Concepts/Beating With Sticks.md @@ -2,11 +2,11 @@ Beating With Sticks Beating with sticks is a minigame where the player is given a big long stick they drag around and are tasked with beating the ever loving shit out of -other people. This can be other players if that’s every implemented, enemy -Ais that are also trying to beat you to death, or animals or something like +other people. This can be other players if that’s ever implemented, enemy +AIs that are also trying to beat you to death, or animals or something like that which will run from you. If it’s against animals or AIs that don’t fight back, the player can click on them every few seconds to stun them. Maybe -a rock is thrown in their direction. The player will either need to get all Ais +a rock is thrown in their direction. The player will either need to get all AIs before a time limit or be the last one standing. >[!NOTE] Beating With Sticks Concept Art diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 84c5cf2..83a81c4 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -10,11 +10,12 @@ TagManager: - Container - Bomb - SpecialObject + - Touch layers: - Default - TransparentFX - Ignore Raycast - - + - Player - Water - UI -