/// <summary>
        /// 创建制定对象的撤消点
        /// </summary>
        static public void RegisterUndo(string name, params Object[] objects)
        {
            if (objects != null && objects.Length > 0)
            {
                UnityEditor.Undo.RecordObjects(objects, name);

                foreach (Object obj in objects)
                {
                    if (obj == null)
                    {
                        continue;
                    }
                    GOGUITools.SetDirty(obj);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Convert the specified list of delegate entries into a string array.
        /// </summary>

        static public string[] GetNames(List <Entry> list, string choice, out int index)
        {
            index = 0;
            string[] names = new string[list.Count + 1];
            names[0] = string.IsNullOrEmpty(choice) ? "<Choose>" : choice;

            for (int i = 0; i < list.Count;)
            {
                Entry  ent = list[i];
                string del = GOGUITools.GetFuncName(ent.target, ent.name);
                names[++i] = del;
                if (index == 0 && string.Equals(del, choice))
                {
                    index = i;
                }
            }
            return(names);
        }