it works!!!!!
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user