Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5080404

Browse files
committed
less GC in GetSRP(), search filter: use ordinalignorecase,
1 parent1bb82ee commit5080404

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,16 @@ private bool ProjectFilter(object item)
439439
boolfound=true;
440440
foreach(varwordinsearchWords)
441441
{
442-
booltitleMatched=proj.Title.IndexOf(word,0,StringComparison.CurrentCultureIgnoreCase)!=-1;
443-
boolpathMatched=searchProjectPathAlso&&proj.Path.IndexOf(word,0,StringComparison.CurrentCultureIgnoreCase)!=-1;
442+
booltitleMatched=proj.Title.IndexOf(word,0,StringComparison.OrdinalIgnoreCase)!=-1;
443+
boolpathMatched=searchProjectPathAlso&&proj.Path.IndexOf(word,0,StringComparison.OrdinalIgnoreCase)!=-1;
444444
found=found&&(titleMatched||pathMatched);
445445
}
446446
returnfound;
447447
}
448448
else// single word search
449449
{
450-
booltitleMatched=proj.Title.IndexOf(_filterString,0,StringComparison.CurrentCultureIgnoreCase)!=-1;
451-
boolpathMatched=searchProjectPathAlso&&proj.Path.IndexOf(_filterString,0,StringComparison.CurrentCultureIgnoreCase)!=-1;
450+
booltitleMatched=proj.Title.IndexOf(_filterString,0,StringComparison.OrdinalIgnoreCase)!=-1;
451+
boolpathMatched=searchProjectPathAlso&&proj.Path.IndexOf(_filterString,0,StringComparison.OrdinalIgnoreCase)!=-1;
452452

453453
returntitleMatched||pathMatched;
454454
}

‎UnityLauncherPro/Properties/AssemblyInfo.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[assembly:AssemblyConfiguration("")]
1313
[assembly:AssemblyCompany("UnityCoder.com")]
1414
[assembly:AssemblyProduct("UnityLauncherPro")]
15-
[assembly:AssemblyCopyright("Copyright ©2023")]
15+
[assembly:AssemblyCopyright("Copyright ©2025")]
1616
[assembly:AssemblyTrademark("")]
1717
[assembly:AssemblyCulture("")]
1818

‎UnityLauncherPro/Tools.cs‎

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,34 +2603,36 @@ private static async Task<bool> DownloadFileAsync(string fileUrl, string destina
26032603

26042604
internalstaticstringGetSRP(stringprojectPath)
26052605
{
2606-
// read projectsettings/graphicsettings file, look for m_SRPDefaultSettings: value
26072606
varsettingsFile=Path.Combine(projectPath,"ProjectSettings","GraphicsSettings.asset");
2608-
if(File.Exists(settingsFile)==false)returnnull;
2607+
if(!File.Exists(settingsFile))returnnull;
26092608

2610-
varallText=File.ReadAllText(settingsFile);
2611-
varsrpIndex=allText.IndexOf("m_SRPDefaultSettings:");
2612-
if(srpIndex==-1)
2613-
{
2614-
srpIndex=allText.IndexOf("m_RenderPipelineGlobalSettingsMap:");// unity 6000.2- ?
2615-
if(srpIndex==-1)returnnull;// BIRP
2616-
}
2617-
2618-
// urp = UnityEngine.Rendering.Universal.UniversalRenderPipeline
2619-
// hdrp = UnityEngine.Rendering.HighDefinition.HDRenderPipeline
2609+
boolsrpSectionFound=false;
26202610

2621-
if(allText.IndexOf("UnityEngine.Rendering.Universal.UniversalRenderPipeline",srpIndex)>-1)
2622-
{
2623-
return"URP";
2624-
}
2625-
elseif(allText.IndexOf("UnityEngine.Rendering.HighDefinition.HDRenderPipeline",srpIndex)>-1)
2611+
using(varreader=newStreamReader(settingsFile))
26262612
{
2627-
return"HDRP";
2628-
}
2629-
else
2630-
{
2631-
returnnull;// BIRP
2632-
}
2613+
stringline;
2614+
while((line=reader.ReadLine())!=null)
2615+
{
2616+
if(!srpSectionFound)
2617+
{
2618+
if(line.Contains("m_SRPDefaultSettings:")||line.Contains("m_RenderPipelineGlobalSettingsMap:"))
2619+
{
2620+
srpSectionFound=true;
2621+
}
2622+
continue;
2623+
}
26332624

2625+
if(line.Contains("UniversalRenderPipeline"))
2626+
{
2627+
return"URP";
2628+
}
2629+
elseif(line.Contains("HDRenderPipeline"))
2630+
{
2631+
return"HDRP";
2632+
}
2633+
}
2634+
}
2635+
returnnull;// BIRP or unknown
26342636
}
26352637

26362638
internalstaticvoidInstallAPK(stringApkPath)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp