示例#1
0
        /// <summary>
        /// Static initializer for loading all sprites / textures.
        /// </summary>
        /// <param name="content">MonoGame ContentManager.</param>
        internal static void LoadSprites(ContentManager content)
        {
            if (Player == null)
            {
                Player = new PlayerSprites(content);
            }

            if (Floor == null)
            {
                Floor = new FloorSprites(content);
            }

            if (Wall == null)
            {
                Wall = new WallSprites(content);
            }

            if (Monster == null)
            {
                Monster = new MonsterSprites(content);
            }

            if (Fringe == null)
            {
                Fringe = new FringeSprites(content);
            }

            if (UI == null)
            {
                UI = new UISprites(content);
            }
        }
    public override void OnInspectorGUI()
    {
        if (monsterSprites == null)
        {
            monsterSprites = target as MonsterSprites;
        }

        monsterSprites.FrontMonsterSprites = EditorGUILayout.ObjectField("Front Sprite Sheet: ",
                                                                         monsterSprites.FrontMonsterSprites, typeof(Texture2D), true) as Texture2D;
        monsterSprites.BackMonsterSprites = EditorGUILayout.ObjectField("Back Sprite Sheet: ",
                                                                        monsterSprites.BackMonsterSprites, typeof(Texture2D), true) as Texture2D;

        DrawPopulateMonsterSprites();

        if (EditorApplication.isPlaying)
        {
            return;
        }

        if (GUI.changed)
        {
            EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
        }
    }
 private void OnEnable()
 {
     monsterSprites = target as MonsterSprites;
 }