2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-07-04 19:23:43 -04:00
Files
raylib-cs/Examples/Test.cs
2018-10-24 20:06:57 +02:00

30 lines
762 B
C#

using System;
using System.IO;
using static Raylib.Raylib;
namespace Examples
{
public class Test
{
// menu for testing examples
public static void Run(string[] args)
{
Console.WriteLine("Welcome to raylib-cs!");
while (true)
{
Console.WriteLine("Enter path to example");
var filePath = Console.ReadLine();
var name = Path.GetFileNameWithoutExtension(filePath);
Console.WriteLine("Running example " + filePath);
ChangeDirectory(Path.GetDirectoryName(filePath));
Type.GetType(name)?.GetMethod("Main")?.Invoke(null, args);
Console.WriteLine();
}
}
}
}