Example #1
0
        public void RegisterFlipper(Flipper flipper, Entity entity, GameObject go)
        {
            var flipperApi = new FlipperApi(flipper, entity, this);

            _tableApi.Flippers[flipper.Name] = flipperApi;
            _initializables.Add(flipperApi);
            _hittables[entity]   = flipperApi;
            _rotatables[entity]  = flipperApi;
            _collidables[entity] = flipperApi;

            if (EngineProvider <IDebugUI> .Exists)
            {
                EngineProvider <IDebugUI> .Get().OnRegisterFlipper(entity, flipper.Name);
            }
        }
        public void OnInit(TableApi tableApi, BallManager ballManager)
        {
            _tableApi    = tableApi;
            _ballManager = ballManager;

            // flippers
            _leftFlipper = _tableApi.Flipper("LeftFlipper")
                           ?? _tableApi.Flipper("FlipperLeft")
                           ?? _tableApi.Flipper("FlipperL")
                           ?? _tableApi.Flipper("LFlipper");
            _rightFlipper = _tableApi.Flipper("RightFlipper")
                            ?? _tableApi.Flipper("FlipperRight")
                            ?? _tableApi.Flipper("FlipperR")
                            ?? _tableApi.Flipper("RFlipper");

            // debug print stuff
            OnCoilChanged += DebugPrintCoil;
        }