'2014/01'에 해당되는 글 185건
- 2014.01.28 폭파 불꽃 관련 파티클 이미지
- 2014.01.28 유니티의 오브젝트 크기, 위치, 색 설정하기
- 2014.01.28 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트
- 2014.01.28 유니티 오브젝트 키보드로 움직이기
- 2014.01.28 배경화면 스크롤 방법
- 2014.01.28 제트기 뒤 분화구 파티클 패키지 파일
- 2014.01.28 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer)
- 2014.01.28 3D 오브젝트 파일 콜라이더 생성 Generate Colliders
- 2014.01.28 ScreenToWorldPoint 사용시
- 2014.01.28 유니티 카메라 관련 좌표값 변경 스크립트들 (1)
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티 키 입력 관련 input manager 클래스관련 (0) | 2014.01.28 |
|---|---|
| 유니티 SendMessage함수를 사용해서 다른 오브젝트의 특정 함수 호출하기 (0) | 2014.01.28 |
| 폭파 불꽃 관련 파티클 이미지 (0) | 2014.01.28 |
| 유니티의 오브젝트 크기, 위치, 색 설정하기 (0) | 2014.01.28 |
| 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트 (0) | 2014.01.28 |
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
오브젝트의 크기는 localScale 속성으로 설정합니다.
오브젝트의 색상은(Red, Green, Blue, Alpha)로 설정하며, 각각 0~1 사이의 값으로 지정합니다.(메트리얼이 존재해야됩니다.)
오브젝트의 위치는 position 속성으로 설정합니다.
Transform.localScale
The scale of the transform relative to the parent.
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void Example() { transform.localScale += new Vector3(0.1F, 0, 0); } }
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티 SendMessage함수를 사용해서 다른 오브젝트의 특정 함수 호출하기 (0) | 2014.01.28 |
|---|---|
| 폭파 불꽃 관련 파티클 이미지 (0) | 2014.01.28 |
| 유니티의 오브젝트 크기, 위치, 색 설정하기 (0) | 2014.01.28 |
| 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트 (0) | 2014.01.28 |
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
키보드로 오브젝트를 이동시 좌우나 앞으로의 이동을 화면 안으로 제한하고 싶을 경우 쓰는 스크립트
Transforms position from world space into screen space.
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public Transform target; void Update() { Vector3 screenPos = camera.WorldToScreenPoint(target.position); print("target is " + screenPos.x + " pixels from the left"); } }
'유니티 > 스크립트' 카테고리의 다른 글
| 폭파 불꽃 관련 파티클 이미지 (0) | 2014.01.28 |
|---|---|
| 유니티의 오브젝트 크기, 위치, 색 설정하기 (0) | 2014.01.28 |
| 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트 (0) | 2014.01.28 |
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티의 오브젝트 크기, 위치, 색 설정하기 (0) | 2014.01.28 |
|---|---|
| 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트 (0) | 2014.01.28 |
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
스크롤방법
1. 오브젝트를 직접 이동하는 방법(Transform 사용)
2. 오브젝트의 메트리얼의 Offset 값을 이동하는 방법
2번의 방법이 구현이 간단함.
배경이 지속적으로 변하는 게 아니라면 2번의 방법으로 구현하는게 좋은거 같습니다.
아래는 종 방향으로 스크롤 되는 예제입니다.
횡방향인 경우에는
로 하면 되겠죠?
메트리얼의 Offset은 ViewPort 좌표계를 사용합니다 0~1 인 상대좌표계이죠.
만약에 1이상인 경우에는 정수 부분을 무시해 버립니다. 그래서 위의 스크립트가 정상 작동 하는 것이죠.
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티 WorldToScreenPoint를 사용하여 좌우 이동을 제한하는 스크립트 (0) | 2014.01.28 |
|---|---|
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티 오브젝트 키보드로 움직이기 (0) | 2014.01.28 |
|---|---|
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
| ScreenToWorldPoint 사용시 (0) | 2014.01.28 |
유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer)
| 유니티/스크립트 2014. 1. 28. 14:30유니티의 파티클 관련 속성 값
Properties
| Emit | If enabled, the emitter will emit particles. |
| Min Size | 각 입자의 최소 크기. |
| Max Size | 각 입자의 최대 크기. |
| Min Energy | 입자의 초단위 최소 수명. |
| Max Energy | 입자의 초단위 최대 수명. |
| Min Emission | 매초 만드는 입자의 최소 수. |
| Max Emission | 매초 만드는 입자의 최대 수. |
| World Velocity | 월드 기준 입자의 확산 방향 및 속도. |
| Local Velocity | 로컬 기준 입자의 확산 방향 및 속도. |
| Rnd Velocity | 입자의 확상 방향 및 속도 랜덤 값. |
| Emitter Velocity Scale | The amount of the emitter's speed that the particles inherit. |
| Tangent Velocity | The starting speed of particles along X, Y, and Z, across the Emitter's surface. |
| Angular Velocity | The angular velocity of new particles in degrees per second. |
| Rnd Angular Velocity | A random angular velocity modifier for new particles. |
| Rnd Rotation | If enabled, the particles will be spawned with random rotations. |
| Simulate In World Space | 이동시 궤적 표시 금지. |
| One Shot | If enabled, the particle numbers specified by min & max emission is spawned all at once. If disabled, the particles are generated in a long stream. |
| Ellipsoid | 입자 생성 범위. |
| MinEmitterRange | Determines an empty area in the center of the sphere - use this to make particles appear on the edge of the sphere. |
Properties
| Does Animate Color | If enabled, particles cycle their color over their lifetime. |
| Color Animation | 5가지의 생상에 따라 입자의 색상이 변화됨. |
| World Rotation Axis | An optional world-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life. |
| Local Rotation Axis | An optional local-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life. |
| Size Grow | Use this to make particles grow in size over their lifetime. As randomized forces will spread your particles out, it is often nice to make them grow in size so they don't fall apart. Use this to make smoke rise upwards, to simulate wind, etc. |
| Rnd Force | A random force added to particles every frame. Use this to make smoke become more alive. |
| Force | The force being applied every frame to the particles, measure relative to the world. |
| Damping | How much particles are slowed every frame. A value of 1 gives no damping, while less makes them slow down. |
| Autodestruct | If enabled, the GameObject attached to the Particle Animator will be destroyed when all particles disappear. |
Properties
| Cast Shadows | If enabled, allows object to cast shadows. |
| Receive Shadows | If enabled, allows object to receive shadows. |
| Materials | Reference to a list of Materials that will be displayed in the position of each individual particle. |
| Use Light Probes | If enabled and baked light probes are present in the scene, an interpolated light probe. |
| Light Probe Anchor | If set, Renderer will use this Transform's position to find the interpolated light probe. |
| Camera Velocity Scale | The amount of stretching that is applied to the Particles based on Camera movement. |
| Stretch Particles | Determines how the particles are rendered. |
| Billboard | The particles are rendered as if facing the camera. |
| Stretched | The particles are facing the direction they are moving. |
| SortedBillboard | The particles are sorted by depth. Use this when using a blending material. |
| VerticalBillboard | All particles are aligned flat along the X/Z axes. |
| HorizontalBillboard | All particles are aligned flat along the X/Y axes. |
| Length Scale | If Stretch Particles is set to Stretched, this value determines how long the particles are in their direction of motion. |
| Velocity Scale | If Stretch Particles is set to Stretched, this value determines the rate at which particles will be stretched, based on their movement speed. |
| UV Animation | If either of these are set, the UV coordinates of the particles will be generated for use with a tile animated texture. See the section on Animated Textures below. |
| X Tile | Number of frames located across the X axis. |
| Y Tile | Number of frames located across the Y axis. |
| Cycles | How many times to loop the animation sequence. |
'유니티 > 스크립트' 카테고리의 다른 글
| 배경화면 스크롤 방법 (0) | 2014.01.28 |
|---|---|
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
| ScreenToWorldPoint 사용시 (0) | 2014.01.28 |
| 유니티 카메라 관련 좌표값 변경 스크립트들 (1) | 2014.01.28 |
Generate Colliders 항목을 설정하면 오브젝트에 콜라이더가 만들어진다.
이 옵션으로 콜라이더를 만들 수 있는 것은 오브젝트가 255개 이내의 정점으로 이루어진 경우이다.
그 이상은 콜라이더를 만들수 없으니 주의(로우 폴리곤 모델은 이런식으로 만들어도 좋을듯)
'유니티 > 스크립트' 카테고리의 다른 글
| 제트기 뒤 분화구 파티클 패키지 파일 (0) | 2014.01.28 |
|---|---|
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
| ScreenToWorldPoint 사용시 (0) | 2014.01.28 |
| 유니티 카메라 관련 좌표값 변경 스크립트들 (1) | 2014.01.28 |
| 유니티 특정 시간마다 호출되는 함수 만들기. (0) | 2014.01.27 |
- // Forum code warning
- var zdepth : float;
- var newVector : vector3;
- function myfunction () {
- // Retrieve mouse position
- }
카메라와 유니티의 오브젝트간의 Z값은 반드시 입력해 주어야 된다.
Input.mousePosition은 Vector2 값이고 z값은 항상 0이 입력됩니다.
그래서 입력하지 않을 시 월드 좌표는 항상 카메라의 좌표가 됩니다.
'유니티 > 스크립트' 카테고리의 다른 글
| 유니티 파티클 관련 속성 값 (Elipsoid Particle Emitter, Particle Animator, Particle Renderer) (0) | 2014.01.28 |
|---|---|
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
| ScreenToWorldPoint 사용시 (0) | 2014.01.28 |
| 유니티 카메라 관련 좌표값 변경 스크립트들 (1) | 2014.01.28 |
| 유니티 특정 시간마다 호출되는 함수 만들기. (0) | 2014.01.27 |
| 유니티 RayCast 관련 - 마우스 클릭으로 판별 - 4.3 2D 용 전환 (0) | 2014.01.27 |
| WorldToScreenPoint | position을 월드 공간에서 화면 공간으로 변경시킵니다. |
| WorldToViewportPoint | position을 월드 공간에서 뷰포트 공간으로 변경시킵니다. |
| ViewportToWorldPoint | position을 뷰포트 공간에서 월드 공간으로 변경시킵니다. |
| ScreenToWorldPoint | position을 화면 공간에서 월드 공간으로 변경시킵니다. |
| ScreenToViewportPoint | position을 화면 공간에서 뷰포트 공간으로 변경시킵니다. |
| ViewportToScreenPoint | position을 뷰포트 공간에서 화면 공간으로 변경시킵니다. |
| ViewportPointToRay | 카메라에서 시작된 뷰포트 지점을 지나는 광선을 반환합니다. |
| ScreenPointToRay | 카메라에서 시작된 화면 지점을 지나는 광선을 반환합니다. |
월드 좌표
- 오브젝트의 위치를 나타내는 좌표계로, 화면의 중심을 원점(0,0,0)으로 하는 3차원 상대좌표계입니다.
월드 좌표계는 게임 화면을 투영하는 카메라의 위치와 회전 상태에 따라 달라지므로 반드시 화면의 중심이 원점이 되는것은 아닙니다.
화면 좌표(스크린좌표)
-스크린 좌표계는 단말기의 화면 좌표계로, 화면의 왼쪽 아래를 원점으로 하는 평면 절대좌표계입니다.
마우스 클릭이나 터치는 스크린 좌표계를 이용해서 처리합니다. 이 좌표계는 카메라의 위치나 각도와 상관없이 일정합니다.
뷰 포트 좌표
- 뷰 포트 좌표계는 화면에 글자나 2D 이미지를 표시하기 위한 좌표계로, 화면의 왼쪽 아래를 (0,0) 오른쪽 위를 (1, 1)로 하는 평면 상대 좌표계입니다.
'유니티 > 스크립트' 카테고리의 다른 글
| 3D 오브젝트 파일 콜라이더 생성 Generate Colliders (0) | 2014.01.28 |
|---|---|
| ScreenToWorldPoint 사용시 (0) | 2014.01.28 |
| 유니티 카메라 관련 좌표값 변경 스크립트들 (1) | 2014.01.28 |
| 유니티 특정 시간마다 호출되는 함수 만들기. (0) | 2014.01.27 |
| 유니티 RayCast 관련 - 마우스 클릭으로 판별 - 4.3 2D 용 전환 (0) | 2014.01.27 |
| 유니티 싱글톤 패턴 만들기 (0) | 2014.01.27 |
Explision.unitypackage




