public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuGraphic)";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            if (source != MenuSource.AdventureCreator)
            {
                uiImageType = (UIImageType)EditorGUILayout.EnumPopup(new GUIContent("UI image type:", "The type of UI component to link to"), uiImageType);
                if (uiImageType == UIImageType.Image)
                {
                    uiImage = LinkedUiGUI <Image> (uiImage, "Linked Image:", source);
                }
                else if (uiImageType == UIImageType.RawImage)
                {
                    uiRawImage = LinkedUiGUI <RawImage> (uiRawImage, "Linked Raw Image:", source);
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
            }

            graphicType = (AC_GraphicType)CustomGUILayout.EnumPopup("Graphic type:", graphicType, apiPrefix + ".graphicType", "The type of graphic that is shown");
            if (graphicType == AC_GraphicType.Normal)
            {
                graphic.ShowGUI(false, false, "Texture:", CursorRendering.Software, apiPrefix + ".graphic", "The texture to display");
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
예제 #2
0
        public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\")";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            if (source != MenuSource.AdventureCreator)
            {
                uiImageType = (UIImageType)EditorGUILayout.EnumPopup("UI image type:", uiImageType);
                if (uiImageType == UIImageType.Image)
                {
                    uiImage = LinkedUiGUI <Image> (uiImage, "Linked Image:", source);
                }
                else if (uiImageType == UIImageType.RawImage)
                {
                    uiRawImage = LinkedUiGUI <RawImage> (uiRawImage, "Linked Raw Image:", source);
                }
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
            }

            graphicType = (AC_GraphicType)CustomGUILayout.EnumPopup("Graphic type:", graphicType, apiPrefix + ".graphicType");
            if (graphicType == AC_GraphicType.Normal)
            {
                graphic.ShowGUI(false);
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
예제 #3
0
        private void CopyGraphic(MenuGraphic _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiImage = null;
            }
            else
            {
                uiImage = _element.uiImage;
            }
            uiRawImage  = _element.uiRawImage;
            uiImageType = _element.uiImageType;

            graphicType = _element.graphicType;
            graphic     = new CursorIconBase();
            graphic.Copy(_element.graphic);
            base.Copy(_element);
        }