Exemplo n.º 1
0
        public static void BuildMusicPlayerExample()
        {
            if (_instance == null)
            {
                _instance = new MusicExampleBuilder();
            }

            _instance._sdk = SDK.Find(true);
            _instance._musicExampleMabuPath = Path.Combine(Application.dataPath, Path.Combine("MagicLeap", "BackgroundMusicExample"));
            _instance._projectRoot          = Path.Combine(Application.dataPath, @"../");
            if (!_instance.BuildProvider())
            {
                return;
            }

            if (!_instance.MoveCustomManifest())
            {
                return;
            }

            if (!_instance.MoveStreamingAssets())
            {
                return;
            }

            if (!_instance.CreateOrModifyPackage())
            {
                return;
            }

            AssetDatabase.Refresh();

            UnityEngine.Debug.Log("Successfully setup project for music service example.");
        }
        public static void BuildMusicPlayerExample()
        {
            if (_instance == null)
            {
                _instance = new MusicExampleBuilder();
            }

            _instance._sdk = SDK.Find(true);
            _instance._musicExampleMabuPath = Path.Combine(Application.dataPath, Path.Combine("MagicLeap", "BackgroundMusicExample"));
            _instance._projectRoot          = Path.Combine(Application.dataPath, @"../");

            EditorUtility.DisplayProgressBar("Setting up Music Service Example", "Building Background Music Service Provider", 0.2f);
            if (!_instance.BuildProvider())
            {
                EditorUtility.ClearProgressBar();
                return;
            }

            EditorUtility.DisplayProgressBar("Setting up Music Service Example", "Creating Custom Manifest", 0.4f);

            if (!_instance.MoveCustomManifest())
            {
                EditorUtility.ClearProgressBar();
                return;
            }

            EditorUtility.DisplayProgressBar("Setting up Music Service Example", "Copying media files to streaming assets", 0.6f);

            if (!_instance.MoveStreamingAssets())
            {
                EditorUtility.ClearProgressBar();
                return;
            }

            EditorUtility.DisplayProgressBar("Setting up Music Service Example", "Creating/Modifying Example Music Provider package", 0.8f);

            if (!_instance.CreateOrModifyPackage())
            {
                EditorUtility.ClearProgressBar();
                return;
            }

            EditorUtility.DisplayProgressBar("Setting up Music Service Example", "Refreshing Asset Database", 1.0f);

            AssetDatabase.Refresh();

            UnityEngine.Debug.Log("Successfully setup project for music service example.");
            EditorUtility.ClearProgressBar();
        }