[Unity2D] 몬스터,캐릭터와 충돌 및 공격 변경
C#/Unity2020. 7. 9. 17:28[Unity2D] 몬스터,캐릭터와 충돌 및 공격 변경

GreenMonster.cs using System.Collections; using System.Collections.Generic; using UnityEngine; // 이동간 절대기준 사용위한 Tweening 라이브러리 사용 using DG.Tweening; using System; public class GreenMonster : MonoBehaviour { //////////////////////////////////////////////////////////////////////////////// // 멤버변수 선언 bool _IsMoveAction = false; // 이동 겹치기 방지 bool _DontMoveDown = false; bool _DontMoveUp = false; bool..

[Unity2D] 몬스터만들기, 애니메이션, 애니메이터(이동, 대기, 공격, 죽음)
C#/Unity2020. 7. 8. 17:26[Unity2D] 몬스터만들기, 애니메이션, 애니메이터(이동, 대기, 공격, 죽음)

캐릭터와 몬스터를 움직이는데는 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 충돌 조건 확인 & 총알 발사하기
C#/Unity2020. 7. 7. 17:18[Unity2D] Collision, Trigger 충돌 조건 확인 & 총알 발사하기

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을 사용한 캐릭터 움직이기
C#/Unity2020. 7. 6. 17:24[Unity2D] Tweening을 사용한 캐릭터 움직이기

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 -=..

image