[JahroCommand("RestartGame")]
public static void RestartGame()
{
// Your game restarting logic here
}
[JahroCommand("revive-player", "Revives the player with full health", "player-commands")]
public static void RevivePlayer()
{
// Your player reviving logic here
}
[JahroCommand("PauseGame", "Pauses the game", "game-commands")]
public static void PauseGame()
{
// Your game pausing logic here
}
[JahroCommand("player-move", "Move player in direction by distance", "player-commands")]
public static void MovePlayer(Vector3 direction, float distance)
{
// Your player moving logic here
}
public class SceneController
{
public string GetCurrentScene()
{
return "Current scene is " + SceneManager.GetActiveScene().name;
}
}
var sceneController = new SceneController();
Jahro.RegisterCommand("current-scene", sceneController, "GetCurrentScene");
var myObject = new MyObject();
Jahro.RegisterCommand<float>("set-speed", "Sets the speed of the game object",
(speed) =>
{
myObject.SetSpeed(speed);
});
public class PlayerController
{
public void SetPlayerSpeed(Vector2 speed)
{
Debug.Log("Set speed " + speed);
}
}
var playerController = new PlayerController();
Jahro.RegisterCommand<Vector2>("land-player-speed", playerController, SetLandPlayerSpeed);
Jahro.UnregisterCommand("my-command");
Jahro.UnregisterCommand("my-command", "MyGroup");