void OnSelectionChange()
        {
            if (Selection.objects.Length > 1)
            {
                Debug.Log("Length? " + Selection.objects.Length);
                textPicList.Clear();

                foreach (Object o in Selection.objects)
                {
                    if (o is GameObject)
                    {
                        TextPic tp = ((GameObject)o).GetComponent <TextPic>();
                        if (tp != null)
                        {
                            textPicList.Add(tp);
                        }
                    }
                }
            }
            else if (Selection.activeObject is GameObject)
            {
                textPicList.Clear();
                TextPic tp = ((GameObject)Selection.activeObject).GetComponent <TextPic>();
                if (tp != null)
                {
                    textPicList.Add(tp);
                }
            }
            else
            {
                textPicList.Clear();
            }

            Repaint();
        }
Exemple #2
0
 static public int get_onHrefClick(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         pushValue(l, self.onHrefClick);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #3
0
 static public int get_inspectorIconList(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         pushValue(l, self.inspectorIconList);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #4
0
 static public int SetVerticesDirty(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         self.SetVerticesDirty();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #5
0
 static public int get_ImageScalingFactor(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         pushValue(l, self.ImageScalingFactor);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #6
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic o;
         o = new UnityEngine.UI.Extensions.TextPic();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #7
0
 static public int OnSelect(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic      self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         UnityEngine.EventSystems.BaseEventData a1;
         checkType(l, 2, out a1);
         self.OnSelect(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #8
0
 static public int set_onHrefClick(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         UnityEngine.UI.Extensions.TextPic.HrefClickEvent v;
         checkType(l, 2, out v);
         self.onHrefClick = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #9
0
 static public int set_imageOffset(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         UnityEngine.Vector2 v;
         checkType(l, 2, out v);
         self.imageOffset = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #10
0
 static public int set_hyperlinkColor(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         System.String v;
         checkType(l, 2, out v);
         self.hyperlinkColor = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #11
0
 static public int set_ImageScalingFactor(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         System.Single v;
         checkType(l, 2, out v);
         self.ImageScalingFactor = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #12
0
 static public int set_inspectorIconList(IntPtr l)
 {
     try {
         UnityEngine.UI.Extensions.TextPic            self = (UnityEngine.UI.Extensions.TextPic)checkSelf(l);
         UnityEngine.UI.Extensions.TextPic.IconName[] v;
         checkType(l, 2, out v);
         self.inspectorIconList = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        public void OnGUI()
        {
            GUILayout.Label("TextPic to copy icons", EditorStyles.boldLabel);
            EditorGUILayout.Separator();
            GUILayout.Label("TextPic", EditorStyles.boldLabel);

            EditorGUI.BeginChangeCheck();

            textPic = EditorGUILayout.ObjectField(textPic, typeof(TextPic), true) as TextPic;
            EditorGUI.EndChangeCheck();

            if (textPicList.Count > 0)
            {
                if (textPicList.Count == 1)
                {
                    textPicList[0] = ((TextPic)EditorGUILayout.ObjectField(
                                          textPicList[0],
                                          typeof(TextPic),
                                          true,
                                          GUILayout.Width(columnWidth))
                                      );
                }
                else
                {
                    GUILayout.Label("Multiple TextPic: " + textPicList.Count, GUILayout.Width(columnWidth));
                }

                if (textPic != null)
                {
                    EditorGUILayout.BeginHorizontal();
                    if (GUILayout.Button("Copy Icons"))
                    {
                                                #if UNITY_EDITOR
                        Copy();
                                                #endif
                    }

                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.Separator();
                }
            }
            else
            {
                GUILayout.Label("Please select objects that have a TextPic component", EditorStyles.boldLabel);
            }
        }