2023/11 30

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

[Giant vs Human 팀프로젝트, Meta Quest, VR, Oculus] Haptic

Haptic 기능에서 이제 추가로 원하는 작업이 무엇이든 닿으면 진동이 울리게하는게 목표였다. Pointaable Unity Event Wrapper로 Select 되었을 때 진동기능을 해주었다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestHaptic : MonoBehaviour { public void OnSelect() { this.vibratorSensor(); } private void OnTriggerEnter(Collider other) { this.vibratorSensor(); } private void vibratorSensor() { float primaryI..

[Photon] Photon Transform View, Photon Animator View

새로운 씬에 Player를 만들고 Resources 폴더에 프리팹으로 지정해준다. Photon View와 Photn Transform View를 component에 추가해준다. 그냥 다시 SampleScene으로 돌아와서 작업 PhotonManager의 OnJoinedRoom에서 PhotonNetwork.Instantiate 해준다. 그리고 Build한 창과 유니티 상의 Play로 했을 때 2마리가 나오는지 확인해본다. IsMine이 True인게 내가 사용할 수 있는 Player이다. False면 내꺼가 아님 IsMine이 True가 아닌 애의 Position이나 Rotation을 움직여도 동기화가 안되는걸 볼 수 있다. IsMine에 따라 Build한 화면에서는 동기화가 되고 안되는걸 확인할 수 있다...

Photon 2023.11.27

[Photon] Player Settings, 포스트 프로세싱, 포톤 프로젝트 설정

https://github.com/IndieGameMaker/UnityBook GitHub - IndieGameMaker/UnityBook: 절대강좌! 유니티 2021 - 리소스 절대강좌! 유니티 2021 - 리소스. Contribute to IndieGameMaker/UnityBook development by creating an account on GitHub. github.com 이거 다운로드 오래걸림 1시간 https://assetstore.unity.com/packages/tools/network/pun-2-free-119922 PUN 2 - FREE | 네트워크 | Unity Asset Store Get the PUN 2 - FREE package from Photon Engine and s..

Photon 2023.11.24

[Photon] 포톤 클라우드 어플리케이션 생성

https://dashboard.photonengine.com/ko-kr 로그인 | Photon Engine Sign In 아직 계정이 없으신가요? 회원 등록은 여기를 클릭 id.photonengine.com 어플리케이션ID 복사 https://github.com/UnityTechnologies/AngryBots2 GitHub - UnityTechnologies/AngryBots2 Contribute to UnityTechnologies/AngryBots2 development by creating an account on GitHub. github.com 다운로드 3D (URP) 다운로드 소스트리 github 사용

Photon 2023.11.24