override public void ShowGUI(List <ActionParameter> parameters)
        {
                        #if UNITY_WEBGL
            EditorGUILayout.HelpBox("This Action is not available on the WebGL platform.", MessageType.Info);
                        #elif UNITY_IOS || UNITY_ANDROID || UNITY_WP8
            filePath = EditorGUILayout.TextField("Path to clip file:", filePath);
            canSkip  = EditorGUILayout.Toggle("Player can skip?", canSkip);

            EditorGUILayout.HelpBox("The clip must be placed in a folder named 'StreamingAssets'.", MessageType.Info);
                        #elif UNITY_5 || UNITY_PRO_LICENSE
            movieClipParameterID = Action.ChooseParameterGUI("Movie clip:", parameters, movieClipParameterID, ParameterType.UnityObject);
            if (movieClipParameterID < 0)
            {
                movieClip = (MovieTexture)EditorGUILayout.ObjectField("Movie clip:", movieClip, typeof(MovieTexture), false);
            }

            movieClipType = (MovieClipType)EditorGUILayout.EnumPopup("Play clip:", movieClipType);
            if (movieClipType == MovieClipType.OnMaterial)
            {
                materialParameterID = Action.ChooseParameterGUI("Material to play on:", parameters, materialParameterID, ParameterType.UnityObject);
                if (materialParameterID < 0)
                {
                    material = (Material)EditorGUILayout.ObjectField("Material to play on:", material, typeof(Material), true);
                }
            }

            includeAudio = EditorGUILayout.Toggle("Include audio?", includeAudio);
            if (includeAudio)
            {
                sound = (Sound)EditorGUILayout.ObjectField("Audio source:", sound, typeof(Sound), true);
            }

            if (movieClipType == MovieClipType.OnMaterial)
            {
                willWait = EditorGUILayout.Toggle("Wait until finish?", willWait);
            }
            if (movieClipType == MovieClipType.FullScreen || willWait)
            {
                canSkip = EditorGUILayout.Toggle("Player can skip?", canSkip);
                if (canSkip)
                {
                    skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                }
            }
                        #else
            EditorGUILayout.HelpBox("On non-mobile platforms, this Action is only available in Unity 5 or Unity Pro.", MessageType.Warning);
                        #endif

            AfterRunningOption();
        }
Exemple #2
0
        public override void AssignValues(List <ActionParameter> parameters)
        {
                        #if !(UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_TVOS)
            movieClipType = MovieClipType.VideoPlayer;
                        #endif

                        #if ALLOW_VIDEO
            runtimeVideoPlayer = AssignFile <VideoPlayer> (parameters, videoPlayerParameterID, videoPlayerConstantID, videoPlayer);
            isPaused           = false;

                                #if UNITY_WEBGL
            movieURL = AssignString(parameters, movieURLParameterID, movieURL);
                                #endif
                        #endif
        }
Exemple #3
0
        override public void ShowGUI(List <ActionParameter> parameters)
        {
            movieClipType = (MovieClipType)EditorGUILayout.EnumPopup("Play clip:", movieClipType);

            if (movieClipType == MovieClipType.VideoPlayer)
            {
                                #if UNITY_5_6_OR_NEWER && !UNITY_SWITCH
                videoPlayerParameterID = Action.ChooseParameterGUI("Video player:", parameters, videoPlayerParameterID, ParameterType.GameObject);
                if (videoPlayerParameterID >= 0)
                {
                    videoPlayerConstantID = 0;
                    videoPlayer           = null;
                }
                else
                {
                    videoPlayer = (VideoPlayer)EditorGUILayout.ObjectField("Video player:", videoPlayer, typeof(VideoPlayer), true);

                    videoPlayerConstantID = FieldToID <VideoPlayer> (videoPlayer, videoPlayerConstantID);
                    videoPlayer           = IDToField <VideoPlayer> (videoPlayer, videoPlayerConstantID, false);
                }

                movieMaterialMethod = (MovieMaterialMethod)EditorGUILayout.EnumPopup("Method:", movieMaterialMethod);

                if (movieMaterialMethod == MovieMaterialMethod.PlayMovie)
                {
                                        #if UNITY_WEBGL
                    movieURLParameterID = Action.ChooseParameterGUI("Movie URL:", parameters, movieURLParameterID, ParameterType.String);
                    if (movieURLParameterID < 0)
                    {
                        movieURL = EditorGUILayout.TextField("Movie URL:", movieURL);
                    }
                                        #else
                    newClip = (VideoClip)EditorGUILayout.ObjectField("New Clip (optional):", newClip, typeof(VideoClip), true);
                                        #endif

                    prepareOnly = EditorGUILayout.Toggle("Prepare only?", prepareOnly);
                    willWait    = EditorGUILayout.Toggle("Wait until finish?", willWait);

                    if (willWait && !prepareOnly)
                    {
                        pauseWithGame = EditorGUILayout.Toggle("Pause when game does?", pauseWithGame);
                        canSkip       = EditorGUILayout.Toggle("Player can skip?", canSkip);
                        if (canSkip)
                        {
                            skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                        }
                    }
                }
                                #elif UNITY_SWITCH
                EditorGUILayout.HelpBox("This option not available on Switch.", MessageType.Info);
                                #else
                EditorGUILayout.HelpBox("This option is only available when using Unity 5.6 or later.", MessageType.Info);
                                #endif

                AfterRunningOption();
                return;
            }

                        #if (UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_TVOS)
            if (movieClipType == MovieClipType.OnMaterial)
            {
                EditorGUILayout.HelpBox("This option is not available on the current platform.", MessageType.Info);
            }
            else
            {
                filePath = EditorGUILayout.TextField("Path to clip file:", filePath);
                canSkip  = EditorGUILayout.Toggle("Player can skip?", canSkip);

                EditorGUILayout.HelpBox("The clip must be placed in a folder named 'StreamingAssets'.", MessageType.Info);
            }
                        #elif UNITY_STANDALONE && (UNITY_5 || UNITY_2017_1_OR_NEWER || UNITY_PRO_LICENSE) && !UNITY_2017_2_OR_NEWER
            movieClipParameterID = Action.ChooseParameterGUI("Movie clip:", parameters, movieClipParameterID, ParameterType.UnityObject);
            if (movieClipParameterID < 0)
            {
                movieClip = (MovieTexture)EditorGUILayout.ObjectField("Movie clip:", movieClip, typeof(MovieTexture), false);
            }

            if (movieClipType == MovieClipType.OnMaterial)
            {
                movieMaterialMethod = (MovieMaterialMethod)EditorGUILayout.EnumPopup("Method:", movieMaterialMethod);

                string label = "Material to play on:";
                if (movieMaterialMethod == MovieMaterialMethod.PauseMovie)
                {
                    label = "Material to pause:";
                }
                else if (movieMaterialMethod == MovieMaterialMethod.StopMovie)
                {
                    label = "Material to stop:";
                }

                materialParameterID = Action.ChooseParameterGUI(label, parameters, materialParameterID, ParameterType.UnityObject);
                if (materialParameterID < 0)
                {
                    material = (Material)EditorGUILayout.ObjectField(label, material, typeof(Material), true);
                }
            }

            if (movieClipType == MovieClipType.OnMaterial && movieMaterialMethod != MovieMaterialMethod.PlayMovie)
            {
            }
            else
            {
                includeAudio = EditorGUILayout.Toggle("Include audio?", includeAudio);
                if (includeAudio)
                {
                    sound = (Sound)EditorGUILayout.ObjectField("'Sound' to play audio:", sound, typeof(Sound), true);

                    soundID = FieldToID(sound, soundID);
                    sound   = IDToField(sound, soundID, false);
                }

                if (movieClipType == MovieClipType.OnMaterial && movieMaterialMethod == MovieMaterialMethod.PlayMovie)
                {
                    willWait = EditorGUILayout.Toggle("Wait until finish?", willWait);
                }
                if (movieClipType == MovieClipType.FullScreen || willWait)
                {
                    canSkip = EditorGUILayout.Toggle("Player can skip?", canSkip);
                    if (canSkip)
                    {
                        skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                    }
                }
            }
                        #else
            EditorGUILayout.HelpBox("On standalone, this Action is only available in Unity 5 or Unity Pro.", MessageType.Warning);
                        #endif

            AfterRunningOption();
        }
        public override void ShowGUI()
        {
            #if UNITY_WEBGL

            EditorGUILayout.HelpBox ("This Action is not available on the WebGL platform.", MessageType.Info);

            #elif UNITY_IOS || UNITY_ANDROID || UNITY_WP8

            filePath = EditorGUILayout.TextField ("Path to clip file:", filePath);
            canSkip = EditorGUILayout.Toggle ("Player can skip?", canSkip);

            #elif UNITY_5 || UNITY_PRO_LICENSE

            movieClip = (MovieTexture) EditorGUILayout.ObjectField ("Movie clip:", movieClip, typeof (MovieTexture), false);
            if (movieClip)
            {
                EditorGUILayout.HelpBox ("The clip must be placed in a folder named 'StreamingAssets'.", MessageType.Info);
            }

            movieClipType = (MovieClipType) EditorGUILayout.EnumPopup ("Play clip:", movieClipType);
            if (movieClipType == MovieClipType.OnMaterial)
            {
                material = (Material) EditorGUILayout.ObjectField ("Material to play on:", material, typeof (Material), true);
            }

            includeAudio = EditorGUILayout.Toggle ("Include audio?", includeAudio);
            if (includeAudio)
            {
                sound = (Sound) EditorGUILayout.ObjectField ("Audio source:", sound, typeof (Sound), true);
            }

            if (movieClipType == MovieClipType.OnMaterial)
            {
                willWait = EditorGUILayout.Toggle ("Wait until finish?", willWait);
            }
            if (movieClipType == MovieClipType.FullScreen || willWait)
            {
                canSkip = EditorGUILayout.Toggle ("Player can skip?", canSkip);
                if (canSkip)
                {
                    skipKey = EditorGUILayout.TextField ("Skip with Input Button:", skipKey);
                }
            }

            #else
            EditorGUILayout.HelpBox ("On non-mobile platforms, this Action is only available in Unity 5 or Unity Pro.", MessageType.Warning);
            #endif

            AfterRunningOption ();
        }
Exemple #5
0
        public override void ShowGUI(List <ActionParameter> parameters)
        {
                        #if (UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_TVOS)
            movieClipType = (MovieClipType)EditorGUILayout.EnumPopup("Play clip:", movieClipType);
                        #else
            movieClipType = MovieClipType.VideoPlayer;
                        #endif

            if (movieClipType == MovieClipType.VideoPlayer)
            {
                                #if ALLOW_VIDEO
                videoPlayerParameterID = Action.ChooseParameterGUI("Video player:", parameters, videoPlayerParameterID, ParameterType.GameObject);
                if (videoPlayerParameterID >= 0)
                {
                    videoPlayerConstantID = 0;
                    videoPlayer           = null;
                }
                else
                {
                    videoPlayer = (VideoPlayer)EditorGUILayout.ObjectField("Video player:", videoPlayer, typeof(VideoPlayer), true);

                    videoPlayerConstantID = FieldToID <VideoPlayer> (videoPlayer, videoPlayerConstantID);
                    videoPlayer           = IDToField <VideoPlayer> (videoPlayer, videoPlayerConstantID, false);
                }

                movieMaterialMethod = (MovieMaterialMethod)EditorGUILayout.EnumPopup("Method:", movieMaterialMethod);

                if (movieMaterialMethod == MovieMaterialMethod.PlayMovie)
                {
                                        #if UNITY_WEBGL
                    movieURLParameterID = Action.ChooseParameterGUI("Movie URL:", parameters, movieURLParameterID, ParameterType.String);
                    if (movieURLParameterID < 0)
                    {
                        movieURL = EditorGUILayout.TextField("Movie URL:", movieURL);
                    }
                                        #else
                    newClip = (VideoClip)EditorGUILayout.ObjectField("New Clip (optional):", newClip, typeof(VideoClip), true);
                                        #endif

                    prepareOnly = EditorGUILayout.Toggle("Prepare only?", prepareOnly);
                    willWait    = EditorGUILayout.Toggle("Wait until finish?", willWait);

                    if (willWait && !prepareOnly)
                    {
                        pauseWithGame = EditorGUILayout.Toggle("Pause when game does?", pauseWithGame);
                        canSkip       = EditorGUILayout.Toggle("Player can skip?", canSkip);
                        if (canSkip)
                        {
                            skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                        }
                    }
                }
                                #elif UNITY_SWITCH
                EditorGUILayout.HelpBox("This option not available on Switch.", MessageType.Info);
                                #else
                EditorGUILayout.HelpBox("This option is only available when using Unity 5.6 or later.", MessageType.Info);
                                #endif

                AfterRunningOption();
                return;
            }

                        #if (UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_TVOS)
            if (movieClipType == MovieClipType.OnMaterial)
            {
                EditorGUILayout.HelpBox("This option is not available on the current platform.", MessageType.Info);
            }
            else
            {
                filePath = EditorGUILayout.TextField("Path to clip file:", filePath);
                canSkip  = EditorGUILayout.Toggle("Player can skip?", canSkip);

                EditorGUILayout.HelpBox("The clip must be placed in a folder named 'StreamingAssets'.", MessageType.Info);
            }
                        #endif

            AfterRunningOption();
        }
Exemple #6
0
        override public void ShowGUI(List <ActionParameter> parameters)
        {
            movieClipType = (MovieClipType)EditorGUILayout.EnumPopup("Play clip:", movieClipType);

            if (movieClipType == MovieClipType.VideoPlayer)
            {
                                #if ALLOW_VIDEOPLAYER
                videoPlayerParameterID = Action.ChooseParameterGUI("Video player:", parameters, videoPlayerParameterID, ParameterType.GameObject);
                if (videoPlayerParameterID >= 0)
                {
                    videoPlayerConstantID = 0;
                    videoPlayer           = null;
                }
                else
                {
                    videoPlayer = (VideoPlayer)EditorGUILayout.ObjectField("Video player:", videoPlayer, typeof(VideoPlayer), true);

                    videoPlayerConstantID = FieldToID <VideoPlayer> (videoPlayer, videoPlayerConstantID);
                    videoPlayer           = IDToField <VideoPlayer> (videoPlayer, videoPlayerConstantID, false);
                }

                movieMaterialMethod = (MovieMaterialMethod)EditorGUILayout.EnumPopup("Method:", movieMaterialMethod);

                if (movieMaterialMethod == MovieMaterialMethod.PlayMovie)
                {
                    prepareOnly = EditorGUILayout.Toggle("Prepare only?", prepareOnly);
                    willWait    = EditorGUILayout.Toggle("Wait until finish?", willWait);

                    if (willWait && !prepareOnly)
                    {
                        canSkip = EditorGUILayout.Toggle("Player can skip?", canSkip);
                        if (canSkip)
                        {
                            skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                        }
                    }
                }
                                #else
                EditorGUILayout.HelpBox("This option is only available when using Unity 5.6 or later.", MessageType.Info);
                                #endif

                AfterRunningOption();
                return;
            }

                        #if ALLOW_HANDHELD
            if (movieClipType == MovieClipType.OnMaterial)
            {
                EditorGUILayout.HelpBox("This option is not available on the current platform.", MessageType.Info);
            }
            else
            {
                filePath = EditorGUILayout.TextField("Path to clip file:", filePath);
                canSkip  = EditorGUILayout.Toggle("Player can skip?", canSkip);

                EditorGUILayout.HelpBox("The clip must be placed in a folder named 'StreamingAssets'.", MessageType.Info);
            }
                        #elif ALLOW_MOVIETEXTURES
            movieClipParameterID = Action.ChooseParameterGUI("Movie clip:", parameters, movieClipParameterID, ParameterType.UnityObject);
            if (movieClipParameterID < 0)
            {
                movieClip = (MovieTexture)EditorGUILayout.ObjectField("Movie clip:", movieClip, typeof(MovieTexture), false);
            }

            if (movieClipType == MovieClipType.OnMaterial)
            {
                movieMaterialMethod = (MovieMaterialMethod)EditorGUILayout.EnumPopup("Method:", movieMaterialMethod);

                string label = "Material to play on:";
                if (movieMaterialMethod == MovieMaterialMethod.PauseMovie)
                {
                    label = "Material to pause:";
                }
                else if (movieMaterialMethod == MovieMaterialMethod.StopMovie)
                {
                    label = "Material to stop:";
                }

                materialParameterID = Action.ChooseParameterGUI(label, parameters, materialParameterID, ParameterType.UnityObject);
                if (materialParameterID < 0)
                {
                    material = (Material)EditorGUILayout.ObjectField(label, material, typeof(Material), true);
                }
            }

            if (movieClipType == MovieClipType.OnMaterial && movieMaterialMethod != MovieMaterialMethod.PlayMovie)
            {
            }
            else
            {
                includeAudio = EditorGUILayout.Toggle("Include audio?", includeAudio);
                if (includeAudio)
                {
                    sound = (Sound)EditorGUILayout.ObjectField("'Sound' to play audio:", sound, typeof(Sound), true);

                    soundID = FieldToID(sound, soundID);
                    sound   = IDToField(sound, soundID, false);
                }

                if (movieClipType == MovieClipType.OnMaterial && movieMaterialMethod == MovieMaterialMethod.PlayMovie)
                {
                    willWait = EditorGUILayout.Toggle("Wait until finish?", willWait);
                }
                if (movieClipType == MovieClipType.FullScreen || willWait)
                {
                    canSkip = EditorGUILayout.Toggle("Player can skip?", canSkip);
                    if (canSkip)
                    {
                        skipKey = EditorGUILayout.TextField("Skip with Input Button:", skipKey);
                    }
                }
            }
                        #else
            EditorGUILayout.HelpBox("On standalone, this Action is only available in Unity 5 or Unity Pro.", MessageType.Warning);
                        #endif

            AfterRunningOption();
        }