• 大小: 2.59MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-26
  • 语言: 其他
  • 标签:

资源简介

U3D官方源代码,UGUI源代码,可以供大家学习参考,避免开发的时候采坑

资源截图

代码片段和文件信息

using UnityEngine;
using UnityEngine.EventSystems;

namespace UnityEditor.EventSystems
{
    [CustomEditor(typeof(EventSystem) true)]
    public class EventSystemEditor : Editor
    {
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            var eventSystem = target as EventSystem;
            if (eventSystem == null)
                return;

            if (eventSystem.GetComponentseInputModule>() != null)
                return;

            // no input modules :(
            if (GUILayout.Button(“Add Default Input Modules“))
            {
                Undo.AddComponent(eventSystem.gameobject);
                Undo.AddComponent(eventSystem.gameobject);
            }
        }

        public override bool HasPreviewGUI()
        {
            return Application.isPlaying;
        }

        private GUIstyle m_PreviewLabelstyle;

        protected GUIstyle previewLabelstyle
        {
            get
            {
                if (m_PreviewLabelstyle == null)
                {
                    m_PreviewLabelstyle = new GUIstyle(“PreOverlayLabel“)
                    {
                        richText = true
                        alignment = TextAnchor.UpperLeft
                        fontstyle = Fontstyle.Normal
                    };
                }

                return m_PreviewLabelstyle;
            }
        }

        public override bool RequiresConstantRepaint()
        {
            return Application.isPlaying;
        }

        public override void OnPreviewGUI(Rect rect GUIstyle background)
        {
            var system = target as EventSystem;
            if (system == null)
                return;

            GUI.Label(rect system.ToString() previewLabelstyle);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         171  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\.hg_archival.txt
     文件        1230  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\.editorconfig
     文件         421  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\.hgeol
     文件         174  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\.hgignore
     文件        1470  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\.hgtags
     文件        1091  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\LICENSE
     文件        3248  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\README.md
     文件        2456  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UISystem.sln
     文件        1841  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\EventSystem\EventSystemEditor.cs
     文件        4788  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\EventSystem\EventTriggerEditor.cs
     文件         837  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\AspectRatioFitterEditor.cs
     文件        1451  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\AssemblyInfo.cs
     文件         695  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\ButtonEditor.cs
     文件        6618  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\CanvasScalerEditor.cs
     文件         861  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\ContentSizeFitterEditor.cs
     文件        1879  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\DropdownEditor.cs
     文件        3074  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\GraphicEditor.cs
     文件        2087  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\GridLayoutGroupEditor.cs
     文件        2508  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\HorizontalOrVerticalLayoutGroupEditor.cs
     文件        9810  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\ImageEditor.cs
     文件        4309  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\InputFieldEditor.cs
     文件        8443  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\InterceptedEventsPreview.cs
     文件        3744  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\LayoutElementEditor.cs
     文件        5298  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\LayoutPropertiesPreview.cs
     文件         574  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\MaskEditor.cs
     文件       12615  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\MenuOptions.cs
     文件         586  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\PrefabLayoutRebuilder.cs
     文件        1582  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\PropertyDrawers\AnimationTriggersDrawer.cs
     文件        2057  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\PropertyDrawers\ColorBlockDrawer.cs
     文件        2018  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\PropertyDrawers\DropdownOptionListDrawer.cs
     文件       23053  2017-07-24 13:43  Unity-Technologies-ui-0bd08e22bc17\UnityEditor.UI\UI\PropertyDrawers\FontDataDrawer.cs
............此处省略101个文件信息

评论

共有 条评论

相关资源