diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..ddb6ff8 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "visualstudiotoolsforunity.vstuc" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..da60e25 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Unity", + "type": "vstuc", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e220109 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,60 @@ +{ + "files.exclude": { + "**/.DS_Store": true, + "**/.git": true, + "**/.vs": true, + "**/.gitmodules": true, + "**/.vsconfig": true, + "**/*.booproj": true, + "**/*.pidb": true, + "**/*.suo": true, + "**/*.user": true, + "**/*.userprefs": true, + "**/*.unityproj": true, + "**/*.dll": true, + "**/*.exe": true, + "**/*.pdf": true, + "**/*.mid": true, + "**/*.midi": true, + "**/*.wav": true, + "**/*.gif": true, + "**/*.ico": true, + "**/*.jpg": true, + "**/*.jpeg": true, + "**/*.png": true, + "**/*.psd": true, + "**/*.tga": true, + "**/*.tif": true, + "**/*.tiff": true, + "**/*.3ds": true, + "**/*.3DS": true, + "**/*.fbx": true, + "**/*.FBX": true, + "**/*.lxo": true, + "**/*.LXO": true, + "**/*.ma": true, + "**/*.MA": true, + "**/*.obj": true, + "**/*.OBJ": true, + "**/*.asset": true, + "**/*.cubemap": true, + "**/*.flare": true, + "**/*.mat": true, + "**/*.meta": true, + "**/*.prefab": true, + "**/*.unity": true, + "build/": true, + "Build/": true, + "Library/": true, + "library/": true, + "obj/": true, + "Obj/": true, + "Logs/": true, + "logs/": true, + "ProjectSettings/": true, + "UserSettings/": true, + "temp/": true, + "Temp/": true + }, + "dotnet.defaultSolution": "Mini-Games-Games.sln" +} \ No newline at end of file diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 86499b0..c2f2e4e 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -1037,7 +1037,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3385535184014867849} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -5.206068, y: 0.91023076, z: -0.6962841} + m_LocalPosition: {x: 2, y: 0, z: 1} m_LocalScale: {x: 0.12, y: 0.12, z: 0.12} m_ConstrainProportionsScale: 1 m_Children: @@ -1084,13 +1084,29 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 2715678257314441011} + - component: {fileID: 3385535184014867850} m_Layer: 0 - m_Name: ArachBox + m_Name: Enemy m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!114 &3385535184014867850 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3385535184014867849} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61f2121dbaef51a4aa1fd9032df8ca37, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 1 + range: 4 + enemy: {fileID: 2715678257314441011} --- !u!23 &4126550418253595862 MeshRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/EnemyMovement.cs b/Assets/Scripts/EnemyMovement.cs new file mode 100644 index 0000000..af2468f --- /dev/null +++ b/Assets/Scripts/EnemyMovement.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +public class EnemyMovement : MonoBehaviour +{ + [Header("Speed")] + public float speed = 2; + public float range = 4; + + public Transform enemy; + + void Start() + { + } + + // Update is called once per frame + void Update() + { + enemy.position = new Vector3(Convert.ToSingle(Math.Cos(Time.time * speed)) * range, 0, Convert.ToSingle(Math.Sin(Time.time * speed)) * range); + } +} diff --git a/Assets/Scripts/EnemyMovement.cs.meta b/Assets/Scripts/EnemyMovement.cs.meta new file mode 100644 index 0000000..15c1f25 --- /dev/null +++ b/Assets/Scripts/EnemyMovement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 61f2121dbaef51a4aa1fd9032df8ca37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 33bfd97..6dbd25e 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -40,7 +40,5 @@ public class PlayerMovement : MonoBehaviour } // rb.velocity.Set(Vector3.ClampMagnitude(moveDirection, maxSpeed)); speed.Set(rb.velocity.x, rb.velocity.magnitude, rb.velocity.y); - - } }