it works!!!!!

This commit is contained in:
Archie
2020-02-13 17:31:25 +00:00
parent abc6a4345d
commit 5f91fa566f
29 changed files with 250 additions and 1184 deletions

View File

@@ -2,11 +2,9 @@
using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerController : MonoBehaviour {
Vector3 direction;
public float speed;
#if tmp
public GameObject bullet;
@@ -19,20 +17,7 @@ public class PlayerController : MonoBehaviour {
// Update is called once per frame
void Update() {
//direction = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
gameObject.transform.position += Vector3.Normalize(new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0))*0.25f;
/*if(Input.GetButtonDown("Fire1")) {
Vector3 offset = transform.position + new Vector3(lastDirection.x+0.1f, lastDirection.y+0.1f, 0f);
aus.Play();
GameObject.Instantiate(bullet, offset, Quaternion.identity);
}*/
}
gameObject.transform.position += new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"), 0);
/*private void FixedUpdate() {
gameObject.transform.position += Vector3.Normalize(direction)*0.1f;
}*/
public void Move(InputValue v) {
var m = v.Get<Vector2>();
gameObject.transform.position = new Vector3(m.x, m.y, 0f);
}
}