public void Flush() { if (Time.time < _nextFlush) { _homeMessageManager.ShowMessage("刷新太频繁啦!!!", 3); return; } _nextFlush = Time.time + flushTime; ClearFriend(); _webConnector.GetFriends(this); _webConnector.GetScore(() => { SetMine(_webConnector.Account); }); }
private void Start() { _friends = new List <Friend>(); _nextFlush = Time.time + flushTime; #if UNITY_EDITOR try { #endif _webConnector = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <WebConnector>(); _homeMessageManager = GetComponent <HomeMessageManager>(); _webConnector.GetFriends(this); _webConnector.GetScore(() => { SetMine(_webConnector.Account); }); _pos = -130; #if UNITY_EDITOR } catch (Exception) { // ignored } #endif }