From 9d35862108f1ce37287d547eac27367de7cefd7f Mon Sep 17 00:00:00 2001 From: NickFowler Date: Sat, 1 Feb 2020 11:18:39 +1100 Subject: [PATCH] Basic movement --- GGJ2020/Assets/Scripts.meta | 8 ++++ GGJ2020/Assets/Scripts/PlayerController.cs | 41 +++++++++++++++++ .../Assets/Scripts/PlayerController.cs.meta | 11 +++++ GGJ2020/Logs/Packages-Update.log | 45 +++++++++++++++++++ GGJ2020/Packages/manifest.json | 42 +++++++++++++++++ GGJ2020/ProjectSettings/XRSettings.asset | 3 ++ 6 files changed, 150 insertions(+) create mode 100644 GGJ2020/Assets/Scripts.meta create mode 100644 GGJ2020/Assets/Scripts/PlayerController.cs create mode 100644 GGJ2020/Assets/Scripts/PlayerController.cs.meta create mode 100644 GGJ2020/Logs/Packages-Update.log create mode 100644 GGJ2020/Packages/manifest.json create mode 100644 GGJ2020/ProjectSettings/XRSettings.asset diff --git a/GGJ2020/Assets/Scripts.meta b/GGJ2020/Assets/Scripts.meta new file mode 100644 index 0000000..fbf67ab --- /dev/null +++ b/GGJ2020/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 27509ad3d41769745ab66d33159d98b9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ2020/Assets/Scripts/PlayerController.cs b/GGJ2020/Assets/Scripts/PlayerController.cs new file mode 100644 index 0000000..82ca41d --- /dev/null +++ b/GGJ2020/Assets/Scripts/PlayerController.cs @@ -0,0 +1,41 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerController : MonoBehaviour +{ + public float walkSpeed; + + private Vector2 receivedInput; + // Start is called before the first frame update + void Start() + { + + } + + public void SetMovement(Vector2 input) + { + receivedInput = input; + } + + public void UpdatePosition() + { + float RunnerX, RunnerZ; + RunnerZ = Input.GetAxisRaw("Vertical"); + RunnerX = Input.GetAxisRaw("Horizontal"); + + //float rotateTo = RotateRunner(RunnerX, RunnerZ); + + RunnerZ = Input.GetAxis("Vertical") * Time.deltaTime * walkSpeed; + RunnerX = Input.GetAxis("Horizontal") * Time.deltaTime * walkSpeed; + + + transform.Translate(RunnerX, 0, RunnerZ); + } + + // Update is called once per frame + void Update() + { + UpdatePosition(); + } +} diff --git a/GGJ2020/Assets/Scripts/PlayerController.cs.meta b/GGJ2020/Assets/Scripts/PlayerController.cs.meta new file mode 100644 index 0000000..1acf30c --- /dev/null +++ b/GGJ2020/Assets/Scripts/PlayerController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f7fbcfa6410c204e8977bb70e5ff84b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ2020/Logs/Packages-Update.log b/GGJ2020/Logs/Packages-Update.log new file mode 100644 index 0000000..dc71288 --- /dev/null +++ b/GGJ2020/Logs/Packages-Update.log @@ -0,0 +1,45 @@ + +=== Sat Feb 1 10:36:26 2020 + +Packages were changed. +Update Mode: resetToDefaultDependencies + +The following packages were added: + com.unity.textmeshpro@2.0.1 + com.unity.collab-proxy@1.2.16 + com.unity.test-framework@1.1.9 + com.unity.timeline@1.2.10 + com.unity.ide.vscode@1.1.4 + com.unity.ide.rider@1.1.4 + com.unity.ugui@1.0.0 + com.unity.modules.ai@1.0.0 + com.unity.modules.animation@1.0.0 + com.unity.modules.androidjni@1.0.0 + com.unity.modules.assetbundle@1.0.0 + com.unity.modules.audio@1.0.0 + com.unity.modules.cloth@1.0.0 + com.unity.modules.director@1.0.0 + com.unity.modules.imageconversion@1.0.0 + com.unity.modules.imgui@1.0.0 + com.unity.modules.jsonserialize@1.0.0 + com.unity.modules.particlesystem@1.0.0 + com.unity.modules.physics@1.0.0 + com.unity.modules.physics2d@1.0.0 + com.unity.modules.screencapture@1.0.0 + com.unity.modules.terrain@1.0.0 + com.unity.modules.terrainphysics@1.0.0 + com.unity.modules.tilemap@1.0.0 + com.unity.modules.ui@1.0.0 + com.unity.modules.uielements@1.0.0 + com.unity.modules.umbra@1.0.0 + com.unity.modules.unityanalytics@1.0.0 + com.unity.modules.unitywebrequest@1.0.0 + com.unity.modules.unitywebrequestassetbundle@1.0.0 + com.unity.modules.unitywebrequestaudio@1.0.0 + com.unity.modules.unitywebrequesttexture@1.0.0 + com.unity.modules.unitywebrequestwww@1.0.0 + com.unity.modules.vehicles@1.0.0 + com.unity.modules.video@1.0.0 + com.unity.modules.vr@1.0.0 + com.unity.modules.wind@1.0.0 + com.unity.modules.xr@1.0.0 diff --git a/GGJ2020/Packages/manifest.json b/GGJ2020/Packages/manifest.json new file mode 100644 index 0000000..39e66d1 --- /dev/null +++ b/GGJ2020/Packages/manifest.json @@ -0,0 +1,42 @@ +{ + "dependencies": { + "com.unity.collab-proxy": "1.2.16", + "com.unity.ide.rider": "1.1.4", + "com.unity.ide.vscode": "1.1.4", + "com.unity.test-framework": "1.1.9", + "com.unity.textmeshpro": "2.0.1", + "com.unity.timeline": "1.2.10", + "com.unity.ugui": "1.0.0", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/GGJ2020/ProjectSettings/XRSettings.asset b/GGJ2020/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000..bfefb85 --- /dev/null +++ b/GGJ2020/ProjectSettings/XRSettings.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edd2beb4a2e388312b4b7da241aa51070434005d82c59363f1237dd2e567585f +size 158