public void EndPuzzle(string puzzleName) { if (puzzleName.Equals("Puzzle1")) { Puzzle1 p = gameObject.GetComponent <Puzzle1>(); if (p.IsActive()) { p.End(); } } if (puzzleName.Equals("Puzzle2")) { Puzzle2 p = gameObject.GetComponent <Puzzle2>(); if (p.IsActive()) { p.End(); } } if (puzzleName.Equals("Puzzle3")) { Puzzle3 p = gameObject.GetComponent <Puzzle3>(); if (p.IsActive()) { p.End(); } } }
public void StartPuzzle(string puzzleName) { if (puzzleName.Equals("Puzzle1")) { Puzzle1 p = gameObject.GetComponent <Puzzle1>(); if (!p.IsActive()) { p.Begin(); } } else if (puzzleName.Equals("Puzzle2")) { Puzzle2 p = gameObject.GetComponent <Puzzle2>(); if (!p.IsActive()) { p.Begin(); } } else if (puzzleName.Equals("Puzzle3")) { Puzzle3 p = gameObject.GetComponent <Puzzle3>(); if (!p.IsActive()) { p.Begin(); } } }