Наследование: UnityEngine.GUI.Scope
		void OnGUI()
		{
			using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(m_ScrollPosition))
			{
				m_ScrollPosition = scrollViewScope.scrollPosition;

				using (new GUILayout.HorizontalScope())
				{
					GUILayout.Space(5f);
					
					using (new GUILayout.VerticalScope())
					{
						GUILayout.Space(10f);
						
						m_ImportFontParametersSection.DrawInspector();
						GUILayout.Space(5f);
						m_ImportCustomFontSection.DrawInspector();
						GUILayout.Space(5f);
						m_ImportWebFontSection.DrawInspector();
					}
					
					GUILayout.Space(5f);
				}
			}
		}
Пример #2
0
// fields

// properties
    static void ScrollViewScope_scrollPosition(JSVCall vc)
    {
        UnityEngine.GUILayout.ScrollViewScope _this = (UnityEngine.GUILayout.ScrollViewScope)vc.csObj;
        var result = _this.scrollPosition;

        JSApi.setVector2S((int)JSApi.SetType.Rval, result);
    }
 static public int get_handleScrollWheel(IntPtr l)
 {
     try {
         UnityEngine.GUILayout.ScrollViewScope self = (UnityEngine.GUILayout.ScrollViewScope)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.handleScrollWheel);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_handleScrollWheel(IntPtr l)
 {
     try {
         UnityEngine.GUILayout.ScrollViewScope self = (UnityEngine.GUILayout.ScrollViewScope)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.handleScrollWheel = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Пример #5
0
 static void ScrollViewScope_handleScrollWheel(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.GUILayout.ScrollViewScope _this = (UnityEngine.GUILayout.ScrollViewScope)vc.csObj;
         var result = _this.handleScrollWheel;
         JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
     }
     else
     {
         System.Boolean arg0 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
         UnityEngine.GUILayout.ScrollViewScope _this = (UnityEngine.GUILayout.ScrollViewScope)vc.csObj;
         _this.handleScrollWheel = arg0;
     }
 }
        void OnGUI()
        {
			if (Event.current.isKey) // If we detect the user pressed the keyboard
			{
				EditorGUI.FocusTextInControl("SearchInputField");
			}

            if (Event.current.type == EventType.KeyDown)
            {
                KeyCode keyCode = Event.current.keyCode;
                if (keyCode != KeyCode.Return)
                {
                    if (keyCode == KeyCode.Escape)
                    {
                        base.Close();
                        GUIUtility.ExitGUI();
                        return;
                    }
                }
                else
                {
                    Close();
                    GUIUtility.ExitGUI();
                    return;
                }
            }

			using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(m_ScrollPosition))
            {
				m_ScrollPosition = scrollViewScope.scrollPosition;

				using (new GUILayout.HorizontalScope())
				{
					GUILayout.Space(5f);
					
					using (new GUILayout.VerticalScope())
					{
						GUILayout.Space(10f);
						DrawSearchTextField();
						DrawPicker();
					}
					
					GUILayout.Space(5f);
				}
            }
        }
        private void DrawIconList()
        {
            if (m_GlyphArray.Length == 0)
            {
                GUIStyle guiStyle = new GUIStyle();
                guiStyle.fontStyle = FontStyle.Bold;
                guiStyle.alignment = TextAnchor.MiddleCenter;

                EditorGUILayout.LabelField("No icon found for your search term: " + m_SearchText, guiStyle, GUILayout.Height(Screen.height - 80f));
                return;
            }

            float padded = m_PreviewSize + 5f;
            int columns = Mathf.FloorToInt((Screen.width - 25f) / padded);
            if (columns < 1) columns = 1;

            int offset = 0;
            Rect rect = new Rect(0f, 0, m_PreviewSize, m_PreviewSize);

            GUILayout.Space(5f);

			using (GUILayout.ScrollViewScope scrollViewScope = new GUILayout.ScrollViewScope(m_IconViewScrollPosition, GUILayout.Height(Screen.height - 80f)))
			{
				m_IconViewScrollPosition = scrollViewScope.scrollPosition;

				while (offset < m_GlyphArray.Length)
				{
					using (new GUILayout.HorizontalScope())
					{
						int col = 0;
						rect.x = 0f;
						
						for (; offset < m_GlyphArray.Length; ++offset)
						{
							// Change color of the selected VectorImage
							if (m_VectorImageData.glyph.name == m_GlyphArray[offset].name)
							{
								GUI.backgroundColor = MaterialColor.iconDark;
							}
							
							if (GUI.Button(rect, new GUIContent("", m_GlyphArray[offset].name)))
							{
								if (Event.current.button == 0)
								{
									SetGlyph(offset);
									
									if (Time.realtimeSinceStartup - m_LastClickTime < 0.3f)
									{
										Close();
									}
									
									m_LastClickTime = Time.realtimeSinceStartup;
								}
							}
							
							if (Event.current.type == EventType.Repaint)
							{
								drawTiledTexture(rect);
								
								m_GuiStyle.fontSize = m_PreviewSize;
								
								string iconText = IconDecoder.Decode(@"\u" + m_GlyphArray[offset].unicode);
								Vector2 size = m_GuiStyle.CalcSize(new GUIContent(iconText));
								
								float maxSide = size.x > size.y ? size.x : size.y;
								float scaleFactor = (m_PreviewSize / maxSide) * 0.9f;
								
								m_GuiStyle.fontSize = Mathf.RoundToInt(m_PreviewSize * scaleFactor);
								size *= scaleFactor;
								
								Vector2 padding = new Vector2(rect.width - size.x, rect.height - size.y);
								Rect iconRect = new Rect(rect.x + (padding.x / 2f), rect.y + (padding.y / 2f), rect.width - padding.x, rect.height - padding.y);
								
								GUI.Label(iconRect, new GUIContent(iconText), m_GuiStyle);
							}
							
							GUI.backgroundColor = Color.white;
							
							if (++col >= columns)
							{
								++offset;
								break;
							}
							rect.x += padded;
						}
					}
					GUILayout.Space(padded);
					rect.y += padded;
				}
			}
        }
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.GUILayout.ScrollViewScope o;
         if (argc == 3)
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             UnityEngine.GUILayoutOption[] a2;
             checkParams(l, 3, out a2);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.Vector2), typeof(bool), typeof(bool), typeof(UnityEngine.GUILayoutOption[])))
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             System.Boolean a3;
             checkType(l, 4, out a3);
             UnityEngine.GUILayoutOption[] a4;
             checkParams(l, 5, out a4);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(UnityEngine.Vector2), typeof(UnityEngine.GUIStyle), typeof(UnityEngine.GUIStyle), typeof(UnityEngine.GUILayoutOption[])))
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             UnityEngine.GUIStyle a2;
             checkType(l, 3, out a2);
             UnityEngine.GUIStyle a3;
             checkType(l, 4, out a3);
             UnityEngine.GUILayoutOption[] a4;
             checkParams(l, 5, out a4);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             UnityEngine.GUIStyle a2;
             checkType(l, 3, out a2);
             UnityEngine.GUILayoutOption[] a3;
             checkParams(l, 4, out a3);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 7)
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             System.Boolean a3;
             checkType(l, 4, out a3);
             UnityEngine.GUIStyle a4;
             checkType(l, 5, out a4);
             UnityEngine.GUIStyle a5;
             checkType(l, 6, out a5);
             UnityEngine.GUILayoutOption[] a6;
             checkParams(l, 7, out a6);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2, a3, a4, a5, a6);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 8)
         {
             UnityEngine.Vector2 a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             System.Boolean a3;
             checkType(l, 4, out a3);
             UnityEngine.GUIStyle a4;
             checkType(l, 5, out a4);
             UnityEngine.GUIStyle a5;
             checkType(l, 6, out a5);
             UnityEngine.GUIStyle a6;
             checkType(l, 7, out a6);
             UnityEngine.GUILayoutOption[] a7;
             checkParams(l, 8, out a7);
             o = new UnityEngine.GUILayout.ScrollViewScope(a1, a2, a3, a4, a5, a6, a7);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }