/// <summary> /// 填充 PhotonStatusChanged 事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>PhotonStatusChanged 事件。</returns> public PhotonStatusChangedEventArgs Fill(GameFramework.Photon.PhotonStatusChangedEventArgs e) { PhotonChannel = e.PhotonChannel; StatusCode = e.StatusCode; return(this); }
private void OnPhotonStatusChanged(object sender, GameFramework.Photon.PhotonStatusChangedEventArgs e) { // 这里为连接成功和断开连接做一个事件发送,为了处理在连接成功或者失败之后不用在外部判断当前的状态 switch (e.StatusCode) { case StatusCode.Connect: m_EventComponent.Fire(this, ReferencePool.Acquire <PhotonConnectedEventArgs>().Fill(e)); break; case StatusCode.Disconnect: m_EventComponent.Fire(this, ReferencePool.Acquire <PhotonDisconnectedEventArgs>().Fill(e)); break; } m_EventComponent.Fire(this, ReferencePool.Acquire <PhotonStatusChangedEventArgs>().Fill(e)); }
/// <summary> /// 填充 PhotonDisconnected 事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>PhotonDisconnected 事件。</returns> public PhotonDisconnectedEventArgs Fill(GameFramework.Photon.PhotonStatusChangedEventArgs e) { PhotonChannel = e.PhotonChannel; return(this); }