@@ -30,27 +30,20 @@ if (Test-Path "Scenes.meta") { Remove-Item -Path "Scenes.meta" -Force }
3030if (Test-Path " Scripts.meta" ) { Remove-Item - Path " Scripts.meta" - Force }
3131if (Test-Path " Editor.meta" ) { Remove-Item - Path " Editor.meta" - Force }
3232
33- # Create junctions for directories (Unity on Windows needs junctions, not symlinks)
34- # Get absolute paths for the targets
35- $samplesDir = Join-Path $scriptDir " sample"
36- $scenesTarget = Join-Path $samplesDir " Assets\Scenes"
37- $scriptsTarget = Join-Path $samplesDir " Assets\Scripts"
38- $editorTarget = Join-Path $samplesDir " Assets\Editor"
39- $scenesMetaTarget = Join-Path $samplesDir " Assets\Scenes.meta"
40- $scriptsMetaTarget = Join-Path $samplesDir " Assets\Scripts.meta"
41- $editorMetaTarget = Join-Path $samplesDir " Assets\Editor.meta"
42-
33+ # Create symlinks using relative paths (so they work cross-platform)
34+ # Use relative paths like the bash script does
4335try {
44- # Create directory symbolic links (Unity recognizes these on Windows)
36+ # Create directory symbolic links (Unity recognises these on Windows)
4537 # Note: Requires administrator privileges
46- cmd / c mklink / D " Scenes" " $scenesTarget " | Out-Null
47- cmd / c mklink / D " Scripts" " $scriptsTarget " | Out-Null
48- cmd / c mklink / D " Editor" " $editorTarget " | Out-Null
38+ # Using relative paths so symlinks work on all platforms
39+ cmd / c mklink / D " Scenes" " ..\..\sample\Assets\Scenes" | Out-Null
40+ cmd / c mklink / D " Scripts" " ..\..\sample\Assets\Scripts" | Out-Null
41+ cmd / c mklink / D " Editor" " ..\..\sample\Assets\Editor" | Out-Null
4942
5043 # Create file symbolic links for .meta files
51- cmd / c mklink " Scenes.meta" " $scenesMetaTarget " | Out-Null
52- cmd / c mklink " Scripts.meta" " $scriptsMetaTarget " | Out-Null
53- cmd / c mklink " Editor.meta" " $editorMetaTarget " | Out-Null
44+ cmd / c mklink " Scenes.meta" " ..\..\sample\Assets\Scenes.meta " | Out-Null
45+ cmd / c mklink " Scripts.meta" " ..\..\sample\Assets\Scripts.meta " | Out-Null
46+ cmd / c mklink " Editor.meta" " ..\..\sample\Assets\Editor.meta " | Out-Null
5447
5548 Write-Output " "
5649 Write-Output " ✅ Asset symlinks created successfully!"
6154 # Create directory symbolic link for Tests
6255 Set-Location $sampleUnity6
6356 if (Test-Path " Tests" ) { Remove-Item - Path " Tests" - Recurse - Force }
64- $testsTarget = Join-Path $samplesDir " Tests "
65- cmd / c mklink / D " Tests" " $testsTarget " | Out-Null
57+ # Use relative path
58+ cmd / c mklink / D " Tests" " ..\sample\Tests " | Out-Null
6659
6760 Write-Output " "
6861 Write-Output " ✅ Tests symlink created successfully!"
0 commit comments