728x90

전체 글 158

[Unity] XR Toolkit Interaction

urp 3d로 프로젝트 만들기asset에 있는 package인지 뭔지 삭제package manager에서 XR interaction toolkit 설치얘도 받기 + oculus 체크package manager > XR Interaction Toolkit에서Starter Assets, XR Device Simulator sample import하기demo scene의 모습만약 지금 실행하고 싶으면 VR 연동해서 해야됨XR device simulator sample 받은거 프리팹 넣어주면 pc에서도 가능vr 연결해서 할거면 저 프리팹 active false 해줘야됨조작은 보면서 해보자,, 꽤나 다루기 어렵Sample Scene으로 돌아와서 XR Origin 만들어주자 Preset 설치: 컴포넌트, 인스펙터 ..

공부/Unity 2025.06.27

[Unity] Input System을 이용한 XR / VR / 모바일 등의 입력을 한번에 처리하는 방법

Unity 6 부터는 기본으로 Input System Package만 사용ball player 둘다 rigidbodyusing System.Collections;using System.Collections.Generic;using UnityEngine;public class PlayerController : MonoBehaviour{ Rigidbody rb; float moveSpeed = 5f; Vector3 dir = Vector3.zero; public GameObject ballPrefab; void Start() { rb = GetComponent(); } void Update() { float moveX = Input.G..

공부/Unity 2025.06.27

[Unity] 컴포넌트 안쓰고 위치, 애니메이션 연동 (Oculus + Photon)

pun2 free + oculus integration (deprecated) 둘다 받아서 기본 설정 하기xr setting, photon setting 넣고 main camera 삭제 10 10 plain 넣기 > GroundM_Ground 만들어서 넣어주기 (마음대로) (Fantasy Chess RPG Character - Arthur 이용) > 불러오기 (model에 material 넣어줌 프리팹 왜 안쓰는진 모르겠음)ㅎㅇ 아서 > scale 0.6으로 줄여줌빈 오브젝트 > Player 자식 배치카메라 3인칭 배치만들어져있는 arthur animator 구경 (걷는중 공격 불가) using System.Collections;using System.Collections.Generic;using Uni..

공부/Unity 2025.06.24

[Unity] Photon Network 포톤 네트워크 Lobby manager 예시

포톤 접속하는 Lobby Manager 예시- 방 이름 설정 및 그런거는 날리고 이름 입력해서 버튼 누르면 자동 접속 (인원은 4명 한정) * MonoBehaviourPunCallBacks를 받아서 사용해야한다콜백 함수들 이용할때에는 override해서 사용using Photon.Pun; // 유니티용 포톤 컴포넌트들using Photon.Realtime; // 포톤 서비스 관련 라이브러리using UnityEngine;using UnityEngine.UI;// 마스터(매치 메이킹) 서버와 룸 접속을 담당public class LobbyManager : MonoBehaviourPunCallbacks { private string gameVersion = "1"; // 게임 버전 public T..

공부/Unity 2025.06.24

[Unity] Oculus Integration / 컨트롤러 연결 및 조준선 표시

이렇게 컨트롤러대로 조준선 표시하고 voxel 만드는 내용연습용으로 아래 asset 사용https://assetstore.unity.com/packages/tools/integration/oculus-integration-deprecated-82022 Oculus Integration (Deprecated) | 기능 통합 | Unity Asset StoreUse the Oculus Integration (Deprecated) from Meta on your next project. Find this integration tool & more on the Unity Asset Store.assetstore.unity.com다운받고 project settings에서 눌러주기폴더설정#ARAVRInput.cs ..

공부/Unity 2025.06.19

[Unity] 포톤 네트워크 / 채팅 스크립트

https://www.photonengine.com/ko-kr 글로벌 크로스 플랫폼 실시간 게임 개발 | Photon EngineEssentialPhoton Details Discover a summary of our product range, notable features, the power of the Photon Cloud, and our cost-effective pricing plans. HAVE A LOOKwww.photonengine.com 들어가서 회원가입 및 로그인https://dashboard.photonengine.com/ko-kr 로그인 | Photon EngineSign In 아직 계정이 없으신가요? 회원 등록은 여기를 클릭id.photonengine.com대시보드에서 app 생성..

공부/Unity 2025.06.18

[C#] 이벤트 액션 델리게이트 event action delegate

1. 일반void Add(int x, int y){ int result = x + y; print($"x + y = {result}");}void Sub(int x, int y){ int result = x - y; print($"x - y = {result}");}void Mul(int x, int y){ int result = x * y; print($"x * y = {result}");}void Div(int x, int y){ int result = x / y; print($"x / y = {result}");}Add, Sub, Mul, Div 함수를 따로 만들어줬다이를 사용하기 위해서Add(10, 20);Sub(10, 20);Mul(10, 20);Div..

공부/C# 2025.06.16

[Unity] 유니티 Monobehaviour의 생명주기(Lifecycle) / Monobehaviour의 특징

Reset: 유니티 에디터에서 오브젝트 생성 후 인스펙터 뷰에서 리셋을 눌러줄 때 실행, 객체의 속성을 초기값으로 설정Awake: 프리팹이 인스턴스화 한 직후, 스크립트가 호출되자마자 실행. 모든 오브젝트가 초기화 된 후 호출되어 find를 안전하게 실행 가능. StartCoroutine 불가. *비활성화 되었어도 실행OnEnable: 라이프 사이클 내에서 여러번 호출 될 수 있으며 인스펙터뷰에서 체크 및 스크립트내에서 setactive 함수로 활성화 될 때마다 호출.Start: Update 함수 실행 전 한번만 호출. 다른 모든 스크립트의 Awake문이 끝나면 실행되며 비활성화 되어있으면 실행X. Awake문 다음에 실행되므로 동적 생성을 Awake에서, 해당 멤버 변수를 초기화하는 식은 Start문에..

공부/Unity 2025.06.12

[Unity] 유용한 링크 모음

https://d-dl.tistory.com/111 [Unity] 2D 게임에서 스크립트 없이 스프라이트 순서를 정렬하는 방법Z축만 설정해주면 알아서 스프라이트 순서가 정렬되는 3D 게임과는 달리 2D 게임에선 부가적으로 스프라이트 앞뒤 순서를 정렬해주어야 한다. 이 글에선 강의에선 잘 설명해주지 않는 유니티 기d-dl.tistory.comrigidbody.position vs transform.positionCinemachine 동적으로 카메라 흔들기https://aostols.tistory.com/40 Cinemachine - ImpulseCinemachine Virtual Camera 에서 화면을 흔드는 것중 하나인 Cinemachine Impulse는 Noise보다 좀 더 정확하고 방향성을 가진 ..

공부/Unity 2025.06.09
728x90
반응형