[고1 게임엔진] 09 - (2)
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { // 좌우이동 && 점프(velocity만 사용) // 리지드바디2D형 변수선언 Rigidbody2D rb; [HideInInspector] public float speed = 5; // 좌우이동시 이동 속도 public float jumpPower = 8; // 점프력 float axisH; // 좌우이동 여부 // public 처럼 에디터에서 편집 가능, 하지만 외부스크립트에서는 접근불가(private) [SerializeField] Transform tr; // 트랜스폼 컴..
2023.09.11