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