NOTE112 [Unity] 짧은 개념 정리2 [그래픽 최적화]- Bottleneck- Draw Call- Batching- Profiling- Profiling Sample- Level Of Detail- Lighting- Physically Based Rendering [Quaternion] (펌)- 적 캐릭터가 사용자를 바라볼 때와 같이 회전 시킬 때, transform.LookAt() 함수를 사용해도 되지만, 한 축으로만 회전 시키고 싶을 때- 이걸로 방향 벡터를 구해주고.- 이걸로 오일러 앵글로 리턴시켜주면 된다- 요렇게 [RotateAround]- 타겟을 중심으로 주위를 회전. [SystemInfo.deviceUniqueIdentifier]- 디바이스 고유아이디 2016. 10. 7. [Unity] Unity Script 정리 [Vector Maths] - 두 점사이의 거리를 구하는 Vector3.magnitude - 두 벡터 VectorA(x,y,z) VectorB(x,y,z) 내적 : (Ax*Bx) + (Ay*By) + (Az*Bz) = Dot Product (가 0이면 두 점은 직각) 을 나타내는 Vector3.Dot(VectorA, VectorB) 가 있다. - Cross Product를 나타내는 Vector3.Cross(VectorA, VectorB) [Enabling and Disabling Components] - 효과적으로 컴포넌트를 토글화 시키는 방법 public class EnableComponents : MonoBehaviour { private Light myLight; void Start () { myL.. 2016. 10. 6. [SaveSource] GyroScope Camera [CameraScene]스마트폰움직임이랑 Unity MainCamera랑 움직임 동일화 1. GyroCamera.cs using UnityEngine; using System.Collections; public class GyroCamera : MonoBehaviour { private Gyroscope gyro; private bool gyroSupported; private Quaternion rotFix; void Start () { gyroSupported = SystemInfo.supportsGyroscope; GameObject camParent = new GameObject("camParent"); camParent.transform.position = transform.position; t.. 2016. 10. 6. [C#] Singleton 싱글톤을 만드는 방법에는 여러가지가 있지만,프로퍼티를 이용하여 사용하기 편하게 하는 것이 좋다.1. public class InputManager : MonoBehaviour { private static InputManager _inputInstance; public static InputManager Instance { get { if(_inputInstance == null) { _inputInstance = FindObjectOfType(typeof(InputManager)) as InputManager; if(_inputInstance) { GameObject container = new GameObject(); container.name = "InputManagerObj"; _inputInst.. 2016. 10. 5. 이전 1 ··· 18 19 20 21 22 23 24 ··· 28 다음