GetUniqueName() private method

private GetUniqueName ( string existingNames, string name ) : string
existingNames string
name string
return string
コード例 #1
0
            public EnterNamePopup(SerializedProperty tags, TagManagerInspector.EnterNamePopup.EnterDelegate cb)
            {
                this.EnterCB = cb;
                List <string> list = new List <string>();

                for (int i = 0; i < tags.arraySize; i++)
                {
                    string stringValue = tags.GetArrayElementAtIndex(i).stringValue;
                    if (!string.IsNullOrEmpty(stringValue))
                    {
                        list.Add(stringValue);
                    }
                }
                this.m_NewTagName = ObjectNames.GetUniqueName(list.ToArray(), this.m_NewTagName);
            }
コード例 #2
0
            public EnterNamePopup(SerializedProperty tags, EnterDelegate cb)
            {
                EnterCB = cb;


                List <string> existingTagNames = new List <string>();

                for (int i = 0; i < tags.arraySize; i++)
                {
                    string tagName = tags.GetArrayElementAtIndex(i).stringValue;
                    if (!string.IsNullOrEmpty(tagName))
                    {
                        existingTagNames.Add(tagName);
                    }
                }
                m_NewTagName = ObjectNames.GetUniqueName(existingTagNames.ToArray(), m_NewTagName);
            }