コード例 #1
0
 public ShieldDisablingSystem(Contexts contexts, HealthAndShieldPointsDisplayingSystem shieldPointsDisplayingSystem) : base(contexts.game)
 {
     gameContext      = contexts.game;
     displayingSystem = shieldPointsDisplayingSystem;
 }
コード例 #2
0
        private Systems CreateSystems(UdpSendUtils udpSendUtils)
        {
            float prevFrameTime = Time.time - Time.deltaTime;
            int   aliveCount    = MyMatchDataStorage.Instance.GetMatchModel().PlayerModels.Length;

            var hpDisplayingSystem = new HealthAndShieldPointsDisplayingSystem(battleUiController.GetHealthSlider(),
                                                                               battleUiController.GetHealthText(), battleUiController.GetShieldSlider(),
                                                                               battleUiController.GetShieldText(),
                                                                               battleUiController.GetVignette());

            // udpControllerSingleton.GetUdpSendUtils();

            contexts = Contexts.sharedInstance;
            systems  = new Systems()
                       .Add(new TimeSpeedSystem(contexts, new FloatLinearInterpolator(prevFrameTime)))

                       .Add(new UpdateTransformSystem(contexts))
                       .Add(new DelayedSpawnSystem(contexts))
                       .Add(new ManyDelayedRecreationsSystem(contexts))
                       .Add(new DelayedRecreationSystem(contexts))
                       .Add(new UpdateRadiusSystem(contexts, new FloatLinearInterpolator(prevFrameTime)))
                       .Add(new UpdateParentsSystem(contexts))
                       .Add(new DetachParentsSystem(contexts))
                       .Add(new UpdateHidingSystem(contexts))
                       .Add(new CurrentShieldSystem(contexts))

                       .Add(new GlobalTransformSystem(contexts))
                       .Add(new UpdatePlayersSystem(contexts))

                       .Add(new AddViewSystem(contexts, battleUiController.GetGameViews()))
                       .Add(new RenderSpriteSystem(contexts))
                       .Add(new RenderCircleSystem(contexts))
                       .Add(new RenderLineSystem(contexts))
                       .Add(new AddInfoDistanceSystem(contexts))
                       .Add(new AddTextSystem(contexts, battleUiController.GetNicknameFontMaterial()))
                       .Add(new SetAnimatorSystem(contexts))
                       .Add(new GameObjectParentsCheckerSystem(contexts))
                       .Add(new GameObjectDetachParentsSystem(contexts, battleUiController.GetGameViews()))
                       .Add(new RenderLocalTransformSystem(contexts))
                       .Add(new AddSpeedSystem(contexts))
                       .Add(new RenderSmoothedTransformSystem(contexts))

                       .Add(new RotateTextSystem(contexts))
                       .Add(new MoveTextSystem(contexts))

                       .Add(new MaxHealthPointsUpdaterSystem(contexts, hpDisplayingSystem))
                       .Add(new HealthPointsUpdaterSystem(contexts, hpDisplayingSystem))
                       .Add(new ShieldDisplayingSystem(contexts, hpDisplayingSystem))
                       .Add(hpDisplayingSystem)
                       .Add(new UpdateHealthInfoSystem(contexts, battleUiController.GetEnemyHealthBar()))
                       .Add(new RotateHealthBarSystem(contexts))
                       .Add(new MoveHealthBarSystem(contexts))
                       .Add(new HealthBarFadingSystem(contexts))

                       .Add(new UpdateTeamsSystem(contexts))
                       .Add(new UpdateOutlineMaterialsSystem(contexts, aliveCount + 1))
                       .Add(new UpdateDirectionsToPlayersSystem(contexts, battleUiController.GetMainCamera(), battleUiController.GetOverlayCanvas(), battleUiController.GetArrowSprite(), aliveCount))

                       .Add(new UpdateParticlesSystem(contexts))

                       .Add(new UpdateDestroysSystem(contexts))
                       .Add(new DelayedDestroySystem(contexts))

                       .Add(new GameObjectHidingSystem(contexts))

                       .Add(new ShieldDisablingSystem(contexts, hpDisplayingSystem))

                       .Add(new SpawnSoundSystem(contexts))
                       //LoopSoundSystem?
                       .Add(new DeathSoundSystem(contexts))

                       .Add(new DeathAnimationSystem(contexts))
                       .Add(new DestroyTimerSubtractionSystem(contexts))
                       .Add(new DestroySystem(contexts))

                       .Add(new CameraAndBackgroundMoveSystem(contexts, battleUiController.GetMainCamera(),
                                                              battleUiController.GetBackgrounds(), battleUiController.GetLoadingImage()))
                       .Add(new MaterialsMoveSystem(contexts, battleUiController.GetMaterials()))
                       .Add(new ZoneMoveSystem(contexts, battleUiController.GetZone()))
                       .Add(new UpdateDirectionToCenterSystem(contexts, battleUiController.GetArrowToCenter()))

                       .Add(new JoysticksInputSystem(contexts, battleUiController.GetMovementJoystick(),
                                                     battleUiController.GetAttackJoystick()))
                       .Add(new PlayerInputSenderSystem(contexts, udpSendUtils))
                       .Add(new AbilityInputClearingSystem(contexts))
                       .Add(new RudpMessagesSenderSystem(udpSendUtils))

                       .Add(new KillsIndicatorSystem(battleUiController.GetKillMessage(),
                                                     battleUiController.GetKillIndicator(), battleUiController.GetKillsText(),
                                                     battleUiController.GetAliveText(), aliveCount, battleUiController.GetMenuGridControllers()))
                       .Add(new CooldownsUpdaterSystem(battleUiController.GetCannonCooldownsController(),
                                                       new FloatLinearInterpolator(prevFrameTime)))
                       .Add(new AbilityUpdaterSystem(battleUiController.GetAbilityCooldownInfo(),
                                                     new FloatLinearInterpolator(prevFrameTime)))

                       .Add(new GameContextClearSystem(contexts))
            ;
            return(systems);
        }