Open EngediKimHyeYoung opened 2 years ago
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayController : MonoBehaviour
{
private Animator animator;
void Start()
{
animator = GetComponent
void Update()
{
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
transform.Translate(-0.5f, 0, 0);
transform.localScale = new Vector2(-1, 1);
animator.SetBool("Run", true);
//Debug.Log("왼쪽키를 눌렀군요");
}
if (Input.GetKeyDown(KeyCode.RightArrow))
{
transform.Translate(0.5f, 0, 0);
transform.localScale = new Vector2(1, 1);
animator.SetBool("Run", true);
//Debug.Log("오른쪽키를 눌렀군요");
}
}
}
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerController : MonoBehaviour { // Start is called before the first frame update void Start() { Debug.Log("hi"); }
}