KNU_SpaceShooter/Assets/02_Scripts/PlayerController.cs
2024-09-11 14:12:27 +09:00

33 lines
676 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private float h;
private float v;
void Start()
{
}
void Update()
{
h = Input.GetAxis("Horizontal"); // 1차원 연속값 -1.0 ~ 0.0 ~ +1.0
v = Input.GetAxis("Vertical"); // -1.0f ~ 0.0f ~ +1.0f
Debug.Log("h=" + h + " v=" + v);
transform.Translate(Vector3.forward * 0.01f);
}
}
/*
Vector3.forward = Vector3(0, 0, 1)
Vector3.up = Vector3(0, 1, 0)
Vector3.right = Vector3(1, 0, 0)
Vector3.one = Vector3(1, 1, 1)
Vector3.zero = Vector3(0, 0, 0)
*/