void Awake() { if (mInstance == null) { mInstance = this as FriendHelper; } }
protected override void Read(PacketStream stream) { stream.ReadUInt32(); var friendName = stream.ReadString(16).Trim(); FriendHelper.FriendRequest(Connection, friendName); }
protected override void Read(PacketStream stream) { var friendId = stream.ReadUInt32(); // stream.ReadUInt32(); FriendHelper.FriendRequestChat(Connection, friendId); }
public void addFriendButtonClicked(Button b) { AddFriendButtonScript afbs = b.GetComponent <AddFriendButtonScript> (); string opponentUserName = afbs.userName; FriendHelper.DoCoroutine(FriendHelper.AddFriend(opponentUserName)); b.gameObject.SetActive(false); }
protected override void Read(PacketStream stream) { var result = stream.ReadUInt16() == 1; var id = stream.ReadUInt16(); // var name = stream.ReadString(16); FriendHelper.FriendRequestResult(Connection, result, id); }
void OnApplicationQuit() { mInstance = null; }
void Die() { mInstance = null; Destroy(gameObject); }