public Entity AddBounds(RMC.Common.UnityEngineReplacement.Bounds newBounds)
        {
            var component = CreateComponent <RMC.EntitasPong.Entitas.Components.GameState.BoundsComponent>(ComponentIds.Bounds);

            component.bounds = newBounds;
            return(AddComponent(ComponentIds.Bounds, component));
        }
Esempio n. 2
0
        // ------------------ Methods

        override protected void Awake()
        {
            base.Awake();
            Debug.Log("GameController.Awake()");


            GameController.OnDestroying += GameController_OnDestroying;
            TickController.Instantiate();
            AudioController.Instantiate();
            InputController.Instantiate();
            ViewController.Instantiate();
            ResourceController.Instantiate();

            Application.targetFrameRate = 30;
            _screenBounds = UnityEngineReplacementUtility.Convert(GameUtility.GetOrthographicBounds(Camera.main));


            SetupPools();
            SetupPoolObserver();

            //order matters
            //1 - Systems that depend on entities will internally listen for entity creation before reacting - nice!
            SetupSystems();

            //2
            SetupEntities();

            //place a ball in the middle of the screen w/ velocity
            _pool.CreateEntity().willStartNextRound = true;
        }
Esempio n. 3
0
 public static UnityEngine.Bounds Convert(RMC.Common.UnityEngineReplacement.Bounds rBounds)
 {
     return(new UnityEngine.Bounds(
                Convert(rBounds.center),
                Convert(rBounds.size)
                ));
 }
Esempio n. 4
0
        public Entity ReplaceBounds(RMC.Common.UnityEngineReplacement.Bounds newBounds)
        {
            var component = CreateComponent <RMC.EntitasCoverShooter.Entitas.Components.GameState.BoundsComponent>(ComponentIds.Bounds);

            component.bounds = newBounds;
            ReplaceComponent(ComponentIds.Bounds, component);
            return(this);
        }
        public Entity AddView(object newGameObject, RMC.Common.UnityEngineReplacement.Bounds newBounds)
        {
            var component = CreateComponent <RMC.Common.Entitas.Components.Render.ViewComponent>(ComponentIds.View);

            component.gameObject = newGameObject;
            component.bounds     = newBounds;
            return(AddComponent(ComponentIds.View, component));
        }