본문 바로가기
728x90
반응형

C#21

[유니티] TMP 폰트 Windows > TextMeshPro > Font Asset Creator Atlas Resolution : 4096 - 4096 Character Set : Custom Range Character Sequence 32-126,44032-55203,12593-12643,8200-9900 Render Mode : SDFAA TMP_Font Asset Atlas Population Mode : Dynamic Atlas Render Mode : SDFAA Sampling Point Size : 60 2024. 1. 11.
[유니티] 오브젝트들을 거쳐가는 라인렌더러 생성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class ObjectLine : MonoBehaviour { LineRenderer lineRenderer; public Transform[] pathPoints; // 오브젝트들의 위치를 순서대로 저장하는 배열 private void Start() { lineRenderer = GetComponent(); DrawPath(); } private void Update() { DrawPath(); // 포지션 고정일 시 제거 } void DrawPath() { lineRenderer.positionCount = pathPoints.Length; // 라.. 2023. 8. 31.
[유니티]방향키로 움직이고 마우스로 화면 회전하기 빈 게임 오브젝트(Player)를 생성하고 컴포넌트 추가 메인카메라를 Player 자식으로 이동 스크립트 (카메라에 추가) using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraControl : MonoBehaviour { public float rotationSpeed = 200f; public float minXRotation = -45f; public float maxXRotation = 45f; private float currentXRotation = 0f; void Update() { // 회전 처리 float mouseX = Input.GetAxis("Mouse X"); .. 2023. 8. 29.
[유니티] 코루틴을 이용한 라이트 밝기 조절 코루틴을 이용하여 라이트의 값을 변경함. using System.Collections; using System.Collections.Generic; using UnityEngine; public class LightControl : MonoBehaviour { private float currentValue = 0f; // 현재 빛의 밝기 값 private float duration = 1f; // 밝기 변화에 걸리는 시간 (초) private bool brightness = false; // 빛의 밝기가 높아지고 있는지 여부 private void Start() { StartCoroutine(ToggleBrightness()); // 토글 코루틴 시작 } private IEnumerator Toggle.. 2023. 8. 28.
728x90
반응형