예제 #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            var animations = spriteLoader.GetAnimationDictionary(Content);

            stageManager.AddStage(new Stage(objectInitialiser.LoadStage(animations, 1, gameWidth, gameHeight), new Background(Content.Load <Texture2D>("Environment/Desert"), new Rectangle(0, 0, 1279, 639))));
            stageManager.AddPlayer(objectInitialiser.LoadPlayer(animations));
            stageManager.GetPlayer().Position = new Vector2(69, 887);

            hero       = (PlayerGameObject)stageManager.GetPlayer();
            spriteFont = Content.Load <SpriteFont>("Misc/basicFont");
            // TODO: use this.Content to load your game content here
        }
예제 #2
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();
        StageManager stageManager = (StageManager)target;

        DrawDefaultInspector();
        if (GUILayout.Button("Add Stage"))
        {
            stageManager.AddStage(PrefabUtility.ConnectGameObjectToPrefab(Instantiate <GameObject>(stageManager.stagePrefab), stageManager.stagePrefab));
        }
        if (EditorGUI.EndChangeCheck())
        {
            EditorUtility.SetDirty(stageManager);
        }
    }