码迷,mamicode.com
首页 > 其他好文 > 详细

《Photon》

时间:2016-11-22 12:16:42      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:关闭   except   成功   disco   response   evel   exception   prot   level   

using UnityEngine;
using System.Collections;
using ExitGames.Client.Photon;

public class GameClinet : MonoBehaviour,IPhotonPeerListener {
PhotonPeer peer;
// Use this for initialization
void Start ()
{
peer = new PhotonPeer(this, ConnectionProtocol.Udp);
peer.Connect("127.0.0.1:5055", "Lite");
}

// Update is called once per frame
void Update () {
peer.Service();
}

public void DebugReturn(DebugLevel level, string message)
{
throw new System.NotImplementedException();
}

public void OnEvent(EventData eventData)
{
throw new System.NotImplementedException();
}

public void OnOperationResponse(OperationResponse operationResponse)
{
throw new System.NotImplementedException();
}

public void OnStatusChanged(StatusCode statusCode)
{
switch(statusCode)
{
case StatusCode.Connect:
Debug.Log("连接成功");
break;
case StatusCode.Disconnect:
Debug.Log("关闭连接");
break;
case StatusCode.ExceptionOnConnect:
Debug.Log("连接异常");
break;

}
}
}

《Photon》

标签:关闭   except   成功   disco   response   evel   exception   prot   level   

原文地址:http://www.cnblogs.com/ylllove/p/6088376.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!