top of page

Study] Photon Cloud(Unity)-19

  • 작성자 사진: 김영호
    김영호
  • 2023년 2월 9일
  • 1분 분량

최종 수정일: 2023년 4월 28일

  • Photon을 사용해서 채팅 기능 구현하기 - 1


public class Chat : MonoBehaviour, IChatClientListener
{
    //UI
    public InputField inputField;
    public Text outputText;

    //On Click Event Send Button
    public void OnClickSend()
    {
        //입력된 Text 가져오기
        string text = inputField.text;

        //입력내용 전송하기
        chatClient.PublishMessage(channelName, text);

        //이전 입력 내용 삭제
        inputField.text = "";
    }
}


  • Photon Cloud에 Chat 추가하기

Photon Cloud에서 지원하는 채팅 서버를 이용하기 위해 Photon 사이트에서 작업을 진행하겠다.

1. Photon 로그인 후 Dashboard에서 Create a New App을 클릭

ree

2. Photon SDK를 Chat으로 설정

ree

3. 이름 & 설명 등 기타 입력 사항 입력 후 Create 버튼 클릭

ree

4. 생성된 Chat

ree

5. App ID 복사

ree

6. 전에 Import한 파일 중 Photon Server Setting에 복사했던 ID 배정

ree


  • Interface IChatClientListener

ree
ree

Interface IChatClientListener 설명 사이트

https://doc-api.photonengine.com/en/pun/v2/interface_photon_1_1_chat_1_1_i_chat_client_listener.html

기능 구현은 다음 게시글에서 진행하겠다.

  • Facebook
  • Twitter
  • LinkedIn

©2021 by 김영호_포트폴리오. Proudly created with Wix.com

bottom of page