static void Main(string[] args) { var t = new Tutorial(); t.Step1_SimpleUsage(); t.Step2_Attributes(); t.Step3_Recycling(); t.Step4_KnownTypes(); t.Step5_CustomFormatters(); t.Step6_NetworkExample(); t.Step7_GameDatabase(); //t.Step8_DataUpgrade_OLD(); t.Step9_VersionTolerance(); t.Step10_ReadonlyHandling(); Console.WriteLine("End of tutorial program."); Console.ReadLine(); }
static void Main(string[] args) { List <Tutorial> _tutorials = new List <Tutorial>(); int index = 1; while (true) { Type type = Type.GetType("Tutorial.Tutorial" + index + ".Tutorial" + index); if (type != null) { _tutorials.Add((Tutorial)Activator.CreateInstance(type)); } else { break; } ++index; } Tutorial lastTutor = null; while (true) { Console.WriteLine(); Console.WriteLine("Tutorials"); Console.WriteLine(); for (int i = 0; i < _tutorials.Count; ++i) { Console.WriteLine((i + 1).ToString().PadLeft(2) + " " + _tutorials[i].Name); } Console.WriteLine(); Console.Write("Select a tutorial and press enter, or type 'quit': "); string choice = Console.ReadLine(); if (choice == "quit") { break; } if (!int.TryParse(choice, out index)) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Enter a NUMBER!"); Console.ForegroundColor = ConsoleColor.Gray; continue; } if (index < 0 || index > _tutorials.Count) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("How about a number between 1 and " + (_tutorials.Count) + "??"); Console.ForegroundColor = ConsoleColor.Gray; continue; } Console.WriteLine(); if (lastTutor != null) { lastTutor.EndTutorial(); } lastTutor = _tutorials[index - 1]; lastTutor.StartTutorial(); } }
private void Awake() { Instance = this; }