유한 상태 모델과 연관한 코딩
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
public Animator animator;
// getControl 로 자기자신을 가지고 올 수 있고
// 여기에 하이라키 뷰에서 자기자신을 드래그해서 가져올 수도 있다.
// Update is called once per frame
void Update () {
if(Input.GetMouseButtonDown(0))
{ // 애니메이터 (매카님) 에서 지원하는 파라미터
animator.SetBool("Move", true);
}
if(Input.GetMouseButtonDown(1))
{
animator.SetBool("Move", false);
}
}
}
'Unity' 카테고리의 다른 글
LookAt 함수. 고정된 카메라 회전. 감시카메라 (0) | 2014.08.10 |
---|---|
유니티 2D 스프라이트 (0) | 2014.08.07 |
Ray 쏘아 오브젝트 삭제 (0) | 2014.08.06 |
유니티 물체 배치 (0) | 2014.08.06 |
Trail Renderer (0) | 2014.08.06 |