본문 바로가기

분류 전체보기183

[언데드 서바이벌 06] 레벨업 시스템 구현 & 오류 수정 1. 레벨업 시스템 구현 레벨업을 했을때 랜덤으로 item창 나오게 하기 - itemGroup을 관리하는 'LevelUp' 오브젝트 만들어주고 자식에 아래와 같이 넣어주기 - LevelUp 스크립트 새로 생성하여 아래와 같이 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class LevelUp : MonoBehaviour { private RectTransform rect; private Item[] items; void Awake() { this.rect = this.GetComponent(); //...(true) => 활성,비활성 모두 찾음 this.items = this.GetComp.. 2023. 9. 19.
[언데드 서바이벌 05] HUD 구현 & 피격 액션 추가 & 능력 업그레이드 구현 1. HUD (Head Up Display) 구현 -Exp, Level, Kill, Time, Health - GameManger 스크립트에 Player Info 정보 추가하기 - HUD 스크립트 새로 생성하여 아래와 같이 입력 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class HUD : MonoBehaviour { public enum eInfoType { Exp, Level, Kill, Time, Health } public eInfoType type; //UI 타입들 private Text text; private Slider slider; voi.. 2023. 9. 18.
[언데드 서바이벌 04] 공격 구현(근거리, 원거리)&무기 장착 1. 공격 구현 : 근거리(삽) 오브젝트 풀링으로 만들어진 Bullet(삽)을 관리하는 Weapon을 Player에 추가 Weapon 스크립트 추가 및 작성 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Weapon : MonoBehaviour { //무기id, 프리팹id, damage, 갯수, 속도 public int id; public int prefabId; public float damage; public int count; public float speed; [SerializeField] private Bullet bullet; void Start() { this.Init(); .. 2023. 9. 16.
[언데드 서바이벌 03] 오브젝트 풀링으로 몬스터 생성 & 몬스터 레벨 적용 1. 오브젝트 풀링으로 몬스터 생성 오브젝트 풀링을 사용하는 이유? : Instantiate 와 Destory를 자주 사용하면 메모리에 문제가 생길 수 있음 따라서 오브젝트들을 미리 생성해놓고 활성/비활성을 통해 게임신에 노출하는 것을 조절하자 01. 목표 Player 주변에 설정해둔 Point들 中 랜덤으로 1곳에서 0.2초 마다 3가지 몬스터 中 하나를 랜덤으로 생성하기 설정해둔 Point(몬스터 생성 위치) 들 몬스터 종류 3가지 - PoolManager에 넣어주기 [스크립트] PoolManager using System.Collections; using System.Collections.Generic; using UnityEngine; public class PoolManager : MonoBeh.. 2023. 9. 15.
[언데드 서바이벌 02] 무한맵 생성 & 몬스터 생성 1. 무한맵 생성 플레이어와 거리가 멀어지면 앞으로 재배치 Composite Collider2D : 타일마다 나눠진 형태를 하나로 합쳐줌 기존 타일맵 콜라이더에 Used By Composite 체크 (컴포짓 콜라이더에 위임) 바닥(컴포짓 콜라이더)와 플레이어가 충돌하면 안 되므로 Is Trigger 체크 골드메탈님 ver. 카메라 따라 다니기 - Cinemachine 사용 ( 잘 모르겠어서 안 씀,,) 내 ver. 카메라 따라다니기 - CameraController 스크립트 사용 (이걸로 사용) using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraController : MonoBeh.. 2023. 9. 14.
[언데드 서바이벌 01] 게임오브젝트 생성, 애니메이션 제작, 이동 구현 1. 게임오브젝트 생성 유튜버 골드메탈님께서 만드신 교육용 게임개발 강좌이기 때문에 친절히 에셋도 다운 받을 수 있다! 에셋 다운받기 https://assetstore.unity.com/packages/2d/undead-survivor-assets-pack-238068 Undead Survivor Assets Pack | 2D | Unity Asset Store Get the Undead Survivor Assets Pack package from Goldmetal and speed up your game development process. Find this & other 2D options on the Unity Asset Store. assetstore.unity.com 에셋을 다운받아 열어보니 플.. 2023. 9. 13.