-
Notifications
You must be signed in to change notification settings - Fork 0
/
BindMinimum.bat
76 lines (58 loc) · 1.85 KB
/
BindMinimum.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo off
setlocal EnableDelayedExpansion
set BASEDIR=%~dp0
if "%BASEDIR:~-1%" == "\" set BASEDIR=%BASEDIR:~0,-1%
set CURDIR=%CD%
if "%CURDIR:~-1%" == "\" set CURDIR=%CURDIR:~0,-1%
if "%BASEDIR%" == "%CURDIR%" (
echo Target directory is the same
goto EXIT
)
rem Resolving base directory
if exist "%CURDIR%\Assets" goto CURDIR_RESOLVED
set CHECKDIR=%CURDIR%
set ROOTDIR=
:ROOT_LOOP
for %%i in ("%CHECKDIR%") do (
if "%%~nxi" == "" goto ROOT_LOOP_END
if "%%~nxi" == "Assets" (
set ROOTDIR=%%~dpi
if "!ROOTDIR:~-1!" == "\" set ROOTDIR=!ROOTDIR:~0,-1!
goto ROOT_LOOP_END
)
)
for %%i in ("%CHECKDIR%\..") do set CHECKDIR=%%~fi
goto ROOT_LOOP
:ROOT_LOOP_END
if "%ROOTDIR%" == "" (
echo Unity project is not found for "%CURDIR%"
) else (
echo Unity project is found in "%ROOTDIR%"
set CURDIR=%ROOTDIR%
)
:CURDIR_RESOLVED
if not exist "%CURDIR%\Assets\Standard Assets\LWF" (
mkdir "%CURDIR%\Assets\Standard Assets\LWF"
)
if not exist "%CURDIR%\Assets\Standard Assets\LWF\core" (
mklink /j "%CURDIR%\Assets\Standard Assets\LWF\core" "%BASEDIR%\csharp\core"
)
if not exist "%CURDIR%\Assets\Standard Assets\LWF\renderer" (
mklink /j "%CURDIR%\Assets\Standard Assets\LWF\renderer" "%BASEDIR%\csharp\unity\renderer"
)
if not exist "%CURDIR%\Assets\Standard Assets\LWF\wrapper" (
mklink /j "%CURDIR%\Assets\Standard Assets\LWF\wrapper" "%BASEDIR%\csharp\unity\wrapper"
)
if not exist "%CURDIR%\Assets\Resources\LWF" (
mkdir "%CURDIR%\Assets\Resources\LWF"
)
if not exist "%CURDIR%\Assets\Resources\LWF\shaders" (
mklink /j "%CURDIR%\Assets\Resources\LWF\shaders" "%BASEDIR%\csharp\unity\shaders"
)
if not exist "%CURDIR%\Assets\Standard Assets\Editor" (
mkdir "%CURDIR%\Assets\Standard Assets\Editor"
)
if not exist "%CURDIR%\Assets\Standard Assets\Editor\LWF" (
mklink /j "%CURDIR%\Assets\Standard Assets\Editor\LWF" "%BASEDIR%\csharp\unity\editor"
)
:EXIT