static void Main(string[] args) { string mode; Controller controller = null; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (args.Length == 1) { mode = args[0]; } else { var modeForm = new ModeForm(); if (modeForm.ShowDialog() == DialogResult.OK) { mode = modeForm.Mode; } else { return; } } switch (mode) { case "play": controller = new BotController(); break; case "colossus": controller = new ColossusController(); break; case "explore": controller = new ExploreController(); break; default: MessageBox.Show($@"Unknown mode ""{args[0]}""."); break; } if (controller != null) { var form = new MainForm(); form.Controller = controller; Application.AddMessageFilter(form); Application.Run(form); } }
// Use this for initialization void Start() { myParent = transform.parent.parent.parent.gameObject; myController = (ColossusController)myParent.GetComponent<ColossusController>(); }