void Update() { if (PlayerController.Level1) { Chapter1.SetActive(true); } else { Chapter1.SetActive(false); } if (PlayerController.Level2) { Chapter2.SetActive(true); } else { Chapter2.SetActive(false); } if (PlayerController.Level3) { Chapter3.SetActive(true); } else { Chapter3.SetActive(false); } if (PlayerController.Level4) { Chapter4.SetActive(true); } else { Chapter4.SetActive(false); } if (PlayerController.Level5) { Chapter5.SetActive(true); } else { Chapter5.SetActive(false); } if (PlayerController.Level6) { Chapter6.SetActive(true); } else { Chapter6.SetActive(false); } }
static void Chap4() { Chapter4 chapter4 = new Chapter4(); }
public int?Max(int[] input) { var ch4 = new Chapter4(); return(ch4.Max(input)); }
public int Count(int[] input) { var ch4 = new Chapter4(); return(ch4.Count(input)); }
public int Sum(int[] input) { var ch4 = new Chapter4(); return(ch4.Sum(input)); }
private static void selectChapter() { //get the user input - an int value corresponding to the chapter number to jump to do { try { Console.WriteLine("0 - Exit application"); Console.WriteLine("2 - Chapter 2: Basic Program Structure"); Console.WriteLine("3 - Chapter 3: Working With The Type System"); Console.WriteLine("4 - Chapter 4: Using Types"); Console.WriteLine("5 - Chapter 5: Creating And Implementing Class Hierarchies"); selectedChapter = sbyte.Parse(Console.ReadLine()); } catch (FormatException ex) { Console.WriteLine(ex.Message); } } while (selectedChapter == -1); switch (selectedChapter) { case 0: Environment.Exit(0); break; case 2: Chapter2 chapter2 = new Chapter2(); chapter2.chapter2(); break; case 3: Chapter3 chapter3 = new Chapter3(); chapter3.chapter3TheTypeSystem(); break; case 4: Chapter4 chapter4 = new Chapter4(); chapter4.chapter4UsingTypes(); break; case 5: Chapter5_Class_Hierarchies.Chapter5 chapter5 = new Chapter5_Class_Hierarchies.Chapter5(); chapter5.chapter5ClassHierarchies(); break; default: Console.WriteLine("Unknown entry"); selectChapter(); break; } }