publicvoidSetVideo(string path) { m_player.source = VideoSource.Url; // I guess this process may not be finished now. m_player.url = path; m_player.Prepare(); }
Use basic widgets, and use them to build functionalities.
Window
2D and 3D (anchoring functionalities, pixels or percentage; prepare some options for different auto scaling and apply to different UI widgets/graphic and situations).
Vertical Stack (stack the (children)widgets)
Layering
Text
JIT font generaion (wtf, keep memory down)
Fich text formatting lib to build customize text(icon, color …).
Auto clip (no idea how to do it)
Image
Use color/gradient more. (looks good with vector graphic)
Texture and loose image(ikd this, no border image?) into sprite sheet.
Stack container
For sorting elements.
Spacing and padding (how to do it with stack)
Invert for quick right to left language fixes (wtf)
Scroll Box
Fixed size(viewport size) with a virtual inner space(content).
7 Graphics (nodes)
Text with effects.
Images(basic) with more shapes, flat or curved.
Lines(strait, curved list?, 3d)
Points, single point or large squares(for effects?)
Shapes
Sector (why? for their art style?)
Custom graphics
Simply Ui workflow
Complex and powerful (lots of resuable compounds, and threading stuff)
Documentation and examples(I guess examples are better and save time)
For coder
Simple code; Less code, less bugs
Simple Tools; Do not overthink. Simple base, complex behaviour.
For UI artist/designer
Communicate to avoid merge conflicts, get ahead of it (cuz yaml merge wont help u all the time).
// get state object EditingState state = GUIUtility.GetStateObject(typeof(EditingState), GUIUtility.GetControlID(FocusType.Passive)) as EditingState;
using (new EditorGUILayout.HorizontalScope(style)) { Rect editButtonRect = new Rect(position.x, position.y, 16f, 16f); if (GUI.Button(editButtonRect, "E")) { // well since it's a class we dun need to set it back :> state.IsEditing = !state.IsEditing; }
if (GUILayout.Button("X", GUILayout.Width(18))) { state.IsEditing = !state.IsEditing; } if (state.IsEditing) { // show text field tagStr = EditorGUILayout.TextField(tagStr); } else { // show lable EditorGUILayout.LabelField(tagStr); } } } }
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
[Serializable] publicstruct LocalizationStringParmPack { [CustomValueDrawer("DrawPreviewText")] public LocalizedString TextLoc; public LocalizationParamsManager.ParamValue[] ParmsArray; publicoverridestringToString() { returnthis.GetRawEnglishString(); }
#if UNITY_EDITOR
static GUIStyle m_previewStyle; static GUIStyle PreviewStyle { get { if (m_previewStyle == null) { m_previewStyle = new GUIStyle(EditorStyles.textArea); m_previewStyle.wordWrap = true; } return m_previewStyle; } }
// use hacky stuff to get selected new lockey staticstring s_wtfKey = string.Empty; staticbool s_hasChanged = false; LocalizedString DrawPreviewText(LocalizedString value, GUIContent label) { using (new EditorGUILayout.VerticalScope(UnityEditor.EditorStyles.helpBox)) { // draw lockey using (new EditorGUILayout.HorizontalScope()) { if (label != null) { EditorGUILayout.LabelField(label, GUILayout.Width(EditorGUIUtility.labelWidth)); }
// weird stuff happin in dropdown if (EditorGUILayout.DropdownButton(new GUIContent(value.mTerm), FocusType.Keyboard)) { var terms = LocalizationManager.GetTermsList(); var selector = new GenericSelector<string>("Select Term", terms); selector.EnableSingleClickToSelect(); selector.SelectionConfirmed += s => { if (s.Any()) { s_wtfKey = s.First(); // WEIRD STUFF HERE /* if I do LocalizedString next = new LocalizedString(s.First()); and return 'next' and the end of method, it just doesnt work!!! cuz the GenericSelector is actually a editor window, and */ s_hasChanged = true; } }; selector.ShowInPopup(); }