示例#1
0
    public void Init()
    {
        _map        = Resources.Load <GameObject>("Model/Envioronment/BossMap");
        _nodePrefab = Resources.Load <Node>("Model/Envioronment/TileNode");
        //_player = FindObjectOfType<Player>();
        //_player.Init();
        _boss             = FindObjectOfType <BossTest>();
        _cameraController = FindObjectOfType <CameraController>();
        _cameraController.Init();

        _nodeParent = Helper.Find <Transform>(transform, "NodeParent");
        _animator   = GetComponent <Animator>();

        CreateNode();
    }
示例#2
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (_content == null)
            {
                _content = new ContentManager(ScreenManager.Game.Services, "Content");
            }

            _gameFont = _content.Load <SpriteFont>("Downlink");

            //Load Ship
            _mShipTexture = _content.Load <Texture2D>("ship-1");

            //Default Ship State Texture
            _shipBodySourceRectangle = new Rectangle(96, 0, 48, 56);

            _mPlayerShipSprite = new PlayerShip();
            _mProjectileSprite = new Projectile();

            _mPlayerShipSprite.Scale  = 1.0f;
            _mPlayerShipSprite.Source = _shipBodySourceRectangle;

            _mBossTestSprite = new BossTest();

            _mProjectileSprite.LoadContent(_content);
            _mPlayerShipSprite.LoadContent(_content);
            _mBossTestSprite.LoadContent(_content);

            //Game Music
            _gameMusic        = _content.Load <SoundEffect>("Rock Garden");
            GameMusicInstance = _gameMusic.CreateInstance();

            // A real game would probably have more content than this sample, so
            // it would take longer to load. We simulate that by delaying for a
            // while, giving you a chance to admire the beautiful loading screen.
            Thread.Sleep(1000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }