Esempio n. 1
0
        public void OnNoAssetGUI()
        {
            UpdateCanvasRect();

            if (HandleDropData())
            {
                return;
            }

            using (new EditorGUILayout.VerticalScope())
            {
                GUILayout.FlexibleSpace();
                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.HelpBox("No Image Sequence is currently selected.\nPlease create one within your Assets then select It in the project view.", MessageType.Info);
                    GUILayout.FlexibleSpace();
                }

                GUILayout.Space(8);

                using (new EditorGUILayout.HorizontalScope())
                {
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Create Image Sequence", GUILayout.Width(160)))
                    {
                        string file = EditorUtility.SaveFilePanelInProject("Create Image Sequence", "New Image Sequence", "asset", "Create Image Sequence?");
                        if (file != string.Empty)
                        {
                            var sequence = ImageSequenceAssetFactory.CreateImageSequenceAtPath(file);
                            AssetDatabase.ImportAsset(file);
                            LoadAsset(sequence);
                        }
                    }
                    GUILayout.FlexibleSpace();
                }

                GUILayout.FlexibleSpace();
            }
        }
        public override void Action(int instanceId, string pathName, string resourceFile)
        {
            ImageSequence asset = ImageSequenceAssetFactory.CreateImageSequenceAtPath(pathName);

            ProjectWindowUtil.ShowCreatedAsset(asset);
        }