Beispiel #1
0
        public void OnResponse(OperationResponse operationResponse, PhotonService service)
        {
            Character character = (Character)
                                  Serialization.Deserialize(operationResponse.Parameters[(byte)ParameterCode.CreateCharacter]);
            LoadCharacterEventArgs e = new LoadCharacterEventArgs(character);

            FindObjectOfType <LoadCharacter>().OnLoad(service, e);
        }
Beispiel #2
0
 public void OnEvent(EventData eventData, PhotonService service)
 {
     // 判断事件类型并调用对应的方法
     switch (eventData.Code)
     {
     // 玩家角色进入场景
     case (byte)EventCode.WorldEnter:
         OnEnter(eventData, service);
         break;
     }
 }
Beispiel #3
0
 public void OnResponse(OperationResponse operationResponse, PhotonService service)
 {
     // 判断事件类型并调用对应的方法
     switch (operationResponse.OperationCode)
     {
     // 玩家角色进入场景
     case (byte)OperationCode.WorldEnter:
         OnEnter(operationResponse, service);
         break;
     }
 }
Beispiel #4
0
    static Global()
    {
        LogService.InitialService(
            infoMethod: Debug.Log,
            infoFormatMethod: Debug.LogFormat,
            warningMethod: Debug.LogWarning,
            warningFormatMethod: Debug.LogWarningFormat,
            errorMethod: Debug.LogError,
            errorFormatMethod: Debug.LogErrorFormat);

        Device = new Device(new PhotonUnityCommunicationInterface(), null);
        Device.OnPlayerChanged += Device_OnPlayerChanged;

        PhotonService = new PhotonService();
    }
Beispiel #5
0
        public void OnResponse(OperationResponse operationResponse, PhotonService service)
        {
            LoginEventArgs e = new LoginEventArgs(operationResponse);

            PhotonService.Events.OnLogin(service, e);
        }
Beispiel #6
0
 static PhotonService()
 {
     Instance = new PhotonService();
 }
Beispiel #7
0
        /// <summary>
        /// 类型:方法
        /// 名称:OnEnter
        /// 作者:taixihuase
        /// 作用:当自身角色进入场景时,触发事件
        /// 编写日期:2015/7/22
        /// </summary>
        /// <param name="operationResponse"></param>
        /// <param name="service"></param>
        private void OnEnter(OperationResponse operationResponse, PhotonService service)
        {
            WorldEnterEventArgs e = new WorldEnterEventArgs(operationResponse);

            PhotonService.Events.OnWorldEnter(service, e);
        }
Beispiel #8
0
        /// <summary>
        /// 类型:方法
        /// 名称:OnEnter
        /// 作者:taixihuase
        /// 作用:当有玩家进入场景时,触发事件
        /// 编写日期:2015/7/22
        /// </summary>
        /// <param name="eventData"></param>
        /// <param name="service"></param>
        private void OnEnter(EventData eventData, PhotonService service)
        {
            WorldEnterEventArgs e = new WorldEnterEventArgs(eventData);

            PhotonService.Events.OnWorldEnter(service, e);
        }