using UnityEngine; 
 | 
using System.Collections; 
 | 
using System; 
 | 
  
 | 
public class NetUpdateBehaviour : MonoBehaviour 
 | 
{ 
 | 
    Action onUpdate; 
 | 
    public void RegisterUpdateCallBack(Action _onUpdate) 
 | 
    { 
 | 
        onUpdate += _onUpdate; 
 | 
    } 
 | 
  
 | 
    void Update() 
 | 
    { 
 | 
#if UNITY_EDITOR 
 | 
  
 | 
        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Escape)) 
 | 
        { 
 | 
            GameNetSystem.Instance.LoginOut(); 
 | 
        } 
 | 
#endif 
 | 
  
 | 
        if (onUpdate!=null) 
 | 
        { 
 | 
            onUpdate(); 
 | 
        } 
 | 
    } 
 | 
  
 | 
    private void OnApplicationQuit() 
 | 
    { 
 | 
        GameNetSystem.Instance.Disconnect(); 
 | 
    } 
 | 
  
 | 
} 
 |