コード例 #1
0
        /// <summary>
        /// Resolves the dependencies needed for this instance to work.
        /// </summary>
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            var playerEntity = this.EntityManager.Find("Player");

            if (playerEntity != null)
            {
                this.player = playerEntity.FindComponent<PlayerBehavior>();
                this.playerTransform = playerEntity.FindComponent<Transform2D>();
            }
        }
コード例 #2
0
        protected override void Initialize()
        {
            base.Initialize();

            this.logo = this.EntityManager.Find("Logo");
            this.tap_to_start = this.EntityManager.Find("TapToStart");
            this.game_over = this.EntityManager.Find("GameOver");
            this.bestScores = this.EntityManager.Find<TextBlock>("BestScores");

            this.player = this.EntityManager.Find("Player").FindComponent<PlayerBehavior>();
            this.enemyEmitter = this.EntityManager.Find("EnemyEmitter").FindComponent<EnemyEmitter>();
            this.leftJoystick = this.EntityManager.Find<Joystick>("leftJoystick");
            this.rightJoystick = this.EntityManager.Find<Joystick>("rightJoystick");
            this.hubPanel = this.EntityManager.Find<HubPanel>("HubPanel");

            this.CurrentState = States.Menu;
        }