Unity 64

[Unity 2D / 유니티 교과서] 5장 예제 + 이동범위 제한

Mathf.Clamp(value, min, max)를 사용하여 x좌표 이동범위 제한 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float radius; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { float posX = Mathf.Clamp(transform.position.x, -8.0f, 8.0f); if (Input.GetKeyDown(KeyC..

카테고리 없음 2023.01.31

[Unity 2D / 유니티 교과서] 4장 예제 SwipeCar

AudioSource mp3파일이 아닌 ogg파일로 변경해서 사용하기! ( 용량 최소 약 1/5로 줄음) Input.mousePosition Unity공간 좌표가 아니라 실행화면의 Screen(픽셀공간) 좌표 죄표계는 3D, Screen, UI 각각 존재 Awake 이벤트 함수. (활성화된 오브젝트에서!)인스턴스 생성 직후 실행. Start보다 먼저 실행 transform.Translate(x, y, z, Space.self/world) 로컬 좌표. 월드 좌표GameObject.Find("string") Scene안에 있는 GameObject 이름 검색(오타 주의) CarController using System.Collections; using System.Collections.Generic; usin..

Unity/수업내용 2023.01.30