internal static void Move(Place.ExitDirections direction) { if (CruiseControl.waitingForConfirmation) { return; } else { switch (direction) { case Place.ExitDirections.North: WoTUnityClient.Send("n\nexits"); break; case Place.ExitDirections.East: WoTUnityClient.Send("e\nexits"); break; case Place.ExitDirections.South: WoTUnityClient.Send("s\nexits"); break; case Place.ExitDirections.West: WoTUnityClient.Send("w\nexits"); break; } Player.me.attemptedMoveDirection = direction; CruiseControl.ConfirmationPending(); Coroutiner.StartCoroutine(TimeoutMove()); } }
/// <summary> /// Listens for the enter key when and sends the input from the interface /// to the WOTMud servers. /// </summary> void OnGUI() { //Send messages on enter. if (Event.current.keyCode == KeyCode.Return && input != "") { //Make sure we look to identify the place properly. if (input == "n" || input == "e" || input == "s" || input == "w") { input += "\nexits"; } WoTUnityClient.Send(input + "\n"); input = ""; scrollPosition = new Vector2(0, int.MaxValue); } GUILayout.Window(0, new Rect( 0.0f * Screen.width, 0.6f * Screen.height, 1.0f * Screen.width, 0.4f * Screen.height ), DrawConsoleHistory, GUIContent.none ); }
internal static void ReOrient() { //Attempt to get the place again UnityEngine.Debug.LogWarning("Re-Orienting!"); WoTUnityClient.Send("look\nexits"); //Free up the player to move again, in case it fails. CruiseControl.ConfirmMove(); }