[Unity] HeadBob 구현
·
Game Engine/Game Project
🔍 Headbob이란?사람이 움직일 때 시야가 흔들리듯이 이동시에 카메라가 흔들리는 효과 Player에 하위의 카메라를 담은 빈오브젝트 카메라 루트에다 스크립트를 붙여주었습니다.using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.Rendering;public class HeadBob : MonoBehaviour{ // Start is called before the first frame update [Range(0.001f, 0.01f)] public float Amount = 0.002f; [Range(1f, 30f)] public float Frequency..
[Unity] Input Action을 활용한 Fps Cam 적용하기
·
Game Engine/Unity
1. Input Actions에서 Actions 등록2. 스크립트 적용먼저 Player 오브젝트에 Player, FpsCamera, PlayerController가 있어야 동작을 할 수 있다. 적용할 Fps 카메라 스크립트using System.Collections;using System.Collections.Generic;using Unity.VisualScripting;using UnityEngine;using UnityEngine.InputSystem;public class FpsCamera : MonoBehaviour{ [SerializeField] private float rotCamXAxisSpeed = 1; // 수평 감도 [SerializeField] float rotCamYAx..
[Unity] Project Running 포션 틀
·
Game Engine/Game Project
유니티 팀프로젝트인 Project Running에서 내가 맡은 것은 카메라제어 였다.팀회의때 카메라 제어라고 써져있길래 구현하는 줄 알았는데구현하려고 하다가 가만 생각해보니  Player 하위에 넣어주면 알아서 따라갈 것 같은데. 제어를 하는 코드가 따로 필요있을까? 하다가 팀원들과 다시 회의 후 추가 기능으로 포션을 맡기로 했다.포션은 총 2가지로 체력포션, 스피드 포션이 있다. 일단 내가 생각한 방식은 이렇다일단 기본 베이스 클래스인 Potion 클래스를 만들고 IEffect 인터페이스를  상속받는다using System.Collections;using System.Collections.Generic;using UnityEngine;interface IEffect{ public void Use..
[Unity] 2D 무한 맵 생성
·
Game Engine/Unity
using System.Collections;using System.Collections.Generic;using Unity.Collections.LowLevel.Unsafe;using UnityEditor.SceneManagement;using UnityEngine;public class Level : MonoBehaviour{ public int numBgCount = 2; // 배경화면 오브젝트만큼 생성 public int obstacleCount = 0; public Vector3 ObstacleLastPosition = Vector3.zero; public float bgSpeed = 1f; public float bgTime =0f; BoxCollider2D c..
[C#] TextRPG 상점 구현
·
Language/C#
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace TeamProejct_Dungeon{ public class Shop { //List> ShopList; //------갑옷류-------- //1. 2. 3.for(int i ~~~~) //아머리스트[(int)ItemType.Armour][i] //------무기류-------- //무기템리스트 //----소모품--- //7.8.9.소모품 //----서비스류----- ..