출처 :https://sites.google.com/site/changgugaebaljeongli/unity3d/geim-gineung
유도 미사일 구현 - iTween
using UnityEngine; using System.Collections; public class Missile : MonoBehaviour { public float missileSpeed = 5.0f; public float missileDelay = 0f; void Update () { Vector3 testVec =Camera.main.ScreenToWorldPoint(Input.mousePosition); - 스크린 좌표를 게임내 좌표로 변경 시켜주는 부분 testVec.z = 0f; - 2D용으로 만드는 경우 z값은 받아오지 않는다 iTween.LookUpdate(gameObject,iTween.Hash("looktarget",testVec,"time",20)); - 미사일이 마우스쪽을 바라 보도록 회전 시켜주는 부분 iTween.MoveUpdate(gameObject,iTween.Hash ("position",testVec,"time",missileSpeed)); - 미사일이 마우스쪽을 향하도록 일정한 속도로 이동시켜 주는 부분 } } |
'잡다한것들전부 > 에셋' 카테고리의 다른 글
| [iTween] 유도 미사일 구현 관련 내용 (0) | 2014.01.10 |
|---|---|
| [유니티3d][에셋] 유니티 필수 에셋 iTween 에 대해서 알아보자(Action!) (0) | 2014.01.09 |
Trackback 0 And
Comment 0


