void TaskOnClick() { switch (type.value) { case 0: { //Pilot CSPilot m = new CSPilot(direction.text, other.text); net.SendSocketMessage(m); break; } case 1: { //Nav CSNav m = new CSNav(int.Parse(loc.text), other.text); net.SendSocketMessage(m); break; } default: break; } }
public void HandleMessage(CSPilot m) { }
void handlePilot(string message) { CSPilot m = JsonUtility.FromJson <CSPilot>(message); messageDisplay.text = "Type: " + m.type + ", Direction: " + m.direction + ", Other: " + m.other; }