전체 글 292

[Giant vs Human/Unity] 개발일지 - [PC기능]

1. WASD 이동하기 Move Movement 메서드를 이용했고, PunRPC로 Photon 서버에서 메서드를 사용해주었다. 2. Turn Turn W키나 S키를 사용하면 카메라의 앞으로 바라본다. 3. Jump Jump RigidBody의 AddForce를 사용해 Impulse 포스타입으로 위로 점프해줬다. Jump메서드를 불러주는 RPC기능 isGround로 체크를 해주면서 땅같은 곳에 태그로 Ground를 넣어주고 Ground체크를 해주면서 무한으로 점프하는 걸 막아줬다. 3-1. Double Jump bool 값으로 isGround가 false이고 item이 1개 이상이고 isSuperJumped가 false이고 Space를 눌렀을 때 일치하면 RPC로 Jump메서드와 itemCountSet메서..

[Giant vs Human/Unity] 개발일지 - 망치휘두르기 [PC기능]

Player에 Hammer상태를 SetActive == False 상태로 만들어놓음. 그냥 부딪혔을 때 로그찍어주고 해머어택 메서드 호출 SetActive 상태를 True로 만들어줌 코루틴 해머어택으로 휘두르는듯한 느낌을 줌 ...> 애니메이션으로 변경 예정 Unity Rotation이 -180 ~ 180도까지만 인식이 되서 해머가 어느정도 회전값을 넘어가면 다시 0도로 초기화가 되는 현상이 있다.

[Photon] networkrig, networkhand, networkhead, hardwarerig, hardwarehead, hardwarehand

VR Shared https://doc.photonengine.com/ko-kr/fusion/current/technical-samples/fusion-vr-shared VR Shared | Photon Engine Fusion VR Shared 는 VR 기능이 있는 멀티플레이어 게임 또는 애플리케이션의 쉽고 빠른 시작법에 대해 설명합니다. 공유 토폴로지 또는 호스트/서버 토폴로지 중 어떤 것을 선택할지는 게임 사양에 doc.photonengine.com Oculus VR 세팅 using System.Collections; using System.Collections.Generic; using UnityEngine; public class HardwareRig : MonoBehaviour { public..

Photon 2023.12.07

[Giant vs Human 팀프로젝트/ Photon] 지연 보상

https://doc.photonengine.com/ko-kr/pun/current/gameplay/lagcompensation 지연 보상 | Photon Engine 게임에 물리 객체가있을 때, 특히 두 개 이상의 게임 윈도우가 서로 나란히 있을 때 이러한 객체가 동기화되지 않을 수 있습니다. 이로 인해 게임에 심각한 문제가 발생할 수 있으며 결국 플레이 doc.photonengine.com 네트워크 연결 시 Player와 Master의 네트워크 연결 동기화상태가 일치하지않고 살짝씩 느려서 해결해보고있다. https://devsquare.tistory.com/4 [Tip] 깔끔한 지연 보상의 처리 Photon Pun2 의 튜토리얼 가이드에서 지연보상을 코드로 직접 구현을 하는데 번거로울 뿐더러 깔끔하지..

[Giant vs Human 팀프로젝트] Photon 멀티 동기화

using Photon.Pun; using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameMain : MonoBehaviour { [SerializeField] private List prefabs; private int cnt = 0; // Start is called before the first frame update void Start() { var pool = PhotonNetwork.PrefabPool as DefaultPool; foreach (GameObject prefab in this.prefabs) { pool.ResourceCache.Add(prefab.name, pre..

[Giant vs Human 팀프로젝트, Mobile] 죽은 후 일정 시간 후 리스폰

cube로 죽은 후에 리스폰하는 걸 만들어봤다. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestRespawn : MonoBehaviour { [SerializeField] private Button btnSuicide; [SerializeField] private GameObject playerGo; [SerializeField] private Slider slider; private bool onRespawn = false; // Start is called before the first frame update void Start() { t..

[Giant vs Human 팀프로젝트, Mobile] 대포가 주변에 있으면 대포발사 버튼이 활성화되고 버튼을 누르면 포탄이 발사

대포 근처에 도달하게되면 공격버튼이 활성화된다. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestTowerAround : MonoBehaviour { [SerializeField] private Transform towerTr; [SerializeField] private Button btnTowerAttack; [SerializeField] private Transform bulletTr; [SerializeField] private GameObject bulletGo; private void Start() { this.btnTowerAtta..

[Giant vs Human 팀프로젝트, Mobile] 조이스틱을 통한 이동, 버튼을 누르면 공격

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestJoystickMove : MonoBehaviour { [SerializeField] private VariableJoystick joystick; [SerializeField] private Rigidbody rBody; [SerializeField] private float speed = 3f; [SerializeField] private Button btnAttack; [SerializeField] private GameObject bulletGo; [SerializeField] privat..

[Giant vs Human 팀프로젝트, Meta Quest, VR, Oculus] UI 작업 - 게임시작 시 Start버튼 따라다니기, 남은 거리 보여주기 및 남은 시간 보여주기

그래서 머리가 움직여도 계속 얼굴 앞을 따라다니게 만들어준다. using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class TestCountDownDistance : MonoBehaviour { [SerializeField] private Transform giantTr; //거인 위치 [SerializeField] private Transform endTr; // 목적지 [SerializeField] private TMP_Text countDownTxt; //남은시간 [SerializeField] private TMP_Text distanceTxt; //남은거리 [Seriali..