void Start() { evolution = FindObjectOfType <Evolution>(); viewController = FindObjectOfType <SimulationViewController>(); InputRegistry.shared.Register(InputType.AndroidBack, this); var androidRecognizer = GestureRecognizerCollection.shared.GetAndroidBackButtonGestureRecognizer(); androidRecognizer.OnGesture += delegate(AndroidBackButtonGestureRecognizer recognizer) { if (InputRegistry.shared.MayHandle(InputType.AndroidBack, this)) { viewController.GoBackToEditor(); } }; InputRegistry.shared.Register(InputType.Key, this); }
void Start() { Physics.autoSimulation = false; evolution = FindObjectOfType <Evolution>(); AutoplayDuration = 10; AutoplayEnabled = true; evolution.InitializationDidEnd += delegate() { AutoplayDuration = evolution.Settings.SimulationTime; }; evolution.NewGenerationDidBegin += delegate() { if (CurrentBest == null && GenerationHasBeenSimulated(1)) { ShowBestCreature(evolution.SimulationData.BestCreatures.Count); } }; }