/// <summary> /// Initialize the controllers and register them to a localizer. /// Disable the controller if its source is not required by the current localizer method. /// </summary> /// <param name="localizer">The Localizer filter</param> private void InitControllers(AbstractLocalizerCoupler localizer) { AbstractSensorController[] controllers = gameObject.GetComponents <AbstractSensorController>(); for (int i = 0; i < controllers.Length; i++) { controllers[i].Init(); controllers[i].enabled = localizer.RegisterSource(controllers[i]); } }
/// <summary> /// Called when the game starts. /// </summary> public void Start() { Meta.MetaCameraMode.monocular = true; Meta.MarkerDetector.Instance.SetMarkerSize(this.markerSize); this.AddControllers(); FieldSize fieldSize = new FieldSize() { Xmax = 5, Xmin = 0, Ymax = 2, Ymin = 0, Zmax = 4, Zmin = 0 }; AbstractLocalizerCoupler coupler = LocalizerFactory.Get(this.usedFilter, fieldSize); this.InitControllers(coupler); this.InitMarker(); this.InitWorldBox(coupler.GetLocalizer(), fieldSize); Meta.MetaUI.Instance.enableGrid = false; }