public override void Complete(WWWResult www) { if (Network.IsError) { this.m_Node.OnFailed(); } else { DebugMenu.Log("API", this.url + ":" + www.text); WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListSend.Json> >(www.text); DebugUtility.Assert(jsonBodyResponse != null, "res == null"); if (jsonBodyResponse.body != null && jsonBodyResponse.body.result && FriendPresentRootWindow.instance != null) { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDING); } Network.RemoveAPI(); this.Success(); } }
public override void Complete(WWWResult www) { if (Network.IsError) { this.m_Node.OnFailed(); } else { DebugMenu.Log("API", this.url + ":" + www.text); WebAPI.JSON_BodyResponse <FlowNode_ReqPresentStatus.Api_PresentListStatus.Json> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_ReqPresentStatus.Api_PresentListStatus.Json>)JsonUtility.FromJson <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentStatus.Api_PresentListStatus.Json> >(www.text); DebugUtility.Assert(jsonBodyResponse != null, "res == null"); if (jsonBodyResponse.body != null) { if (string.IsNullOrEmpty(jsonBodyResponse.body.result)) { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.UNSENT); } else if (jsonBodyResponse.body.result == "0") { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDING); } else if (jsonBodyResponse.body.result == "1") { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENDED); } else if (jsonBodyResponse.body.result == "9") { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.SENTFAILED); } else { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.NONE); } } else { FriendPresentRootWindow.SetSendStatus(FriendPresentRootWindow.SendStatus.NONE); } Network.RemoveAPI(); this.Success(); } }