예제 #1
0
        private void OnEnable()
        {
            AudioBlender blender = (AudioBlender)target;

            blender.EditorAwake();
            if (blender.serializeObject == null)
            {
                blender.serializeObject = CreateInstance <EditorSerializeObject>();
            }
            if (blender.serializeObject.edit && blender.serializeObject.selection >= 0 && blender.serializeObject.selection < blender.sequenceCount && editorWindow == null)
            {
                OpenEditorWindow(blender.GetSequence(blender.serializeObject.selection));
            }
            if (playIcon == null)
            {
                playIcon = ImageDB.GetImage("play.png", "Blenda/Editor/Images");
            }
            if (pauseIcon == null)
            {
                pauseIcon = ImageDB.GetImage("pause.png", "Blenda/Editor/Images");
            }
            if (stopIcon == null)
            {
                stopIcon = ImageDB.GetImage("stop.png", "Blenda/Editor/Images");
            }
            playContent             = new GUIContent(playIcon);
            pauseContent            = new GUIContent(pauseIcon);
            stopContent             = new GUIContent(stopIcon);
            Undo.undoRedoPerformed += UndoRedo;
        }
예제 #2
0
        public void init()
        {
            minSize = maxSize = new Vector2(450, 500);
#if UNITY_5_0
            title = "Dreamteck Splines " + PluginInfo.version;
#else
            titleContent = new GUIContent("Dreamteck Splines " + PluginInfo.version);
#endif
            float x = position.x;
            if (x < 50)
            {
                x = 50;
            }
            else if (x > Screen.width - 500)
            {
                x = Screen.width - 500;
            }
            float y = position.y;
            if (y < 50)
            {
                x = 50;
            }
            else if (y > Screen.height - 550)
            {
                x = Screen.height - 550;
            }
            position = new Rect(x, y, 500, 550);

            changeLogPanel               = new WindowPanel();
            supportPanel                 = new WindowPanel();
            homePanel                    = new WindowPanel();
            learnPanel                   = new WindowPanel();
            changeLogPanel.size          = supportPanel.size = homePanel.size = learnPanel.size = new Vector2(maxSize.x, maxSize.y - 82);
            changeLogPanel.slideDuration = supportPanel.slideDuration = homePanel.slideDuration = learnPanel.slideDuration = 0.25f;
            homePanel.SetState(true, false);
            header        = ImageDB.GetImage("plugin_header.png", "Splines/Editor/Icons");
            changelogIcon = ImageDB.GetImage("changelog.png", "Splines/Editor/Icons");
            learnIcon     = ImageDB.GetImage("get_started.png", "Splines/Editor/Icons");
            supportIcon   = ImageDB.GetImage("support.png", "Splines/Editor/Icons");
            rateIcon      = ImageDB.GetImage("rate.png", "Splines/Editor/Icons");
            pdfIcon       = ImageDB.GetImage("pdf.png", "Splines/Editor/Icons");
            videoIcon     = ImageDB.GetImage("video_tutorials.png", "Splines/Editor/Icons");

            string path = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Editor");
            if (Directory.Exists(path))
            {
                if (File.Exists(path + "/changelog.txt"))
                {
                    string[] lines = File.ReadAllLines(path + "/changelog.txt");
                    changelogText = "";
                    for (int i = 0; i < lines.Length; i++)
                    {
                        changelogText += lines[i] + "\r\n";
                    }
                }
            }
            windowInitialized = true;
        }
예제 #3
0
 internal static GUIContent IconContent(string title, string iconName, string description)
 {
     GUIContent content = new GUIContent(title, description);
     string path = "Splines/Editor/Icons";
     if (EditorGUIUtility.isProSkin) iconName += "_dark";
     Texture2D tex = ImageDB.GetImage(iconName + ".png", path);
     if (tex != null)
     {
         content.image = tex;
         content.text = "";
     }
     return content;
 }
        public bool EditButton(bool selected)
        {
            float width = 40f;

            editButtonContent.image = ImageDB.GetImage("edit_cursor.png", "Splines/Editor/Icons");
            if (editButtonContent.image != null)
            {
                editButtonContent.text = "";
                width = 25f;
            }
            if (SplineEditorGUI.EditorLayoutSelectableButton(editButtonContent, true, selected, GUILayout.Width(width)))
            {
                SceneView.RepaintAll();
                return(true);
            }
            return(false);
        }
        public void EnableToolbar()
        {
            Texture2D tex = ImageDB.GetImage("presets.png", "Splines/Editor/Icons");

            if (tex != null)
            {
                presetButtonContent.image = tex; presetButtonContent.text = "";
            }
            tex = ImageDB.GetImage("move.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                moveButtonContent.image = tex; moveButtonContent.text = "";
            }
            tex = ImageDB.GetImage("rotate.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                rotateButtonContent.image = tex; rotateButtonContent.text = "";
            }
            tex = ImageDB.GetImage("scale.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                scaleButtonContent.image = tex; scaleButtonContent.text = "";
            }
            tex = ImageDB.GetImage("normals.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                normalsButtonContent.image = tex; normalsButtonContent.text = "";
            }
            tex = ImageDB.GetImage("mirror.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                mirrorButtonContent.image = tex; mirrorButtonContent.text = "";
            }
            tex = ImageDB.GetImage("merge.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                mergeButtonContent.image = tex; mergeButtonContent.text = "";
            }
            tex = ImageDB.GetImage("split.png", "Splines/Editor/Icons");
            if (tex != null)
            {
                splitButtonContent.image = tex; splitButtonContent.text = "";
            }
        }
        void InitGUI()
        {
            titleStyle           = new GUIStyle(GUI.skin.label);
            titleStyle.fontSize  = 18;
            titleStyle.fontStyle = FontStyle.Bold;
            Color col = titleStyle.normal.textColor;

            col.a = 0.85f;
            titleStyle.normal.textColor = col;
            titleStyle.alignment        = TextAnchor.MiddleCenter;
            textStyle               = new GUIStyle(GUI.skin.label);
            textStyle.wordWrap      = true;
            textStyle.padding       = new RectOffset(10, 10, 10, 10);
            textStyleBold           = new GUIStyle(textStyle);
            textStyleBold.fontStyle = FontStyle.Bold;
            headerTex               = ImageDB.GetImage("splines2header.png", "Splines/Editor/Icons");
            maxSize    = minSize = new Vector2(headerTex.width, headerTex.height * 2.5f);
            timeOpened = Time.realtimeSinceStartup;
            init       = true;
        }
예제 #7
0
 public void Init()
 {
     titleContent = new GUIContent("Track Editor");
     if (trackerHeadImg == null)
     {
         trackerHeadImg = ImageDB.GetImage("tracker_head.png", "Blenda/Editor/Images");
     }
     if (startHeadImg == null)
     {
         startHeadImg = ImageDB.GetImage("start_time.png", "Blenda/Editor/Images");
     }
     UpdateTrackEditors();
     UpdateClipEditors();
     FindOverlappingClips();
     trackLabelStyle                  = new GUIStyle(GUI.skin.GetStyle("label"));
     trackLabelStyle.alignment        = TextAnchor.UpperCenter;
     trackLabelStyle.fontSize         = 10;
     trackLabelStyle.fontStyle        = FontStyle.Normal;
     trackLabelStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 0.25f) : new Color(0f, 0f, 0f, 0.25f);
     isInit = true;
 }
예제 #8
0
 public BlendClipEditor(Sequence.AudioTrack.BlendClip c, int id)
 {
     clip    = c;
     trackId = id;
     if (stripePattern == null)
     {
         stripePattern = ImageDB.GetImage("stripes.png", "Blenda/Editor/Images");
     }
     if (loopIcon == null)
     {
         loopIcon = ImageDB.GetImage("loop.png", "Blenda/Editor/Images");
     }
     if (startIcon == null)
     {
         startIcon = ImageDB.GetImage("start.png", "Blenda/Editor/Images");
     }
     if (endIcon == null)
     {
         endIcon = ImageDB.GetImage("end.png", "Blenda/Editor/Images");
     }
 }
예제 #9
0
 protected override void GetHeader()
 {
     header = ImageDB.GetImage("plugin_header.png", "Splines/Editor/Icons");
 }
예제 #10
0
 protected override void GetHeader()
 {
     header = ImageDB.GetImage("plugin_header1.png", "Blenda/Editor/Images");
 }