technix/Assets/script/movement/PlayerController.cs

25 lines
655 B
C#
Raw Normal View History

2020-02-06 17:00:19 +00:00
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
public class PlayerController : MonoBehaviour {
2020-02-17 22:27:07 +00:00
Vector3 direction;
public float speed = 0.5f;
2020-02-06 17:00:19 +00:00
#if tmp
public GameObject bullet;
#endif
AudioSource aus;
// Start is called before the first frame update
void Start() {
aus = GetComponent<AudioSource>();
}
// Update is called once per frame
void Update() {
2020-02-17 22:27:07 +00:00
gameObject.transform.position += new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"), 0)*speed;
if (Input.GetButton("Fire1")) gameObject.BroadcastMessage("Fire");
2020-02-06 17:00:19 +00:00
}
}