C#/Unity

    [기타내용] 공부할때 썼던 내용들

    DOTween 라이브러리 : 2D 이동할 때 사용한다 빠른 PC는 100번 움직이고 느린 PC는 50번 움직일 수 있기 때문에 절대기준인 시간으로 잡았다. Prefab(프리팹) : 재사용 게임 오브젝트 총알이나 몬스터등 실체가 아닌 정보를 가지고있는 오브젝트 Rigidbody : 물리엔진 Mass : 질량 Liner Drag : 직선가중치 Angular Drag : 회전가중치 Collision Detection : 충돌시 파악 (Discrete : 웬만하면 기본) Cinemachine : 시네머신 영상처럼 만들수있어서 정말 중요한 카메라 Animator : 애니메이션(상태)를 가지고있는 매니저 Transition Duratior : 변하는 속도, 낮을 수록 빠르다 Can Transition To : an..

    [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] 몬스터만들기, 애니메이션, 애니메이터(이동, 대기, 공격, 죽음)

    캐릭터와 몬스터를 움직이는데는 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 충돌 조건 확인 & 총알 발사하기

    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을 사용한 캐릭터 움직이기

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