3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/unitypath.rb', line 3
def unitypath
unity_x64 = "C:\\Program Files\\Unity\\Editor\\Unity.exe"
unity_x86 = "C:\\Program Files (x86)\\Unity\\Editor\\Unity.exe"
unity_mac = "/Applications/Unity/Unity.app/Contents/MacOS/Unity"
case RbConfig::CONFIG['host_os']
when /mswin|windows|w32/i
return unity_x64 if File.exist? unity_x64
return unity_x86 if File.exist? unity_x86
when /darwin/i
return unity_mac if File.exist? unity_mac
end
raise RuntimeError.new("Cannot find unity")
end
|