public Transform GetDestination(string json) { int outputContextsIndex = json.IndexOf("outputContexts"); if (outputContextsIndex == -1) { return(null); } int parametersIndex = json.IndexOf("parameters", outputContextsIndex); int openBracketIndex = json.IndexOf("{", parametersIndex); int closedBracketIndex = json.IndexOf("}", openBracketIndex); json = json.Substring(openBracketIndex, closedBracketIndex - openBracketIndex + 1); DirectionsParameters orderParams = (DirectionsParameters)JsonUtility.FromJson <DirectionsParameters>(json); string place = orderParams.Place; destinationText = place; switch (place) { case "ホテル": sideOfStreet = 1; return(hotel); default: sideOfStreet = -1; return(restaurant); } }
public override Task <string> GetResponseAsync(string parameters) { DirectionsParameters param = parameters; if (string.IsNullOrWhiteSpace(param.Key) || string.IsNullOrWhiteSpace(param.Origin) || string.IsNullOrWhiteSpace(param.Destination)) { throw new HttpRequestException(); } return(base.GetResponseAsync(parameters)); }