Exemple #1
0
            public void OnGUI()
            {
                AffirmResources();

                ScriptableObject selectedObject = treeView.SelectedObject;

                if (selectedObject is EditorEventRef)
                {
                    SetEvent(selectedObject as EditorEventRef);
                }
                else
                {
                    SetEvent(null);
                }

                if (selectedObject != null)
                {
                    GUILayout.BeginVertical(mainStyle, GUILayout.ExpandWidth(true));

                    if (selectedObject is EditorEventRef)
                    {
                        EditorEventRef eventRef = selectedObject as EditorEventRef;

                        if (eventRef.Path.StartsWith("event:"))
                        {
                            DrawEventPreview(eventRef);
                        }
                        else if (eventRef.Path.StartsWith("snapshot:"))
                        {
                            detailsView.DrawSnapshot(eventRef);
                        }
                    }
                    else if (selectedObject is EditorBankRef)
                    {
                        detailsView.DrawBank(selectedObject as EditorBankRef);
                    }
                    else if (selectedObject is EditorParamRef)
                    {
                        detailsView.DrawParameter(selectedObject as EditorParamRef);
                    }

                    GUILayout.EndVertical();

                    if (Event.current.type == EventType.Repaint)
                    {
                        Rect rect = GUILayoutUtility.GetLastRect();
                        isNarrow = rect.width < 600;
                    }
                }
            }