升级XR插件版本
This commit is contained in:
31
Packages/MCPForUnity/Editor/Services/PlatformService.cs
Normal file
31
Packages/MCPForUnity/Editor/Services/PlatformService.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace MCPForUnity.Editor.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation of platform detection service
|
||||
/// </summary>
|
||||
public class PlatformService : IPlatformService
|
||||
{
|
||||
/// <summary>
|
||||
/// Checks if the current platform is Windows
|
||||
/// </summary>
|
||||
/// <returns>True if running on Windows</returns>
|
||||
public bool IsWindows()
|
||||
{
|
||||
return Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the SystemRoot environment variable (Windows-specific)
|
||||
/// </summary>
|
||||
/// <returns>SystemRoot path, or "C:\\Windows" as fallback on Windows, null on other platforms</returns>
|
||||
public string GetSystemRoot()
|
||||
{
|
||||
if (!IsWindows())
|
||||
return null;
|
||||
|
||||
return Environment.GetEnvironmentVariable("SystemRoot") ?? "C:\\Windows";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user