void Init() { this.height = 64; labelStyle = new GUIStyle(GUI.skin.label); labelStyle.wordWrap = true; labelStyle.fontSize = 12; showcase = new AudioClipShowcase(true, false); }
public override void Draw(LocalizationObjectItem drawing, LocalizationObjectItem reference = null, params GUILayoutOption[] areaOptions) { EditableLabel_Auto currentLabel; AudioClipShowcase currentShowcase; if (labelDict == null) { labelDict = new Dictionary <int, EditableLabel_Auto>(); } if (!labelDict.ContainsKey(drawing.GetInstanceID())) { currentLabel = new EditableLabel_Auto(drawing.SetID); labelDict.Add(drawing.GetInstanceID(), currentLabel); } else { currentLabel = labelDict[drawing.GetInstanceID()]; } if (!showcaseDict.ContainsKey(drawing.GetInstanceID())) { currentShowcase = new AudioClipShowcase(true, 240); showcaseDict.Add(drawing.GetInstanceID(), currentShowcase); } else { currentShowcase = showcaseDict[drawing.GetInstanceID()]; } if (reference != null && reference.ItemType != drawing.ItemType) { reference = null; } GUILayout.BeginHorizontal(areaOptions); GUILayout.Label("》", GUILayout.Width(10)); currentLabel.Draw_Advanced(drawing.ID, true, null, null, IDLabelFieldLayout, IDLabelFieldLayout); drawing.Storage = currentShowcase.DrawLayout(drawing.Get <AudioClip>() as AudioClip); Rect inputRect = GUILayoutUtility.GetLastRect(); if (reference == null) { GUI.enabled = false; } if (GUILayout.Button("✦", GUILayout.Width(20))) { PopupWindow.Show(inputRect, new AudioRefPeeker(reference.Get <AudioClip>() as AudioClip, reference.containerGroup.database.name, inputRect)); } GUI.enabled = true; if (GUILayout.Button("X", GUILayout.Width(20))) { drawing.Destroy(); } GUILayout.EndHorizontal(); }