UnityEditor.XCodeEditorChartboost.PBXGroup.AddChild C# (CSharp) Method

AddChild() public method

public AddChild ( UnityEditor.XCodeEditorChartboost.PBXObject child ) : string
child UnityEditor.XCodeEditorChartboost.PBXObject
return string
		public string AddChild( PBXObject child )
		{
			if( child is PBXFileReference || child is PBXGroup ) {
				children.Add( child.guid );
				return child.guid;
			}
				
			return null;
		}
		

Usage Example

Esempio n. 1
0
        public PBXGroup GetGroup( string name, string path = null, PBXGroup parent = null )
        {
            //			Debug.Log( "GetGroup: " + name + ", " + path + ", " + parent );
            if( string.IsNullOrEmpty( name ) )
                return null;

            if( parent == null )
                parent = rootGroup;

            foreach( KeyValuePair<string, PBXGroup> current in groups ) {

            //				Debug.Log( "current: " + current.Value.guid + ", " + current.Value.name + ", " + current.Value.path + " - " + parent.HasChild( current.Key ) );
                if( string.IsNullOrEmpty( current.Value.name ) ) {
                    if( current.Value.path.CompareTo( name ) == 0 && parent.HasChild( current.Key ) ) {
                        return current.Value;
                    }
                }
                else if( current.Value.name.CompareTo( name ) == 0 && parent.HasChild( current.Key ) ) {
                    return current.Value;
                }
            }

            PBXGroup result = new PBXGroup( name, path );
            groups.Add( result );
            parent.AddChild( result );

            modified = true;
            return result;

            //		def get_or_create_group(self, name, path=None, parent=None):
            //        if not name:
            //            return None
            //
            //        if not parent:
            //            parent = self.root_group
            //        elif not isinstance(parent, PBXGroup):
            //            # assume it's an id
            //            parent = self.objects.get(parent, self.root_group)
            //
            //        groups = self.get_groups_by_name(name)
            //
            //        for grp in groups:
            //            if parent.has_child(grp.id):
            //                return grp
            //
            //        grp = PBXGroup.Create(name, path)
            //        parent.add_child(grp)
            //
            //        self.objects[grp.id] = grp
            //
            //        self.modified = True
            //
            //        return grp
        }
All Usage Examples Of UnityEditor.XCodeEditorChartboost.PBXGroup::AddChild