3132 对游戏中一些可能出现的空引用异常进行保护
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using System;
|
| | | using System.Net;
|
| | | using System.Text; |
| | | using System.IO; |
| | | |
| | | using System.Text;
|
| | | using System.IO;
|
| | |
|
| | | public class HttpBehaviour : MonoBehaviour
|
| | | {
|
| | |
|
| | |
| | |
|
| | | if (getResult)
|
| | | {
|
| | | if (callBack != null)
|
| | | try
|
| | | {
|
| | | callBack(ok, message);
|
| | | callBack = null;
|
| | | DebugEx.LogFormat("Http 数据通信 {0},请求数据结果:{1},内容:{2}", this.url, ok, message);
|
| | |
|
| | | if (callBack != null)
|
| | | {
|
| | | callBack(ok, message);
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | callBack = null;
|
| | | Destroy(this.gameObject);
|
| | | }
|
| | |
|
| | | Destroy(this.gameObject);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | } |
| | |
|
| | | }
|