![[Unity2D] 몬스터만들기, 애니메이션, 애니메이터(이동, 대기, 공격, 죽음)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2F75Ita%2FbtqFvfDAz8G%2FAAAAAAAAAAAAAAAAAAAAAGGLEN4wqYyCvvsnK7KBilclITGfoPyyHzWgrybyOvtw%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1751295599%26allow_ip%3D%26allow_referer%3D%26signature%3DzzXXxweNheV4ggoG6ts1S8mfp8o%253D)
캐릭터와 몬스터를 움직이는데는 Animation, Animator가 필요하다 Animation을 하나씩 만들어 Animator에 붙여 사용한다. Animator : 상태 관리자 Animation : 각각의 상태 GreenMonster.cs using System.Collections; using System.Collections.Generic; using UnityEngine; // 이동간 절대기준 사용위한 Tweening 라이브러리 사용 using DG.Tweening; using System; public class GreenMonster : MonoBehaviour { bool _IsAction = false; bool _IsDeath = false; bool _IsAttack = false; bo..
![[Unity2D] Collision, Trigger 충돌 조건 확인 & 총알 발사하기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FrBzf2%2FbtqFrU0QHoi%2FAAAAAAAAAAAAAAAAAAAAAAaVJpN4ha9s3qYfWG33hUWTWzxCHvxpYH_tDxasVKJR%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1751295599%26allow_ip%3D%26allow_referer%3D%26signature%3DMOoNZCQXHLCwb%252FRq00yhp061nOc%253D)
hero.cs using System.Collections; using System.Collections.Generic; using System.Reflection; using UnityEngine; // 이동간 절대기준 사용위한 Tweening 라이브러리 사용 using DG.Tweening; using UnityEditorInternal; using JetBrains.Annotations; using System; public class hero : MonoBehaviour { bool _token = false; bool _DontMoveDown = false; bool _DontMoveUp = false; bool _DontMoveLeft = false; bool _DontMoveRight = f..
![[Unity2D] Tweening을 사용한 캐릭터 움직이기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FAKzFK%2FbtqFpA2VrWx%2FAAAAAAAAAAAAAAAAAAAAANrwTJ3cpM9iJFd5CyF8tv4FRbXb-NV0pbADxmZ-4Kbc%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1751295599%26allow_ip%3D%26allow_referer%3D%26signature%3D1FWSPAUkkl6eOU%252FvT%252F1mclnH0HY%253D)
using System.Collections; using System.Collections.Generic; using System.Reflection; using UnityEngine; // 이동간 절대기준 사용위한 Tweening 라이브러리 사용 using DG.Tweening; public class hero : MonoBehaviour { bool _token = false; // Update is called once per frame void Update() { if(!_token) { // 왼쪽 if (Input.GetKey(KeyCode.LeftArrow)) { _token = true; float EndPositionX = transform.position.x; EndPositionX -=..