목록Game (46)
Machineboy空
using System.Collections; using System.Collections.Generic; using UnityEngine; //구조체 등을 다 때려넣는 클래스용으로 DataManager만들었다 [System.Serializable] public class UserInfo { public string name; public string phone; public string email; public int age; public bool gender; } [System.Serializable] public class ShopInfo { public string name; public int price; public int model; } public class DataManager : Mon..
Unity의 저장된 폴더들 - StreamingAssets - Resources 등

속력(Velocity) 속도(Speed) 단위 시간 당 이동한 거리(distance) 단위 시간 당 총 변위(출발점과의 거리와 방향) 변위(displacement) = 출발점과 도착점의 직선거리와 그 방향 Scalar값 (크기 O, 방향 X) Vector값 (크기 O, 방향 O) 속력>=0 속도: 음수, 양수, 0 가능 속력(velocity) a의 변위 = b의 변위 속도(speed) a의 이동거리 > b의 이동거리

Unity가 스크립트의 수명 주기 동안 실행되는 이벤트 함수의 순서 에디터 Reset 에디터 프로퍼티 첫번째 씬 로드 Awake Start함수 전, Prefab이 Instance화 된 직후에 호출된다. GameObject가 비활성 상태인 경우 활성화될 때까지 호출되지 않는다. OnEnable 오브젝트 활성화 직후 함수 호출 Level이 Load되거나 Script Component를 포함한 GameObject가 Instance화 될 때 OnLevelWasLoaded 새 Level이 Load된 게임을 통지하기 위해 실행 첫번째 프레임 업데이트 전 Start Script Instance가 활성화된 경우, 첫 번째 frame Update전 호출 프레임 사이 OnApplicationPause 일시 정지가 감지된 ..

1) 각속도(Angular Velocity) 회전하는 물체의 단위시간당 각위치 어떤 점의 둘레를 Ts 동안에 일주하는 물체의 각속도는 2π/T rad/sec이다. * 원의 둘레/ 시간 = 2πr / t // 잡은 물체를 던질 때 손의 궤적(?)이 곡선일테니까. // 직선 속도 공식이 아닌 각속도 공식을 이용한다. handAngularVelocity = radian / Time.fixedDeltaTime * axis; 2) 자유 낙하(Free fall) 뉴턴 역학에서 오직 중력만이 작용하는 물체의 운동 정지한 물체를 놓고, 오직 중력에 의해서만 낙하하는 상태 낙하는 통상적으로 밑으로 향하는 운동을 의미 뉴턴 역학의 자유낙하는 중력의 방향에 따라 반드시 밑을 향하지는 않을 수 있다. 예) 달의 궤도가 지구를..
Layer 이름 string으로 찾기LayerMask.NameToLayer(string)shift연산으로 Layer index 찾기int layerMask = 1LayerMask.NameToLayer("Layer1");LayerMask.GetMask함수int layerMask = LayerMask.GetMask("string");//01.public 으로 할당public LayerMask enemyLayer;if(Physics.Raycast(ray, out hitInfo, attackRange, enemyLayer)){}//02.LayerMask.NameToLayer(string)if(other.gameObject.layer == LayerMask.NameToLayer("Floor"){}//03. Lay..
public Transform drone; Vector3 droneOriginScale; Vector3 droneOriginPosition; void Start() { droneOriginScale = drone.localScale; droneOriginPosition = drone.localPosition; } void Update() { //1초 동안 currentTime += Time.deltaTime; if(currentTime 30초 구간을 100분위로 나눈 구간을 기준으로 움직일 것 t는 1로 수렴하는 채워야할 값이고 그 구간을 초 시간단위로 나눠주는 느낌. 1을 다 채우기 위해서 (=수렴하기 위해서) 필요한 시간만큼으로 나눠주는 것