private BrushAssetRecord AddBrushRecord(Object mainAsset, Brush brush, string assetPath, bool master) { BrushAssetRecord record; int recordIndex = this.FindRecordIndexWithNullChecks(brush); if (recordIndex != -1) { record = this.brushRecords[recordIndex]; // Master and asset path may have changed. record.AssetPath = assetPath; record.isMaster = master; // Remove record from old list since we want to recycle it! this.brushRecords[recordIndex] = null; } else { // Create new record. record = new BrushAssetRecord(assetPath, mainAsset, brush, master); } // Make sure that brush is awake! if (!brush._ready) { brush._ready = true; brush.Awake(); } return(record); }