├── .gitignore ├── LICENSE.md ├── README.md ├── plugin ├── CMakeLists.txt ├── buildall.bat ├── buildall.sh ├── clearall.bat ├── clearall.sh ├── cmake │ └── apple.cmake ├── external │ ├── include │ │ └── MathUtils.h │ └── src │ │ └── MathUtils.cpp ├── iOS.cmake ├── objective_c │ ├── ObjcSample.h │ ├── ObjcSample.mm │ ├── ObjectiveMathUtils.h │ └── ObjectiveMathUtils.mm ├── source │ ├── sample.cpp │ └── sample.h ├── swift │ ├── SwiftMathUtils.swift │ ├── SwiftSample.h │ └── SwiftSample.mm ├── swiftDummy │ └── Dummy.swift └── swiftResources │ ├── Editor │ └── SwiftPostProcessor.cs │ └── Unity-iPhone-Bridging-Header.h └── unity_project ├── Assets ├── MarshalingCommon.cs ├── Plugins.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene.unity │ └── SampleScene.unity.meta ├── TestPlugin.cs └── TestPlugin.cs.meta ├── Packages └── manifest.json └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/unity,cmake,jetbrains+all,visualstudio 3 | 4 | ### CMake ### 5 | CMakeCache.txt 6 | CMakeFiles 7 | CMakeScripts 8 | Testing 9 | Makefile 10 | cmake_install.cmake 11 | install_manifest.txt 12 | compile_commands.json 13 | CTestTestfile.cmake 14 | 15 | ### JetBrains+all ### 16 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 17 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 18 | 19 | # User-specific stuff 20 | .idea/**/workspace.xml 21 | .idea/**/tasks.xml 22 | .idea/**/usage.statistics.xml 23 | .idea/**/dictionaries 24 | .idea/**/shelf 25 | 26 | # Sensitive or high-churn files 27 | .idea/**/dataSources/ 28 | .idea/**/dataSources.ids 29 | .idea/**/dataSources.local.xml 30 | .idea/**/sqlDataSources.xml 31 | .idea/**/dynamic.xml 32 | .idea/**/uiDesigner.xml 33 | .idea/**/dbnavigator.xml 34 | 35 | # Gradle 36 | .idea/**/gradle.xml 37 | .idea/**/libraries 38 | 39 | # Gradle and Maven with auto-import 40 | # When using Gradle or Maven with auto-import, you should exclude module files, 41 | # since they will be recreated, and may cause churn. Uncomment if using 42 | # auto-import. 43 | # .idea/modules.xml 44 | # .idea/*.iml 45 | # .idea/modules 46 | 47 | # CMake 48 | cmake-build-*/ 49 | 50 | # Mongo Explorer plugin 51 | .idea/**/mongoSettings.xml 52 | 53 | # File-based project format 54 | *.iws 55 | 56 | # IntelliJ 57 | out/ 58 | 59 | # mpeltonen/sbt-idea plugin 60 | .idea_modules/ 61 | 62 | # JIRA plugin 63 | atlassian-ide-plugin.xml 64 | 65 | # Cursive Clojure plugin 66 | .idea/replstate.xml 67 | 68 | # Crashlytics plugin (for Android Studio and IntelliJ) 69 | com_crashlytics_export_strings.xml 70 | crashlytics.properties 71 | crashlytics-build.properties 72 | fabric.properties 73 | 74 | # Editor-based Rest Client 75 | .idea/httpRequests 76 | 77 | ### JetBrains+all Patch ### 78 | # Ignores the whole .idea folder and all .iml files 79 | # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 80 | 81 | .idea/ 82 | 83 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 84 | 85 | *.iml 86 | modules.xml 87 | .idea/misc.xml 88 | *.ipr 89 | 90 | ### Unity ### 91 | [Ll]ibrary/ 92 | [Tt]emp/ 93 | [Oo]bj/ 94 | [Bb]uild/ 95 | [Bb]uilds/ 96 | Assets/AssetStoreTools* 97 | 98 | # Visual Studio cache directory 99 | .vs/ 100 | 101 | # Autogenerated VS/MD/Consulo solution and project files 102 | ExportedObj/ 103 | .consulo/ 104 | *.csproj 105 | *.unityproj 106 | *.sln 107 | *.suo 108 | *.tmp 109 | *.user 110 | *.userprefs 111 | *.pidb 112 | *.booproj 113 | *.svd 114 | *.pdb 115 | *.opendb 116 | 117 | # Unity3D generated meta files 118 | *.pidb.meta 119 | *.pdb.meta 120 | 121 | # Unity3D Generated File On Crash Reports 122 | sysinfo.txt 123 | 124 | # Builds 125 | *.apk 126 | *.unitypackage 127 | 128 | ### VisualStudio ### 129 | ## Ignore Visual Studio temporary files, build results, and 130 | ## files generated by popular Visual Studio add-ons. 131 | ## 132 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 133 | 134 | # User-specific files 135 | *.userosscache 136 | *.sln.docstates 137 | 138 | # User-specific files (MonoDevelop/Xamarin Studio) 139 | 140 | # Build results 141 | [Dd]ebug/ 142 | [Dd]ebugPublic/ 143 | [Rr]elease/ 144 | [Rr]eleases/ 145 | x64/ 146 | x86/ 147 | bld/ 148 | [Bb]in/ 149 | [Ll]og/ 150 | 151 | # Visual Studio 2015/2017 cache/options directory 152 | # Uncomment if you have tasks that create the project's static files in wwwroot 153 | #wwwroot/ 154 | 155 | # Visual Studio 2017 auto generated files 156 | Generated\ Files/ 157 | 158 | # MSTest test Results 159 | [Tt]est[Rr]esult*/ 160 | [Bb]uild[Ll]og.* 161 | 162 | # NUNIT 163 | *.VisualState.xml 164 | TestResult.xml 165 | 166 | # Build Results of an ATL Project 167 | [Dd]ebugPS/ 168 | [Rr]eleasePS/ 169 | dlldata.c 170 | 171 | # Benchmark Results 172 | BenchmarkDotNet.Artifacts/ 173 | 174 | # .NET Core 175 | project.lock.json 176 | project.fragment.lock.json 177 | artifacts/ 178 | 179 | # StyleCop 180 | StyleCopReport.xml 181 | 182 | # Files built by Visual Studio 183 | *_i.c 184 | *_p.c 185 | *_i.h 186 | *.ilk 187 | *.meta 188 | *.obj 189 | *.iobj 190 | *.pch 191 | *.ipdb 192 | *.pgc 193 | *.pgd 194 | *.rsp 195 | *.sbr 196 | *.tlb 197 | *.tli 198 | *.tlh 199 | *.tmp_proj 200 | *.log 201 | *.vspscc 202 | *.vssscc 203 | .builds 204 | *.svclog 205 | *.scc 206 | 207 | # Chutzpah Test files 208 | _Chutzpah* 209 | 210 | # Visual C++ cache files 211 | ipch/ 212 | *.aps 213 | *.ncb 214 | *.opensdf 215 | *.sdf 216 | *.cachefile 217 | *.VC.db 218 | *.VC.VC.opendb 219 | 220 | # Visual Studio profiler 221 | *.psess 222 | *.vsp 223 | *.vspx 224 | *.sap 225 | 226 | # Visual Studio Trace Files 227 | *.e2e 228 | 229 | # TFS 2012 Local Workspace 230 | $tf/ 231 | 232 | # Guidance Automation Toolkit 233 | *.gpState 234 | 235 | # ReSharper is a .NET coding add-in 236 | _ReSharper*/ 237 | *.[Rr]e[Ss]harper 238 | *.DotSettings.user 239 | 240 | # JustCode is a .NET coding add-in 241 | .JustCode 242 | 243 | # TeamCity is a build add-in 244 | _TeamCity* 245 | 246 | # DotCover is a Code Coverage Tool 247 | *.dotCover 248 | 249 | # AxoCover is a Code Coverage Tool 250 | .axoCover/* 251 | !.axoCover/settings.json 252 | 253 | # Visual Studio code coverage results 254 | *.coverage 255 | *.coveragexml 256 | 257 | # NCrunch 258 | _NCrunch_* 259 | .*crunch*.local.xml 260 | nCrunchTemp_* 261 | 262 | # MightyMoose 263 | *.mm.* 264 | AutoTest.Net/ 265 | 266 | # Web workbench (sass) 267 | .sass-cache/ 268 | 269 | # Installshield output folder 270 | [Ee]xpress/ 271 | 272 | # DocProject is a documentation generator add-in 273 | DocProject/buildhelp/ 274 | DocProject/Help/*.HxT 275 | DocProject/Help/*.HxC 276 | DocProject/Help/*.hhc 277 | DocProject/Help/*.hhk 278 | DocProject/Help/*.hhp 279 | DocProject/Help/Html2 280 | DocProject/Help/html 281 | 282 | # Click-Once directory 283 | publish/ 284 | 285 | # Publish Web Output 286 | *.[Pp]ublish.xml 287 | *.azurePubxml 288 | # Note: Comment the next line if you want to checkin your web deploy settings, 289 | # but database connection strings (with potential passwords) will be unencrypted 290 | *.pubxml 291 | *.publishproj 292 | 293 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 294 | # checkin your Azure Web App publish settings, but sensitive information contained 295 | # in these scripts will be unencrypted 296 | PublishScripts/ 297 | 298 | # NuGet Packages 299 | *.nupkg 300 | # The packages folder can be ignored because of Package Restore 301 | **/[Pp]ackages/* 302 | # except build/, which is used as an MSBuild target. 303 | !**/[Pp]ackages/build/ 304 | # Uncomment if necessary however generally it will be regenerated when needed 305 | #!**/[Pp]ackages/repositories.config 306 | # NuGet v3's project.json files produces more ignorable files 307 | *.nuget.props 308 | *.nuget.targets 309 | 310 | # Microsoft Azure Build Output 311 | csx/ 312 | *.build.csdef 313 | 314 | # Microsoft Azure Emulator 315 | ecf/ 316 | rcf/ 317 | 318 | # Windows Store app package directories and files 319 | AppPackages/ 320 | BundleArtifacts/ 321 | Package.StoreAssociation.xml 322 | _pkginfo.txt 323 | *.appx 324 | 325 | # Visual Studio cache files 326 | # files ending in .cache can be ignored 327 | *.[Cc]ache 328 | # but keep track of directories ending in .cache 329 | !*.[Cc]ache/ 330 | 331 | # Others 332 | ClientBin/ 333 | ~$* 334 | *~ 335 | *.dbmdl 336 | *.dbproj.schemaview 337 | *.jfm 338 | *.pfx 339 | *.publishsettings 340 | orleans.codegen.cs 341 | 342 | # Including strong name files can present a security risk 343 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 344 | #*.snk 345 | 346 | # Since there are multiple workflows, uncomment next line to ignore bower_components 347 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 348 | #bower_components/ 349 | 350 | # RIA/Silverlight projects 351 | Generated_Code/ 352 | 353 | # Backup & report files from converting an old project file 354 | # to a newer Visual Studio version. Backup files are not needed, 355 | # because we have git ;-) 356 | _UpgradeReport_Files/ 357 | Backup*/ 358 | UpgradeLog*.XML 359 | UpgradeLog*.htm 360 | ServiceFabricBackup/ 361 | *.rptproj.bak 362 | 363 | # SQL Server files 364 | *.mdf 365 | *.ldf 366 | *.ndf 367 | 368 | # Business Intelligence projects 369 | *.rdl.data 370 | *.bim.layout 371 | *.bim_*.settings 372 | *.rptproj.rsuser 373 | 374 | # Microsoft Fakes 375 | FakesAssemblies/ 376 | 377 | # GhostDoc plugin setting file 378 | *.GhostDoc.xml 379 | 380 | # Node.js Tools for Visual Studio 381 | .ntvs_analysis.dat 382 | node_modules/ 383 | 384 | # Visual Studio 6 build log 385 | *.plg 386 | 387 | # Visual Studio 6 workspace options file 388 | *.opt 389 | 390 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 391 | *.vbw 392 | 393 | # Visual Studio LightSwitch build output 394 | **/*.HTMLClient/GeneratedArtifacts 395 | **/*.DesktopClient/GeneratedArtifacts 396 | **/*.DesktopClient/ModelManifest.xml 397 | **/*.Server/GeneratedArtifacts 398 | **/*.Server/ModelManifest.xml 399 | _Pvt_Extensions 400 | 401 | # Paket dependency manager 402 | .paket/paket.exe 403 | paket-files/ 404 | 405 | # FAKE - F# Make 406 | .fake/ 407 | 408 | # JetBrains Rider 409 | *.sln.iml 410 | 411 | # CodeRush 412 | .cr/ 413 | 414 | # Python Tools for Visual Studio (PTVS) 415 | __pycache__/ 416 | *.pyc 417 | 418 | # Cake - Uncomment if you are using it 419 | # tools/** 420 | # !tools/packages.config 421 | 422 | # Tabs Studio 423 | *.tss 424 | 425 | # Telerik's JustMock configuration file 426 | *.jmconfig 427 | 428 | # BizTalk build output 429 | *.btp.cs 430 | *.btm.cs 431 | *.odx.cs 432 | *.xsd.cs 433 | 434 | # OpenCover UI analysis results 435 | OpenCover/ 436 | 437 | # Azure Stream Analytics local run output 438 | ASALocalRun/ 439 | 440 | # MSBuild Binary and Structured Log 441 | *.binlog 442 | 443 | # NVidia Nsight GPU debugger configuration file 444 | *.nvuser 445 | 446 | # MFractors (Xamarin productivity tool) working folder 447 | .mfractor/ 448 | 449 | # Local History for Visual Studio 450 | .localhistory/ 451 | 452 | 453 | # End of https://www.gitignore.io/api/unity,cmake,jetbrains+all,visualstudio 454 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Dmitri Granetchi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Native plugin for Unity3D (sample) 2 | 3 | Native plugin for "all" unity targets with shared c++ code. 4 | 5 | ## Main features 6 | 7 | - Supports macOS (+editor), Windows (+UWP) (+editor), iOS, Android, WebGL 8 | - Simple and clear build process 9 | - Shared c++ code 10 | - Shared Objective-C code for ios and mac targets 11 | - Shared Swift code for ios and mac targets 12 | - Debug/Release configuration 13 | - Raw source code sample for iOS/WebGL target (useful for debug) 14 | - Marshaling samples (strings, arrays, structs), manual marshaling 15 | 16 | ## Compiling 17 | 18 | I compile all targets on macOS and use Windows only for windows targets. 19 | 20 | ### macOS 21 | 22 | - Setup environment variable `ANDROID_NDK_HOME` target to Android NDK 23 | - Open `plugin` folder 24 | - run `buildall.sh`, special params `[-w add swift sample code] [-x generate xcode projects] [-r Release configuration] [-s copy sources for iOS target (useful for debug)] [-l webgl build]` 25 | 26 | #### Swift 27 | 28 | - Define `SWIFT` in Unity Player Settings window - `Scripting Define Symbols` setting 29 | - Swift target copy additional files in project, feel free to edit or remove them. `Dummy.swift` can be removed if you have another `*.swift` files. `SwiftPostProcessor.cs` configures Xcode project. 30 | 31 | MacOS(+editor) dylibs are huge because contains all swift dylibs (see `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES`) 32 | 33 | ### WebGL static library (WIP) 34 | 35 | Can't get working *.bc library right now (WIP) 36 | 37 | ```text 38 | opt: error loading file '/Assets/Plugins/unity_plugin/webgl/libunity_plugin.bc'ERROR:root:Failed to run llvm optimizations: 39 | UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) 40 | ``` 41 | 42 | - Install [Emscripten](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html) 43 | - Activate Emscripten `source ./emsdk_env.sh` 44 | 45 | ### WebGL sources 46 | 47 | `buildall.sh -l -s` works perfect, some include directives fail sometimes, simple place all *.cpp and *.h files in root Plugins folder 48 | 49 | ### Windows 50 | 51 | - Install CMake 3.6+, MSVS, UWP SDK (optional) 52 | - Open `plugin` folder 53 | - run `buildall.bat`, special params `[-r Release configuration]` 54 | 55 | ### make or MSVS or Xcode 56 | 57 | See `plugin/buildall.[sh|bat]` for more information. 58 | 59 | ## More info 60 | 61 | - [UnityNativeScripting](https://github.com/jacksondunstan/UnityNativeScripting) and [articles](https://jacksondunstan.com/articles/3938) by Jackson Dunstan 62 | 63 | ### iOS & MacOS 64 | 65 | - Unity3D manual [iOS native plugins](https://docs.unity3d.com/Manual/PluginsForIOS.html) 66 | - [Integrating native iOS code into Unity](https://medium.com/@rolir00li/integrating-native-ios-code-into-unity-e844a6131c21) 67 | - [Unity — How to Build a Bridge: iOS to Unity with Swift](https://medium.com/@SoCohesive/unity-how-to-build-a-bridge-ios-to-unity-with-swift-f23653f6261) 68 | 69 | ### Android 70 | 71 | - Unity3D manual [Native c++ plugins for Android](https://docs.unity3d.com/Manual/AndroidNativePlugins.html) 72 | - [Android CMake guide](https://developer.android.com/ndk/guides/cmake) 73 | - [ABI management](https://developer.android.com/ndk/guides/abis) 74 | 75 | ### WebGL 76 | 77 | - [Emscripten](https://kripken.github.io/emscripten-site/index.html) 78 | - [Building Emscripten project](https://kripken.github.io/emscripten-site/docs/compiling/Building-Projects.html) 79 | - [How to use native libraries on Node.js with Emscripten](https://willowtreeapps.com/ideas/how-to-use-native-libraries-on-node-js-with-emscripten) 80 | 81 | ### Marshaling 82 | 83 | - [Interop with Native Libraries](https://www.mono-project.com/docs/advanced/pinvoke/#manual-marshaling) 84 | - [unity-native-array](https://github.com/keijiro/unity-native-array) by keijiro - example with array marshaling 85 | - [Unity c++ Native Plugin Examples](https://bravenewmethod.com/2017/10/30/unity-c-native-plugin-examples/) 86 | 87 | ## Todo 88 | 89 | - [android] test x86 library 90 | - [webgl] static library 91 | -------------------------------------------------------------------------------- /plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6.0 FATAL_ERROR) 2 | 3 | project(unity_plugin CXX) 4 | 5 | include(cmake/apple.cmake) 6 | 7 | # Enable C++11 8 | set(CMAKE_CXX_STANDARD 11) 9 | set(CMAKE_VERBOSE_MAKEFILE ON) 10 | if (NOT (${CMAKE_BUILD_TYPE} MATCHES Release)) 11 | SET(CMAKE_BUILD_TYPE Debug) 12 | endif () 13 | message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") 14 | 15 | if (NOT DEFINED TARGET_DIR) 16 | set(TARGET_DIR ${CMAKE_SOURCE_DIR}/../unity_project/Assets/Plugins/unity_plugin) 17 | endif () 18 | message(STATUS "Target dir: ${TARGET_DIR}") 19 | 20 | # Set platform-dependent compilation defines matching C# 21 | if (EMSCRIPTEN) 22 | add_definitions(-DTARGET_WEBGL) 23 | elseif (IOS) 24 | add_definitions(-DTARGET_OS_IPHONE) 25 | elseif (ANDROID_NDK) 26 | add_definitions(-DTARGET_OS_ANDROID) 27 | elseif (EDITOR) 28 | add_definitions(-DTARGET_OS_EDITOR) 29 | if (WIN32) 30 | add_definitions(-DTARGET_OS_EDITOR_WIN) 31 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 32 | add_definitions(-DTARGET_OS_EDITOR_OSX) 33 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") 34 | add_definitions(-DTARGET_OS_EDITOR_LINUX) 35 | endif () 36 | else () 37 | add_definitions(-DTARGET_OS_STANDALONE) 38 | if (WIN32) 39 | add_definitions(-DTARGET_OS_WIN) 40 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 41 | add_definitions(-DTARGET_OS_OSX) 42 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") 43 | add_definitions(-DTARGET_OS_LINUX) 44 | endif () 45 | endif () 46 | 47 | # Set output path 48 | if (EMSCRIPTEN) 49 | set(TARGET_DIR_EMSCRIPTEN ${TARGET_DIR}/webgl) 50 | # set(CMAKE_STATIC_LIBRARY_SUFFIX ".bc") 51 | # SET(CMAKE_C_CREATE_STATIC_LIBRARY " -o ") 52 | # SET(CMAKE_CXX_CREATE_STATIC_LIBRARY " -o ") 53 | 54 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TARGET_DIR_EMSCRIPTEN}) 55 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TARGET_DIR_EMSCRIPTEN}) 56 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TARGET_DIR_EMSCRIPTEN}) 57 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${TARGET_DIR_EMSCRIPTEN}) 58 | elseif (ANDROID_NDK) 59 | set(TARGET_DIR_ANDROID ${TARGET_DIR}/Android/libs/${ANDROID_ABI}) 60 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TARGET_DIR_ANDROID}) 61 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TARGET_DIR_ANDROID}) 62 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TARGET_DIR_ANDROID}) 63 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${TARGET_DIR_ANDROID}) 64 | elseif (IOS) 65 | set(TARGET_DIR_IOS ${TARGET_DIR}/iOS) 66 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TARGET_DIR_IOS}) 67 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TARGET_DIR_IOS}) 68 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TARGET_DIR_IOS}) 69 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${TARGET_DIR_IOS}) 70 | elseif (WIN32 OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) 71 | if (EDITOR) 72 | set(TARGET_DIR_EDITOR ${TARGET_DIR}/Editor) 73 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TARGET_DIR_EDITOR}) 74 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TARGET_DIR_EDITOR}) 75 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TARGET_DIR_EDITOR}) 76 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${TARGET_DIR_EDITOR}) 77 | else () 78 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${TARGET_DIR}) 79 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${TARGET_DIR}) 80 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${TARGET_DIR}) 81 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${TARGET_DIR}) 82 | endif () 83 | endif () 84 | 85 | # Set include directories 86 | include_directories( 87 | ${CMAKE_SOURCE_DIR}/external/include 88 | ${CMAKE_SOURCE_DIR}/source) 89 | 90 | file(GLOB EXTERNAL_SOURCE_FILES ${CMAKE_SOURCE_DIR}/external/src/*.cpp) 91 | file(GLOB EXTERNAL_HEADER_FILES ${CMAKE_SOURCE_DIR}/external/include/*.h ${CMAKE_SOURCE_DIR}/external/include/*.hpp) 92 | 93 | file(GLOB PLUGIN_SOURCE_FILES ${CMAKE_SOURCE_DIR}/source/*.cpp) 94 | file(GLOB PLUGIN_HEADER_FILES ${CMAKE_SOURCE_DIR}/source/*.h ${CMAKE_SOURCE_DIR}/source/*.hpp) 95 | set( 96 | SOURCES 97 | ${EXTERNAL_SOURCE_FILES} 98 | ${EXTERNAL_HEADER_FILES} 99 | ${PLUGIN_SOURCE_FILES} 100 | ${PLUGIN_HEADER_FILES} 101 | ) 102 | 103 | if (NOT ANDROID_NDK AND NOT EMSCRIPTEN AND (IOS OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))) 104 | file(GLOB OBJECTIVE_SOURCE_FILES ${CMAKE_SOURCE_DIR}/objective_c/*.m ${CMAKE_SOURCE_DIR}/objective_c/*.mm) 105 | file(GLOB OBJECTIVE_HEADER_FILES ${CMAKE_SOURCE_DIR}/objective_c/*.h ${CMAKE_SOURCE_DIR}/objective_c/*.hpp) 106 | 107 | set( 108 | SOURCES 109 | ${OBJECTIVE_SOURCE_FILES} 110 | ${OBJECTIVE_HEADER_FILES} 111 | ${SOURCES} 112 | ) 113 | endif () 114 | 115 | if (SWIFT) 116 | # set(IOS_ARCH arm64) 117 | enable_language(Swift) 118 | set(CMAKE_Swift_LANGUAGE_VERSION 4.2) 119 | file(GLOB SWIFT_SOURCE_FILES ${CMAKE_SOURCE_DIR}/swift/*.swift) 120 | file(GLOB SWIFT_CPP_SOURCE_FILES ${CMAKE_SOURCE_DIR}/swift/*.mm ${CMAKE_SOURCE_DIR}/objective_c/*.m ${CMAKE_SOURCE_DIR}/objective_c/*.cpp) 121 | file(GLOB SWIFT_HEADER_FILES ${CMAKE_SOURCE_DIR}/swift/*.h ${CMAKE_SOURCE_DIR}/swift/*.hpp) 122 | 123 | set( 124 | SOURCES 125 | ${SWIFT_SOURCE_FILES} 126 | ${SWIFT_CPP_SOURCE_FILES} 127 | ${SWIFT_HEADER_FILES} 128 | ${SOURCES} 129 | ) 130 | endif () 131 | 132 | if (EMSCRIPTEN) 133 | add_library(${PROJECT_NAME} ${SOURCES}) 134 | elseif (IOS) 135 | add_library(${PROJECT_NAME} STATIC ${SOURCES}) 136 | set_target_properties(${PROJECT_NAME} PROPERTIES BUNDLE TRUE) 137 | # set_xcode_property(${PROJECT_NAME} ENABLE_BITCODE "NO") 138 | elseif (ANDROID_NDK) 139 | add_library(${PROJECT_NAME} MODULE ${SOURCES}) 140 | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 141 | # Build a library. If on an Apple platform, build it in a bundle. 142 | add_library(${PROJECT_NAME} MODULE ${SOURCES}) 143 | set_target_properties(${PROJECT_NAME} PROPERTIES BUNDLE TRUE) 144 | else () 145 | add_library(${PROJECT_NAME} MODULE ${SOURCES}) 146 | endif () 147 | 148 | if (NOT ANDROID_NDK AND NOT EMSCRIPTEN AND (IOS OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))) 149 | ADD_OSX_FRAMEWORK(Foundation ${PROJECT_NAME}) 150 | if (XCODE) 151 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES") 152 | else () 153 | # Activate ARC - Automatic Reference Counting 154 | target_compile_options(${PROJECT_NAME} PUBLIC "-fobjc-arc") 155 | endif () 156 | endif () 157 | 158 | if (SWIFT) 159 | if (XCODE) 160 | if (IOS) 161 | # force setup arch and deploy target for swift module 162 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET}) 163 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_ARCHS "arm64 armv7") 164 | endif () 165 | 166 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES "YES") 167 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@loader_path/../Frameworks") 168 | endif () 169 | endif () 170 | -------------------------------------------------------------------------------- /plugin/buildall.bat: -------------------------------------------------------------------------------- 1 | 2 | set PLUGIN_DIR=%cd% 3 | set BUILD_TYPE="Debug" 4 | set OUTPUT_DIR="%PLUGIN_DIR%\..\unity_project\Assets\Plugins\unity_plugin" 5 | 6 | :loop 7 | IF NOT "%1"=="" ( 8 | IF "%1"=="-r" ( 9 | SET BUILD_TYPE="Release" 10 | ) 11 | SHIFT 12 | GOTO :loop 13 | ) 14 | 15 | 16 | call :build_windows x86 "" || goto :error 17 | call :build_windows x86_64 " Win64" || goto :error 18 | 19 | call :build_windows_uwp x86 "" || goto :error 20 | call :build_windows_uwp x86_64 " Win64" || goto :error 21 | call :build_windows_uwp arm " ARM" || goto :error 22 | 23 | call :build_windows_editor x86 "" || goto :error 24 | call :build_windows_editor x86_64 " Win64" || goto :error 25 | 26 | 27 | echo "Done." 28 | 29 | EXIT /B 0 30 | 31 | :build_windows 32 | set DIR=%~1 33 | set ARCH=%~2 34 | mkdir "build\windows_%DIR%" 35 | pushd "build\windows_%DIR%" 36 | cmake -G "Visual Studio 15 2017%ARCH%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DTARGET_DIR="%OUTPUT_DIR%\%DIR%" %PLUGIN_DIR% || (popd && exit /b 1) 37 | cmake --build . --config %BUILD_TYPE% || (popd && exit /b 1) 38 | popd 39 | EXIT /B 0 40 | 41 | :build_windows_uwp 42 | set DIR=%~1 43 | set ARCH=%~2 44 | mkdir "build\windows_uwp_%DIR%" 45 | pushd "build\windows_uwp_%DIR%" 46 | cmake -G "Visual Studio 15 2017%ARCH%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DTARGET_DIR="%OUTPUT_DIR%\uwp\%DIR%" %PLUGIN_DIR% || (popd && exit /b 1) 47 | cmake --build . --config %BUILD_TYPE% || (popd && exit /b 1) 48 | popd 49 | EXIT /B 0 50 | 51 | :build_windows_editor 52 | set DIR=%~1 53 | set ARCH=%~2 54 | mkdir "build\windows_editor_%DIR%" 55 | pushd "build\windows_editor_%DIR%" 56 | cmake -G "Visual Studio 15 2017%ARCH%" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DEDITOR=TRUE -DTARGET_DIR="%OUTPUT_DIR%\%DIR%" %PLUGIN_DIR% || (popd && exit /b 1) 57 | cmake --build . --config %BUILD_TYPE% || (popd && exit /b 1) 58 | popd 59 | EXIT /B 0 60 | 61 | error: 62 | pause 63 | exit /b %errorlevel% 64 | -------------------------------------------------------------------------------- /plugin/buildall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SWIFT=false 4 | XCODE=false 5 | SOURCE=false 6 | WEBGL=false 7 | BUILD_TYPE="Debug" 8 | 9 | OUTPUT_DIR="`pwd`/../unity_project/Assets/Plugins/unity_plugin" 10 | 11 | while getopts ":wxsrl" o; do 12 | case "${o}" in 13 | w) 14 | SWIFT=true; XCODE=true; ;; 15 | x) 16 | XCODE=true; ;; 17 | r) 18 | BUILD_TYPE="Release"; ;; 19 | s) 20 | SOURCE=true; ;; 21 | l) 22 | WEBGL=true; ;; 23 | *) 24 | echo "Usage: $0 [-w swift] [-x xcode] [-r release]"; exit 1; ;; 25 | esac 26 | done 27 | 28 | set -x 29 | set -e 30 | 31 | MAC_GENERATOR="Unix Makefiles" 32 | IOS_GENERATOR="Unix Makefiles" 33 | if [ "${XCODE}" = true ] ; then 34 | MAC_GENERATOR="Xcode" 35 | IOS_GENERATOR="Xcode" 36 | fi 37 | 38 | PLUGIN_DIR=`pwd` 39 | 40 | function pre_build() 41 | { 42 | BUILD_DIR=$1 43 | mkdir -p $1 44 | pushd $1 45 | } 46 | 47 | function post_build() 48 | { 49 | popd 50 | } 51 | 52 | function copy_sources() 53 | { 54 | mkdir -p "${OUTPUT_DIR}" 55 | cp -r ./Source "${OUTPUT_DIR}" 56 | cp -r ./External "${OUTPUT_DIR}" 57 | cp -r ./objective_c "${OUTPUT_DIR}" 58 | if [ "${SWIFT}" = true ] ; then 59 | cp -r ./swift "${OUTPUT_DIR}" 60 | cp -r ./swiftResources/ "${OUTPUT_DIR}" 61 | fi 62 | } 63 | 64 | function build_ios() 65 | { 66 | if [ "${SOURCE}" = true ]; then 67 | copy_sources 68 | else 69 | if [ "${SWIFT}" = true ] ; then 70 | mkdir -p "${OUTPUT_DIR}/iOS" 71 | cp -r ./swiftResources/ "${OUTPUT_DIR}" 72 | # empty swift file - activate swift support in Xcode 73 | cp -r ./swiftDummy/ "${OUTPUT_DIR}/iOS" 74 | fi 75 | pre_build build/ios 76 | # cmake fails setup project with swift and armv7, skip armv7 here and force in CMakeLists.txt 77 | ARCH="arm64;armv7" 78 | if [ "${XCODE}" = true ] && [ "${SWIFT}" = true ] ; then 79 | ARCH="arm64" 80 | fi 81 | cmake -G "${IOS_GENERATOR}" -DSWIFT=${SWIFT} -DXCODE=${XCODE} -DTARGET_DIR="${OUTPUT_DIR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} "-DCMAKE_OSX_ARCHITECTURES=${ARCH}" -DCMAKE_TOOLCHAIN_FILE=${PLUGIN_DIR}/iOS.cmake ${PLUGIN_DIR} 82 | if [ "${IOS_GENERATOR}" = "Unix Makefiles" ] ; then 83 | make VERBOSE=1 84 | elif [ "${XCODE}" = true ] ; then 85 | xcodebuild -configuration "${BUILD_TYPE}" -target ALL_BUILD build 86 | fi 87 | post_build 88 | fi 89 | } 90 | 91 | function build_mac() 92 | { 93 | if [ "${SOURCE}" = true ]; then 94 | echo "OSX doesn't support native sources. Force compile library" 95 | fi 96 | pre_build build/mac 97 | cmake -G "${MAC_GENERATOR}" -DSWIFT=${SWIFT} -DXCODE=${XCODE} -DTARGET_DIR="${OUTPUT_DIR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${PLUGIN_DIR} 98 | cmake --build . --config ${BUILD_TYPE} 99 | post_build 100 | } 101 | 102 | function build_mac_editor() 103 | { 104 | if [ "${SOURCE}" = true ]; then 105 | echo "Editor doesn't support native sources. Force compile library" 106 | fi 107 | pre_build build/mac_editor 108 | cmake -G "${MAC_GENERATOR}" -DSWIFT=${SWIFT} -DXCODE=${SWIFT} -DTARGET_DIR="${OUTPUT_DIR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DEDITOR=TRUE ${PLUGIN_DIR} 109 | cmake --build . --config ${BUILD_TYPE} 110 | post_build 111 | } 112 | 113 | function build_emscripten() 114 | { 115 | if [ "${SOURCE}" = true ]; then 116 | copy_sources 117 | else 118 | pre_build build/webgl 119 | emcmake cmake -G "Unix Makefiles" -DSWIFT=${SWIFT} -DEMSCRIPTEN=TRUE -DTARGET_DIR="${OUTPUT_DIR}" -DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=TRUE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${PLUGIN_DIR} 120 | emmake make VERBOSE=1 121 | post_build 122 | fi 123 | } 124 | 125 | function build_android() 126 | { 127 | ANDROID_ABI=$1 128 | pre_build build/android/${ANDROID_ABI} 129 | cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake -DTARGET_DIR="${OUTPUT_DIR}" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DANDROID_ABI=${ANDROID_ABI} ${PLUGIN_DIR} 130 | cmake --build . --config ${BUILD_TYPE} 131 | post_build 132 | } 133 | 134 | function build_windows() 135 | { 136 | pre_build build/windows 137 | cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DTARGET_DIR="${OUTPUT_DIR}" ${PLUGIN_DIR} 138 | cmake --build . --config ${BUILD_TYPE} 139 | post_build 140 | } 141 | 142 | function build_windows_editor() 143 | { 144 | pre_build build/windows_editor 145 | cmake -G "Visual Studio 15 2017 Win64" -DEDITOR=TRUE -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DTARGET_DIR="${OUTPUT_DIR}" ${PLUGIN_DIR} 146 | cmake --build . --config ${BUILD_TYPE} 147 | post_build 148 | } 149 | 150 | 151 | if [ "$(uname)" == "Darwin" ]; then 152 | build_ios 153 | build_mac 154 | build_mac_editor 155 | build_android armeabi-v7a 156 | build_android arm64-v8a 157 | build_android x86 158 | if [ "${WEBGL}" = true ] ; then 159 | build_emscripten 160 | fi 161 | else 162 | build_windows 163 | build_windows_editor 164 | fi 165 | 166 | echo "Done." -------------------------------------------------------------------------------- /plugin/clearall.bat: -------------------------------------------------------------------------------- 1 | 2 | rmdir /S /Q build\windows_x86 3 | rmdir /S /Q build\windows_x86_64 4 | 5 | rmdir /S /Q build\windows_uwp_x86 6 | rmdir /S /Q build\windows_uwp_x86_64 7 | rmdir /S /Q build\windows_uwp_arm 8 | 9 | rmdir /S /Q build\windows_editor_x86 10 | rmdir /S /Q build\windows_editor_x86_64 11 | -------------------------------------------------------------------------------- /plugin/clearall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -x 4 | 5 | if [ "$(uname)" == "Darwin" ]; then 6 | rm -rf build/ios 7 | rm -rf build/mac 8 | rm -rf build/mac_editor 9 | rm -rf build/webgl 10 | rm -rf build/android 11 | else 12 | rm -rf build/windows_x86 13 | rm -rf build/windows_x86_64 14 | rm -rf build/windows_editor_x86 15 | rm -rf build/windows_editor_x86_64 16 | fi 17 | -------------------------------------------------------------------------------- /plugin/cmake/apple.cmake: -------------------------------------------------------------------------------- 1 | macro(ADD_OSX_FRAMEWORK fwname target) 2 | find_library(FRAMEWORK_${fwname} 3 | NAMES ${fwname} 4 | PATHS ${CMAKE_OSX_SYSROOT}/System/Library 5 | PATH_SUFFIXES Frameworks 6 | NO_DEFAULT_PATH) 7 | if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND) 8 | MESSAGE(ERROR ": Framework ${fwname} not found") 9 | else() 10 | TARGET_LINK_LIBRARIES(${target} PUBLIC "${FRAMEWORK_${fwname}}") 11 | MESSAGE(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}}") 12 | endif() 13 | endmacro(ADD_OSX_FRAMEWORK) -------------------------------------------------------------------------------- /plugin/external/include/MathUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | #pragma once 28 | 29 | struct MathUtils { 30 | int Abs(int a); 31 | 32 | int Sum(int a, int b); 33 | }; 34 | -------------------------------------------------------------------------------- /plugin/external/src/MathUtils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #include "MathUtils.h" 29 | 30 | int MathUtils::Abs(int a) { 31 | return a < 0 ? -a : a; 32 | } 33 | 34 | int MathUtils::Sum(int a, int b) { 35 | return a + b; 36 | } 37 | -------------------------------------------------------------------------------- /plugin/iOS.cmake: -------------------------------------------------------------------------------- 1 | # This file is part of the ios-cmake project. It was retrieved from 2 | # https://github.com/cristeab/ios-cmake.git, which is a fork of 3 | # https://code.google.com/p/ios-cmake/. Which in turn is based off of 4 | # the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which 5 | # are included with CMake 2.8.4 6 | # 7 | # The ios-cmake project is licensed under the new BSD license. 8 | # 9 | # Copyright (c) 2014, Bogdan Cristea and LTE Engineering Software, 10 | # Kitware, Inc., Insight Software Consortium. All rights reserved. 11 | # Redistribution and use in source and binary forms, with or without 12 | # modification, are permitted provided that the following conditions 13 | # are met: 14 | # 1. Redistributions of source code must retain the above copyright 15 | # notice, this list of conditions and the following disclaimer. 16 | # 17 | # 2. Redistributions in binary form must reproduce the above copyright 18 | # notice, this list of conditions and the following disclaimer in the 19 | # documentation and/or other materials provided with the distribution. 20 | # 21 | # 3. Neither the name of the copyright holder nor the names of its 22 | # contributors may be used to endorse or promote products derived from 23 | # this software without specific prior written permission. 24 | # 25 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 28 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 29 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 30 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 31 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 33 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | # POSSIBILITY OF SUCH DAMAGE. 37 | # 38 | # This file is based off of the Platform/Darwin.cmake and 39 | # Platform/UnixPaths.cmake files which are included with CMake 2.8.4 40 | # It has been altered for iOS development. 41 | # 42 | # Updated by Alex Stewart (alexs.mac@gmail.com) 43 | # 44 | # ***************************************************************************** 45 | # Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com) 46 | # under the BSD-3-Clause license 47 | # https://github.com/leetal/ios-cmake 48 | # ***************************************************************************** 49 | # 50 | # INFORMATION / HELP 51 | # 52 | # The following variables control the behaviour of this toolchain: 53 | # 54 | # IOS_PLATFORM: OS (default) or SIMULATOR or SIMULATOR64 or TVOS or SIMULATOR_TVOS 55 | # OS = Build for iPhoneOS. 56 | # SIMULATOR = Build for x86 i386 iPhone Simulator. 57 | # SIMULATOR64 = Build for x86_64 iPhone Simulator. 58 | # TVOS = Build for AppleTVOS. 59 | # SIMULATOR_TVOS = Build for x86_64 AppleTV Simulator. 60 | # CMAKE_OSX_SYSROOT: Path to the iOS SDK to use. By default this is 61 | # automatically determined from IOS_PLATFORM and xcodebuild, but 62 | # can also be manually specified (although this should not be required). 63 | # CMAKE_IOS_DEVELOPER_ROOT: Path to the Developer directory for the iOS platform 64 | # being compiled for. By default this is automatically determined from 65 | # CMAKE_OSX_SYSROOT, but can also be manually specified (although this should 66 | # not be required). 67 | # ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true) 68 | # ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default) 69 | # ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default) 70 | # IOS_ARCH: (armv7 armv7s arm64 i386 x86_64) If specified, will override the default architectures for the given IOS_PLATFORM 71 | # OS = armv7 armv7s arm64 72 | # SIMULATOR = i386 73 | # SIMULATOR64 = x86_64 74 | # TVOS = arm64 75 | # SIMULATOR_TVOS = x86_64 76 | # 77 | # This toolchain defines the following variables for use externally: 78 | # 79 | # XCODE_VERSION: Version number (not including Build version) of Xcode detected. 80 | # IOS_SDK_VERSION: Version of iOS SDK being used. 81 | # CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from 82 | # IOS_PLATFORM). 83 | # 84 | # This toolchain defines the following macros for use externally: 85 | # 86 | # set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT) 87 | # A convenience macro for setting xcode specific properties on targets. 88 | # Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel 89 | # example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all"). 90 | # 91 | # find_host_package (PROGRAM ARGS) 92 | # A macro used to find executable programs on the host system, not within the 93 | # iOS environment. Thanks to the android-cmake project for providing the 94 | # command. 95 | 96 | # Fix for PThread library not in path 97 | set(CMAKE_THREAD_LIBS_INIT "-lpthread") 98 | set(CMAKE_HAVE_THREADS_LIBRARY 1) 99 | set(CMAKE_USE_WIN32_THREADS_INIT 0) 100 | set(CMAKE_USE_PTHREADS_INIT 1) 101 | 102 | # Get the Xcode version being used. 103 | execute_process(COMMAND xcodebuild -version 104 | OUTPUT_VARIABLE XCODE_VERSION 105 | ERROR_QUIET 106 | OUTPUT_STRIP_TRAILING_WHITESPACE) 107 | string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}") 108 | string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}") 109 | message(STATUS "Building with Xcode version: ${XCODE_VERSION}") 110 | # Default to building for iPhoneOS if not specified otherwise, and we cannot 111 | # determine the platform from the CMAKE_OSX_ARCHITECTURES variable. The use 112 | # of CMAKE_OSX_ARCHITECTURES is such that try_compile() projects can correctly 113 | # determine the value of IOS_PLATFORM from the root project, as 114 | # CMAKE_OSX_ARCHITECTURES is propagated to them by CMake. 115 | if (NOT DEFINED IOS_PLATFORM) 116 | if (CMAKE_OSX_ARCHITECTURES) 117 | if (CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*") 118 | set(IOS_PLATFORM "OS") 119 | elseif (CMAKE_OSX_ARCHITECTURES MATCHES "i386") 120 | set(IOS_PLATFORM "SIMULATOR") 121 | elseif (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64") 122 | set(IOS_PLATFORM "SIMULATOR64") 123 | endif() 124 | endif() 125 | if (NOT IOS_PLATFORM) 126 | set(IOS_PLATFORM "OS") 127 | endif() 128 | endif() 129 | set(IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING 130 | "Type of iOS platform for which to build.") 131 | # Determine the platform name and architectures for use in xcodebuild commands 132 | # from the specified IOS_PLATFORM name. 133 | if (IOS_PLATFORM STREQUAL "OS") 134 | set(XCODE_IOS_PLATFORM iphoneos) 135 | if(NOT IOS_ARCH) 136 | set(IOS_ARCH armv7 armv7s arm64) 137 | endif() 138 | elseif (IOS_PLATFORM STREQUAL "SIMULATOR") 139 | set(XCODE_IOS_PLATFORM iphonesimulator) 140 | if(NOT IOS_ARCH) 141 | set(IOS_ARCH i386) 142 | endif() 143 | elseif(IOS_PLATFORM STREQUAL "SIMULATOR64") 144 | set(XCODE_IOS_PLATFORM iphonesimulator) 145 | if(NOT IOS_ARCH) 146 | set(IOS_ARCH x86_64) 147 | endif() 148 | elseif (IOS_PLATFORM STREQUAL "TVOS") 149 | set(XCODE_IOS_PLATFORM appletvos) 150 | if(NOT IOS_ARCH) 151 | set(IOS_ARCH arm64) 152 | endif() 153 | elseif (IOS_PLATFORM STREQUAL "SIMULATOR_TVOS") 154 | set(XCODE_IOS_PLATFORM appletvsimulator) 155 | if(NOT IOS_ARCH) 156 | set(IOS_ARCH x86_64) 157 | endif() 158 | else() 159 | message(FATAL_ERROR "Invalid IOS_PLATFORM: ${IOS_PLATFORM}") 160 | endif() 161 | message(STATUS "Configuring iOS build for platform: ${IOS_PLATFORM}, " 162 | "architecture(s): ${IOS_ARCH}") 163 | # If user did not specify the SDK root to use, then query xcodebuild for it. 164 | if (NOT CMAKE_OSX_SYSROOT) 165 | execute_process(COMMAND xcodebuild -version -sdk ${XCODE_IOS_PLATFORM} Path 166 | OUTPUT_VARIABLE CMAKE_OSX_SYSROOT 167 | ERROR_QUIET 168 | OUTPUT_STRIP_TRAILING_WHITESPACE) 169 | message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}") 170 | endif() 171 | if (NOT EXISTS ${CMAKE_OSX_SYSROOT}) 172 | message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain" 173 | "is pointing to the correct path. Please run:" 174 | "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" 175 | "and see if that fixes the problem for you.") 176 | message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} " 177 | "does not exist.") 178 | endif() 179 | # Specify minimum version of deployment target. 180 | if (NOT DEFINED IOS_DEPLOYMENT_TARGET) 181 | # Unless specified, SDK version 8.0 is used by default as minimum target version. 182 | set(IOS_DEPLOYMENT_TARGET "8.0" 183 | CACHE STRING "Minimum iOS version to build for." ) 184 | message(STATUS "Using the default min-version since IOS_DEPLOYMENT_TARGET not provided!") 185 | endif() 186 | # Use bitcode or not 187 | if (NOT DEFINED ENABLE_BITCODE AND NOT IOS_ARCH MATCHES "((^|, )(i386|x86_64))+") 188 | # Unless specified, enable bitcode support by default 189 | set(ENABLE_BITCODE TRUE CACHE BOOL "Whether or not to enable bitcode") 190 | message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!") 191 | endif() 192 | if (NOT DEFINED ENABLE_BITCODE) 193 | message(STATUS "Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!") 194 | endif() 195 | # Use ARC or not 196 | if (NOT DEFINED ENABLE_ARC) 197 | # Unless specified, enable ARC support by default 198 | set(ENABLE_ARC TRUE CACHE BOOL "Whether or not to enable ARC") 199 | message(STATUS "Enabling ARC support by default. ENABLE_ARC not provided!") 200 | endif() 201 | # Use hidden visibility or not 202 | if (NOT DEFINED ENABLE_VISIBILITY) 203 | # Unless specified, disable symbols visibility by default 204 | set(ENABLE_VISIBILITY FALSE CACHE BOOL "Whether or not to hide symbols (-fvisibility=hidden)") 205 | message(STATUS "Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!") 206 | endif() 207 | # Get the SDK version information. 208 | execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion 209 | OUTPUT_VARIABLE IOS_SDK_VERSION 210 | ERROR_QUIET 211 | OUTPUT_STRIP_TRAILING_WHITESPACE) 212 | # Find the Developer root for the specific iOS platform being compiled for 213 | # from CMAKE_OSX_SYSROOT. Should be ../../ from SDK specified in 214 | # CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain 215 | # this information from xcrun or xcodebuild. 216 | if (NOT CMAKE_IOS_DEVELOPER_ROOT) 217 | get_filename_component(IOS_PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH) 218 | get_filename_component(CMAKE_IOS_DEVELOPER_ROOT ${IOS_PLATFORM_SDK_DIR} PATH) 219 | endif() 220 | if (NOT EXISTS ${CMAKE_IOS_DEVELOPER_ROOT}) 221 | message(FATAL_ERROR "Invalid CMAKE_IOS_DEVELOPER_ROOT: " 222 | "${CMAKE_IOS_DEVELOPER_ROOT} does not exist.") 223 | endif() 224 | # Find the C & C++ compilers for the specified SDK. 225 | if (NOT CMAKE_C_COMPILER) 226 | execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang 227 | OUTPUT_VARIABLE CMAKE_C_COMPILER 228 | ERROR_QUIET 229 | OUTPUT_STRIP_TRAILING_WHITESPACE) 230 | message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}") 231 | endif() 232 | if (NOT CMAKE_CXX_COMPILER) 233 | execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++ 234 | OUTPUT_VARIABLE CMAKE_CXX_COMPILER 235 | ERROR_QUIET 236 | OUTPUT_STRIP_TRAILING_WHITESPACE) 237 | message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}") 238 | endif() 239 | # Find (Apple's) libtool. 240 | execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool 241 | OUTPUT_VARIABLE IOS_LIBTOOL 242 | ERROR_QUIET 243 | OUTPUT_STRIP_TRAILING_WHITESPACE) 244 | message(STATUS "Using libtool: ${IOS_LIBTOOL}") 245 | # Configure libtool to be used instead of ar + ranlib to build static libraries. 246 | # This is required on Xcode 7+, but should also work on previous versions of 247 | # Xcode. 248 | set(CMAKE_C_CREATE_STATIC_LIBRARY 249 | "${IOS_LIBTOOL} -static -o ") 250 | set(CMAKE_CXX_CREATE_STATIC_LIBRARY 251 | "${IOS_LIBTOOL} -static -o ") 252 | # Get the version of Darwin (OS X) of the host. 253 | execute_process(COMMAND uname -r 254 | OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION 255 | ERROR_QUIET 256 | OUTPUT_STRIP_TRAILING_WHITESPACE) 257 | # Standard settings. 258 | set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "") 259 | set(CMAKE_SYSTEM_VERSION ${IOS_SDK_VERSION} CACHE INTERNAL "") 260 | set(UNIX TRUE CACHE BOOL "") 261 | set(APPLE TRUE CACHE BOOL "") 262 | set(IOS TRUE CACHE BOOL "") 263 | set(CMAKE_AR ar CACHE FILEPATH "" FORCE) 264 | set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE) 265 | # Force unset of OS X-specific deployment target (otherwise autopopulated), 266 | # required as of cmake 2.8.10. 267 | set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING 268 | "Must be empty for iOS builds." FORCE) 269 | # Set the architectures for which to build. 270 | set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS") 271 | # Change the type of target generated for try_compile() so it'll work when cross-compiling 272 | set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) 273 | # Skip the platform compiler checks for cross compiling. 274 | set(CMAKE_CXX_COMPILER_FORCED TRUE) 275 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 276 | set(CMAKE_C_COMPILER_FORCED TRUE) 277 | set(CMAKE_C_COMPILER_WORKS TRUE) 278 | # All iOS/Darwin specific settings - some may be redundant. 279 | set(CMAKE_SHARED_LIBRARY_PREFIX "lib") 280 | set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") 281 | set(CMAKE_SHARED_MODULE_PREFIX "lib") 282 | set(CMAKE_SHARED_MODULE_SUFFIX ".so") 283 | set(CMAKE_C_COMPILER_ABI ELF) 284 | set(CMAKE_CXX_COMPILER_ABI ELF) 285 | set(CMAKE_C_HAS_ISYSROOT 1) 286 | set(CMAKE_CXX_HAS_ISYSROOT 1) 287 | set(CMAKE_MODULE_EXISTS 1) 288 | set(CMAKE_DL_LIBS "") 289 | set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") 290 | set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") 291 | set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") 292 | set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") 293 | 294 | if(IOS_ARCH MATCHES "((^|, )(arm64|x86_64))+") 295 | set(CMAKE_C_SIZEOF_DATA_PTR 8) 296 | set(CMAKE_CXX_SIZEOF_DATA_PTR 8) 297 | message(STATUS "Using a data_ptr size of 8") 298 | else() 299 | set(CMAKE_C_SIZEOF_DATA_PTR 4) 300 | set(CMAKE_CXX_SIZEOF_DATA_PTR 4) 301 | message(STATUS "Using a data_ptr size of 4") 302 | endif() 303 | 304 | message(STATUS "Building for minimum iOS version: ${IOS_DEPLOYMENT_TARGET}" 305 | " (SDK version: ${IOS_SDK_VERSION})") 306 | # Note that only Xcode 7+ supports the newer more specific: 307 | # -m${XCODE_IOS_PLATFORM}-version-min flags, older versions of Xcode use: 308 | # -m(ios/ios-simulator)-version-min instead. 309 | if (IOS_PLATFORM STREQUAL "OS") 310 | if (XCODE_VERSION VERSION_LESS 7.0) 311 | set(XCODE_IOS_PLATFORM_VERSION_FLAGS 312 | "-mios-version-min=${IOS_DEPLOYMENT_TARGET}") 313 | else() 314 | # Xcode 7.0+ uses flags we can build directly from XCODE_IOS_PLATFORM. 315 | set(XCODE_IOS_PLATFORM_VERSION_FLAGS 316 | "-m${XCODE_IOS_PLATFORM}-version-min=${IOS_DEPLOYMENT_TARGET}") 317 | endif() 318 | elseif (IOS_PLATFORM STREQUAL "TVOS") 319 | set(XCODE_IOS_PLATFORM_VERSION_FLAGS 320 | "-mtvos-version-min=${IOS_DEPLOYMENT_TARGET}") 321 | elseif (IOS_PLATFORM STREQUAL "SIMULATOR_TVOS") 322 | set(XCODE_IOS_PLATFORM_VERSION_FLAGS 323 | "-mtvos-simulator-version-min=${IOS_DEPLOYMENT_TARGET}") 324 | else() 325 | # SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min. 326 | set(XCODE_IOS_PLATFORM_VERSION_FLAGS 327 | "-mios-simulator-version-min=${IOS_DEPLOYMENT_TARGET}") 328 | endif() 329 | message(STATUS "Version flags set to: ${XCODE_IOS_PLATFORM_VERSION_FLAGS}") 330 | 331 | if (ENABLE_BITCODE) 332 | set(BITCODE "-fembed-bitcode") 333 | set(HEADER_PAD "") 334 | message(STATUS "Enabling bitcode support.") 335 | else() 336 | set(BITCODE "") 337 | set(HEADER_PAD "-headerpad_max_install_names") 338 | message(STATUS "Disabling bitcode support.") 339 | endif() 340 | 341 | if (ENABLE_ARC) 342 | set(FOBJC_ARC "-fobjc-arc") 343 | message(STATUS "Enabling ARC support.") 344 | else() 345 | set(FOBJC_ARC "-fno-objc-arc") 346 | message(STATUS "Disabling ARC support.") 347 | endif() 348 | 349 | if (NOT ENABLE_VISIBILITY) 350 | set(VISIBILITY "-fvisibility=hidden") 351 | message(STATUS "Hiding symbols (-fvisibility=hidden).") 352 | else() 353 | set(VISIBILITY "") 354 | endif() 355 | 356 | set(CMAKE_C_FLAGS 357 | "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}") 358 | # Hidden visibilty is required for C++ on iOS. 359 | set(CMAKE_CXX_FLAGS 360 | "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}") 361 | set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${BITCODE} ${CMAKE_CXX_FLAGS_MINSIZEREL}") 362 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${BITCODE} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") 363 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${BITCODE} ${CMAKE_CXX_FLAGS_RELEASE}") 364 | set(CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") 365 | set(CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") 366 | 367 | # In order to ensure that the updated compiler flags are used in try_compile() 368 | # tests, we have to forcibly set them in the CMake cache, not merely set them 369 | # in the local scope. 370 | list(APPEND VARS_TO_FORCE_IN_CACHE 371 | CMAKE_C_FLAGS 372 | CMAKE_CXX_FLAGS 373 | CMAKE_CXX_FLAGS_RELWITHDEBINFO 374 | CMAKE_CXX_FLAGS_MINSIZEREL 375 | CMAKE_CXX_FLAGS_RELEASE 376 | CMAKE_C_LINK_FLAGS 377 | CMAKE_CXX_LINK_FLAGS) 378 | foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE}) 379 | set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" FORCE) 380 | endforeach() 381 | 382 | set(CMAKE_PLATFORM_HAS_INSTALLNAME 1) 383 | set (CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks") 384 | set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib ${HEADER_PAD}") 385 | set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle ${HEADER_PAD}") 386 | set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") 387 | set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") 388 | set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") 389 | 390 | # Hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old 391 | # build tree (where install_name_tool was hardcoded) and where 392 | # CMAKE_INSTALL_NAME_TOOL isn't in the cache and still cmake didn't fail in 393 | # CMakeFindBinUtils.cmake (because it isn't rerun) hardcode 394 | # CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did 395 | # before, Alex. 396 | if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) 397 | find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) 398 | endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) 399 | 400 | # Set the find root to the iOS developer roots and to user defined paths. 401 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_OSX_SYSROOT} 402 | ${CMAKE_PREFIX_PATH} CACHE string "iOS find search path root" FORCE) 403 | # Default to searching for frameworks first. 404 | set(CMAKE_FIND_FRAMEWORK FIRST) 405 | # Set up the default search directories for frameworks. 406 | set(CMAKE_SYSTEM_FRAMEWORK_PATH 407 | ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks 408 | ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks 409 | ${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks) 410 | # Only search the specified iOS SDK, not the remainder of the host filesystem. 411 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) 412 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 413 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 414 | # This little macro lets you set any XCode specific property. 415 | macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION) 416 | set(XCODE_RELVERSION_I "${XCODE_RELVERSION}") 417 | if (XCODE_RELVERSION_I STREQUAL "All") 418 | set_property(TARGET ${TARGET} PROPERTY 419 | XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}") 420 | else() 421 | set_property(TARGET ${TARGET} PROPERTY 422 | XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}") 423 | endif() 424 | endmacro(set_xcode_property) 425 | # This macro lets you find executable programs on the host system. 426 | macro(find_host_package) 427 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 428 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) 429 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) 430 | set(IOS FALSE) 431 | find_package(${ARGN}) 432 | set(IOS TRUE) 433 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) 434 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 435 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 436 | endmacro(find_host_package) -------------------------------------------------------------------------------- /plugin/objective_c/ObjcSample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | int objc_abs(int a); 33 | 34 | int objc_sum(int a, int b); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif -------------------------------------------------------------------------------- /plugin/objective_c/ObjcSample.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #include "ObjcSample.h" 29 | #include "ObjectiveMathUtils.h" 30 | 31 | #if !__has_feature(objc_arc) 32 | #error "ARC is off" 33 | #endif 34 | 35 | int objc_abs(int a) { 36 | ObjectiveMathUtils *utils = [[ObjectiveMathUtils alloc] init]; 37 | return [utils abs:a]; 38 | } 39 | 40 | int objc_sum(int a, int b) { 41 | ObjectiveMathUtils *utils = [[ObjectiveMathUtils alloc] init]; 42 | return [utils sum:a andB:b]; 43 | } -------------------------------------------------------------------------------- /plugin/objective_c/ObjectiveMathUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #import 29 | 30 | @interface ObjectiveMathUtils : NSObject 31 | 32 | - (int)abs:(int)a; 33 | 34 | - (int)sum:(int)a andB:(int)b; 35 | @end -------------------------------------------------------------------------------- /plugin/objective_c/ObjectiveMathUtils.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #import "ObjectiveMathUtils.h" 29 | 30 | @implementation ObjectiveMathUtils 31 | 32 | - (int)abs:(int)a { 33 | return a < 0 ? -a : a; 34 | } 35 | 36 | - (int)sum:(int)a andB:(int)b { 37 | return a + b; 38 | } 39 | 40 | @end -------------------------------------------------------------------------------- /plugin/source/sample.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sample.cpp 3 | * Visit https://github.com/profelis/unity_plugin for documentation, updates and examples. 4 | * 5 | * Copyright (c) 2018 Dmitri Granetchi 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include "MathUtils.h" 33 | #include "sample.h" 34 | 35 | extern "C" int UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API plugin_abs(int a) { 36 | MathUtils utils; 37 | return utils.Abs(a); 38 | } 39 | 40 | extern "C" int UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API plugin_sum(int a, int b) { 41 | MathUtils utils; 42 | return utils.Sum(a, b); 43 | } 44 | 45 | extern "C" bool UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API isEqualsString(const char *a, const char *b) { 46 | return strcmp(a, b) == 0; 47 | } 48 | 49 | extern "C" const char* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API getString() 50 | { 51 | char* str = new char[200]; 52 | strcpy(str, "Dynamic string"); 53 | return str; 54 | } 55 | 56 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API getStringTo(char* str, size_t strLength) 57 | { 58 | strncpy(str, "Hello from c++", strLength); 59 | } 60 | 61 | extern "C" const char* UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API getConstString() 62 | { 63 | return "some const string"; 64 | } 65 | 66 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API WriteIntArray(int *array, int length) 67 | { 68 | assert(length == 3); 69 | array[0] = length - 2; 70 | array[1] = length - 1; 71 | array[2] = length; 72 | } 73 | 74 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API WriteVector3Array(Vector3 *array, int length) 75 | { 76 | assert(length == 3); 77 | array[0] = Vector3{1, 0, 0}; 78 | array[1] = Vector3{0, 1, 0}; 79 | array[2] = Vector3{0, 0, 1}; 80 | } 81 | 82 | extern "C" float UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API PassVector3ByValue(Vector3 vector) 83 | { 84 | return sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z); 85 | } 86 | 87 | extern "C" float UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API PassVector3ByRefIn(Vector3* vector) 88 | { 89 | return sqrt(vector->x * vector->x + vector->y * vector->y + vector->z * vector->z); 90 | } 91 | 92 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API PassVector3ByRefOut(Vector3* vector) 93 | { 94 | vector->x = 1; 95 | vector->y = 1; 96 | vector->z = 1; 97 | } 98 | 99 | extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API PassVector3ByRefInOut(Vector3* vector) 100 | { 101 | vector->x *= 2; 102 | vector->y *= 2; 103 | vector->z *= 2; 104 | } -------------------------------------------------------------------------------- /plugin/source/sample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sample.h 3 | * Visit https://github.com/profelis/unity_plugin for documentation, updates and examples. 4 | * 5 | * Copyright (c) 2018 Dmitri Granetchi 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if defined(__CYGWIN32__) 32 | #define UNITY_INTERFACE_API __stdcall 33 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 34 | #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY) 35 | #define UNITY_INTERFACE_API __stdcall 36 | #define UNITY_INTERFACE_EXPORT __declspec(dllexport) 37 | #elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(__QNX__) 38 | #define UNITY_INTERFACE_API 39 | #define UNITY_INTERFACE_EXPORT 40 | #else 41 | #define UNITY_INTERFACE_API 42 | #define UNITY_INTERFACE_EXPORT 43 | #endif 44 | 45 | typedef struct Vector3 { 46 | float x; 47 | float y; 48 | float z; 49 | } Vector3; -------------------------------------------------------------------------------- /plugin/swift/SwiftMathUtils.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * SwiftMathUtils.swift 3 | * Visit https://github.com/profelis/unity_plugin for documentation, updates and examples. 4 | * 5 | * Copyright (c) 2018 Dmitri Granetchi 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | import Foundation 30 | 31 | @objcMembers public class SwiftMathUtils: NSObject { 32 | 33 | public func abs(a: Int) -> Int { 34 | return a < 0 ? -a : a; 35 | } 36 | 37 | public func sum(a: Int, b: Int) -> Int { 38 | return a + b; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /plugin/swift/SwiftSample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SwiftSample.h 3 | * Visit https://github.com/profelis/unity_plugin for documentation, updates and examples. 4 | * 5 | * Copyright (c) 2018 Dmitri Granetchi 6 | * 7 | * Permission is hereby granted, free of charge, to any person 8 | * obtaining a copy of this software and associated documentation 9 | * files (the "Software"), to deal in the Software without 10 | * restriction, including without limitation the rights to use, 11 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the 13 | * Software is furnished to do so, subject to the following 14 | * conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be 17 | * included in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 21 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 23 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 24 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 26 | * OTHER DEALINGS IN THE SOFTWARE. 27 | */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | int swift_abs(int a); 34 | 35 | int swift_sum(int a, int b); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /plugin/swift/SwiftSample.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #import "SwiftSample.h" 29 | #import "unity_plugin-Swift.h" 30 | 31 | int swift_abs(int a) { 32 | SwiftMathUtils *utils = [SwiftMathUtils new]; 33 | return [utils absWithA:a]; 34 | } 35 | 36 | int swift_sum(int a, int b) { 37 | SwiftMathUtils *utils = [SwiftMathUtils new]; 38 | return [utils sumWithA:a b:b]; 39 | } 40 | -------------------------------------------------------------------------------- /plugin/swiftDummy/Dummy.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | import Foundation 29 | -------------------------------------------------------------------------------- /plugin/swiftResources/Editor/SwiftPostProcessor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | using UnityEditor; 29 | using UnityEditor.Callbacks; 30 | using UnityEditor.iOS.Xcode; 31 | using UnityEngine; 32 | 33 | public static class SwiftPostProcessor 34 | { 35 | [PostProcessBuild] 36 | public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath) 37 | { 38 | if (buildTarget == BuildTarget.iOS) 39 | { 40 | var projPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj"; 41 | Debug.Log("SwiftPostProcessor: Processing project: " + projPath); 42 | var proj = new PBXProject(); 43 | proj.ReadFromFile(projPath); 44 | 45 | var targetName = PBXProject.GetUnityTargetName(); 46 | Debug.Log("SwiftPostProcessor: Target: " + targetName); 47 | var targetGuid = proj.TargetGuidByName(targetName); 48 | 49 | proj.SetBuildProperty(targetGuid, "SWIFT_OBJC_BRIDGING_HEADER", "Libraries/Plugins/unity_plugin/Unity-iPhone-Bridging-Header.h"); 50 | proj.SetBuildProperty(targetGuid, "SWIFT_OBJC_INTERFACE_HEADER_NAME", "unity_plugin-Swift.h"); 51 | proj.SetBuildProperty(targetGuid, "SWIFT_VERSION", "4.2"); 52 | proj.SetBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); 53 | proj.AddBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "@executable_path/Frameworks"); 54 | // proj.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO"); 55 | 56 | proj.WriteToFile(projPath); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /plugin/swiftResources/Unity-iPhone-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /unity_project/Assets/MarshalingCommon.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | using System; 29 | using System.Runtime.InteropServices; 30 | 31 | /// 32 | /// Common marshaling utils 33 | /// https://www.mono-project.com/docs/advanced/pinvoke/#manual-marshaling 34 | /// 35 | public static class MarshalingCommon 36 | { 37 | public static string PtrToAnsiString(IntPtr p) 38 | { 39 | if (p == IntPtr.Zero) 40 | return null; 41 | return Marshal.PtrToStringAnsi(p); 42 | } 43 | 44 | public static string PtrToUniString(IntPtr p) 45 | { 46 | if (p == IntPtr.Zero) 47 | return null; 48 | return Marshal.PtrToStringUni(p); 49 | } 50 | 51 | public static string PtrTBSTRString(IntPtr p) 52 | { 53 | if (p == IntPtr.Zero) 54 | return null; 55 | return Marshal.PtrToStringBSTR(p); 56 | } 57 | 58 | public static string[] PtrToStringArray(IntPtr stringArray, Func transformer) 59 | { 60 | if (stringArray == IntPtr.Zero) 61 | return new string[] { }; 62 | 63 | int argc = CountStrings(stringArray); 64 | return PtrToStringArray(argc, stringArray, transformer); 65 | } 66 | 67 | private static int CountStrings(IntPtr stringArray) 68 | { 69 | int count = 0; 70 | while (Marshal.ReadIntPtr(stringArray, count * IntPtr.Size) != IntPtr.Zero) 71 | ++count; 72 | return count; 73 | } 74 | 75 | private static string[] PtrToStringArray(int count, IntPtr stringArray, Func transformer) 76 | { 77 | if (count < 0) 78 | throw new ArgumentOutOfRangeException("count", "< 0"); 79 | if (stringArray == IntPtr.Zero) 80 | return new string[count]; 81 | 82 | string[] members = new string[count]; 83 | for (int i = 0; i < count; ++i) 84 | { 85 | IntPtr s = Marshal.ReadIntPtr(stringArray, i * IntPtr.Size); 86 | members[i] = transformer(s); 87 | } 88 | 89 | return members; 90 | } 91 | } -------------------------------------------------------------------------------- /unity_project/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b77493f66ab5428db864a5460b51e33 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity_project/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f704ae4b4f98ae41a0bce26658850c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity_project/Assets/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657838, g: 0.49641234, b: 0.57481676, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_TemporalCoherenceThreshold: 1 54 | m_EnvironmentLightingMode: 0 55 | m_EnableBakedLightmaps: 1 56 | m_EnableRealtimeLightmaps: 0 57 | m_LightmapEditorSettings: 58 | serializedVersion: 10 59 | m_Resolution: 2 60 | m_BakeResolution: 10 61 | m_AtlasSize: 512 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 256 79 | m_PVRBounces: 2 80 | m_PVRFilterTypeDirect: 0 81 | m_PVRFilterTypeIndirect: 0 82 | m_PVRFilterTypeAO: 0 83 | m_PVRFilteringMode: 1 84 | m_PVRCulling: 1 85 | m_PVRFilteringGaussRadiusDirect: 1 86 | m_PVRFilteringGaussRadiusIndirect: 5 87 | m_PVRFilteringGaussRadiusAO: 2 88 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 89 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 90 | m_PVRFilteringAtrousPositionSigmaAO: 1 91 | m_ShowResolutionOverlay: 1 92 | m_LightingDataAsset: {fileID: 0} 93 | m_UseShadowmask: 1 94 | --- !u!196 &4 95 | NavMeshSettings: 96 | serializedVersion: 2 97 | m_ObjectHideFlags: 0 98 | m_BuildSettings: 99 | serializedVersion: 2 100 | agentTypeID: 0 101 | agentRadius: 0.5 102 | agentHeight: 2 103 | agentSlope: 45 104 | agentClimb: 0.4 105 | ledgeDropHeight: 0 106 | maxJumpAcrossDistance: 0 107 | minRegionArea: 2 108 | manualCellSize: 0 109 | cellSize: 0.16666667 110 | manualTileSize: 0 111 | tileSize: 256 112 | accuratePlacement: 0 113 | debug: 114 | m_Flags: 0 115 | m_NavMeshData: {fileID: 0} 116 | --- !u!1 &170076733 117 | GameObject: 118 | m_ObjectHideFlags: 0 119 | m_CorrespondingSourceObject: {fileID: 0} 120 | m_PrefabInternal: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 170076735} 124 | - component: {fileID: 170076734} 125 | m_Layer: 0 126 | m_Name: Directional Light 127 | m_TagString: Untagged 128 | m_Icon: {fileID: 0} 129 | m_NavMeshLayer: 0 130 | m_StaticEditorFlags: 0 131 | m_IsActive: 1 132 | --- !u!108 &170076734 133 | Light: 134 | m_ObjectHideFlags: 0 135 | m_CorrespondingSourceObject: {fileID: 0} 136 | m_PrefabInternal: {fileID: 0} 137 | m_GameObject: {fileID: 170076733} 138 | m_Enabled: 1 139 | serializedVersion: 8 140 | m_Type: 1 141 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 142 | m_Intensity: 1 143 | m_Range: 10 144 | m_SpotAngle: 30 145 | m_CookieSize: 10 146 | m_Shadows: 147 | m_Type: 2 148 | m_Resolution: -1 149 | m_CustomResolution: -1 150 | m_Strength: 1 151 | m_Bias: 0.05 152 | m_NormalBias: 0.4 153 | m_NearPlane: 0.2 154 | m_Cookie: {fileID: 0} 155 | m_DrawHalo: 0 156 | m_Flare: {fileID: 0} 157 | m_RenderMode: 0 158 | m_CullingMask: 159 | serializedVersion: 2 160 | m_Bits: 4294967295 161 | m_Lightmapping: 1 162 | m_LightShadowCasterMode: 0 163 | m_AreaSize: {x: 1, y: 1} 164 | m_BounceIntensity: 1 165 | m_ColorTemperature: 6570 166 | m_UseColorTemperature: 0 167 | m_ShadowRadius: 0 168 | m_ShadowAngle: 0 169 | --- !u!4 &170076735 170 | Transform: 171 | m_ObjectHideFlags: 0 172 | m_CorrespondingSourceObject: {fileID: 0} 173 | m_PrefabInternal: {fileID: 0} 174 | m_GameObject: {fileID: 170076733} 175 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 176 | m_LocalPosition: {x: 0, y: 3, z: 0} 177 | m_LocalScale: {x: 1, y: 1, z: 1} 178 | m_Children: [] 179 | m_Father: {fileID: 0} 180 | m_RootOrder: 1 181 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 182 | --- !u!1 &248492438 183 | GameObject: 184 | m_ObjectHideFlags: 0 185 | m_CorrespondingSourceObject: {fileID: 0} 186 | m_PrefabInternal: {fileID: 0} 187 | serializedVersion: 6 188 | m_Component: 189 | - component: {fileID: 248492442} 190 | - component: {fileID: 248492441} 191 | - component: {fileID: 248492440} 192 | - component: {fileID: 248492439} 193 | m_Layer: 5 194 | m_Name: Canvas 195 | m_TagString: Untagged 196 | m_Icon: {fileID: 0} 197 | m_NavMeshLayer: 0 198 | m_StaticEditorFlags: 0 199 | m_IsActive: 1 200 | --- !u!114 &248492439 201 | MonoBehaviour: 202 | m_ObjectHideFlags: 0 203 | m_CorrespondingSourceObject: {fileID: 0} 204 | m_PrefabInternal: {fileID: 0} 205 | m_GameObject: {fileID: 248492438} 206 | m_Enabled: 1 207 | m_EditorHideFlags: 0 208 | m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} 209 | m_Name: 210 | m_EditorClassIdentifier: 211 | m_IgnoreReversedGraphics: 1 212 | m_BlockingObjects: 0 213 | m_BlockingMask: 214 | serializedVersion: 2 215 | m_Bits: 4294967295 216 | --- !u!114 &248492440 217 | MonoBehaviour: 218 | m_ObjectHideFlags: 0 219 | m_CorrespondingSourceObject: {fileID: 0} 220 | m_PrefabInternal: {fileID: 0} 221 | m_GameObject: {fileID: 248492438} 222 | m_Enabled: 1 223 | m_EditorHideFlags: 0 224 | m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} 225 | m_Name: 226 | m_EditorClassIdentifier: 227 | m_UiScaleMode: 0 228 | m_ReferencePixelsPerUnit: 100 229 | m_ScaleFactor: 1 230 | m_ReferenceResolution: {x: 800, y: 600} 231 | m_ScreenMatchMode: 0 232 | m_MatchWidthOrHeight: 0 233 | m_PhysicalUnit: 3 234 | m_FallbackScreenDPI: 96 235 | m_DefaultSpriteDPI: 96 236 | m_DynamicPixelsPerUnit: 1 237 | --- !u!223 &248492441 238 | Canvas: 239 | m_ObjectHideFlags: 0 240 | m_CorrespondingSourceObject: {fileID: 0} 241 | m_PrefabInternal: {fileID: 0} 242 | m_GameObject: {fileID: 248492438} 243 | m_Enabled: 1 244 | serializedVersion: 3 245 | m_RenderMode: 0 246 | m_Camera: {fileID: 0} 247 | m_PlaneDistance: 100 248 | m_PixelPerfect: 0 249 | m_ReceivesEvents: 1 250 | m_OverrideSorting: 0 251 | m_OverridePixelPerfect: 0 252 | m_SortingBucketNormalizedSize: 0 253 | m_AdditionalShaderChannelsFlag: 0 254 | m_SortingLayerID: 0 255 | m_SortingOrder: 0 256 | m_TargetDisplay: 0 257 | --- !u!224 &248492442 258 | RectTransform: 259 | m_ObjectHideFlags: 0 260 | m_CorrespondingSourceObject: {fileID: 0} 261 | m_PrefabInternal: {fileID: 0} 262 | m_GameObject: {fileID: 248492438} 263 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 264 | m_LocalPosition: {x: 0, y: 0, z: 0} 265 | m_LocalScale: {x: 0, y: 0, z: 0} 266 | m_Children: 267 | - {fileID: 1288266820} 268 | m_Father: {fileID: 0} 269 | m_RootOrder: 2 270 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 271 | m_AnchorMin: {x: 0, y: 0} 272 | m_AnchorMax: {x: 0, y: 0} 273 | m_AnchoredPosition: {x: 0, y: 0} 274 | m_SizeDelta: {x: 0, y: 0} 275 | m_Pivot: {x: 0, y: 0} 276 | --- !u!1 &249922364 277 | GameObject: 278 | m_ObjectHideFlags: 0 279 | m_CorrespondingSourceObject: {fileID: 0} 280 | m_PrefabInternal: {fileID: 0} 281 | serializedVersion: 6 282 | m_Component: 283 | - component: {fileID: 249922367} 284 | - component: {fileID: 249922366} 285 | - component: {fileID: 249922365} 286 | m_Layer: 0 287 | m_Name: EventSystem 288 | m_TagString: Untagged 289 | m_Icon: {fileID: 0} 290 | m_NavMeshLayer: 0 291 | m_StaticEditorFlags: 0 292 | m_IsActive: 1 293 | --- !u!114 &249922365 294 | MonoBehaviour: 295 | m_ObjectHideFlags: 0 296 | m_CorrespondingSourceObject: {fileID: 0} 297 | m_PrefabInternal: {fileID: 0} 298 | m_GameObject: {fileID: 249922364} 299 | m_Enabled: 1 300 | m_EditorHideFlags: 0 301 | m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3} 302 | m_Name: 303 | m_EditorClassIdentifier: 304 | m_HorizontalAxis: Horizontal 305 | m_VerticalAxis: Vertical 306 | m_SubmitButton: Submit 307 | m_CancelButton: Cancel 308 | m_InputActionsPerSecond: 10 309 | m_RepeatDelay: 0.5 310 | m_ForceModuleActive: 0 311 | --- !u!114 &249922366 312 | MonoBehaviour: 313 | m_ObjectHideFlags: 0 314 | m_CorrespondingSourceObject: {fileID: 0} 315 | m_PrefabInternal: {fileID: 0} 316 | m_GameObject: {fileID: 249922364} 317 | m_Enabled: 1 318 | m_EditorHideFlags: 0 319 | m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3} 320 | m_Name: 321 | m_EditorClassIdentifier: 322 | m_FirstSelected: {fileID: 0} 323 | m_sendNavigationEvents: 1 324 | m_DragThreshold: 10 325 | --- !u!4 &249922367 326 | Transform: 327 | m_ObjectHideFlags: 0 328 | m_CorrespondingSourceObject: {fileID: 0} 329 | m_PrefabInternal: {fileID: 0} 330 | m_GameObject: {fileID: 249922364} 331 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 332 | m_LocalPosition: {x: 0, y: 0, z: 0} 333 | m_LocalScale: {x: 1, y: 1, z: 1} 334 | m_Children: [] 335 | m_Father: {fileID: 0} 336 | m_RootOrder: 3 337 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 338 | --- !u!1 &534669902 339 | GameObject: 340 | m_ObjectHideFlags: 0 341 | m_CorrespondingSourceObject: {fileID: 0} 342 | m_PrefabInternal: {fileID: 0} 343 | serializedVersion: 6 344 | m_Component: 345 | - component: {fileID: 534669905} 346 | - component: {fileID: 534669904} 347 | - component: {fileID: 534669903} 348 | - component: {fileID: 534669906} 349 | m_Layer: 0 350 | m_Name: Main Camera 351 | m_TagString: Untagged 352 | m_Icon: {fileID: 0} 353 | m_NavMeshLayer: 0 354 | m_StaticEditorFlags: 0 355 | m_IsActive: 1 356 | --- !u!81 &534669903 357 | AudioListener: 358 | m_ObjectHideFlags: 0 359 | m_CorrespondingSourceObject: {fileID: 0} 360 | m_PrefabInternal: {fileID: 0} 361 | m_GameObject: {fileID: 534669902} 362 | m_Enabled: 1 363 | --- !u!20 &534669904 364 | Camera: 365 | m_ObjectHideFlags: 0 366 | m_CorrespondingSourceObject: {fileID: 0} 367 | m_PrefabInternal: {fileID: 0} 368 | m_GameObject: {fileID: 534669902} 369 | m_Enabled: 1 370 | serializedVersion: 2 371 | m_ClearFlags: 1 372 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 373 | m_projectionMatrixMode: 1 374 | m_SensorSize: {x: 36, y: 24} 375 | m_LensShift: {x: 0, y: 0} 376 | m_FocalLength: 50 377 | m_NormalizedViewPortRect: 378 | serializedVersion: 2 379 | x: 0 380 | y: 0 381 | width: 1 382 | height: 1 383 | near clip plane: 0.3 384 | far clip plane: 1000 385 | field of view: 60 386 | orthographic: 0 387 | orthographic size: 5 388 | m_Depth: -1 389 | m_CullingMask: 390 | serializedVersion: 2 391 | m_Bits: 4294967295 392 | m_RenderingPath: -1 393 | m_TargetTexture: {fileID: 0} 394 | m_TargetDisplay: 0 395 | m_TargetEye: 3 396 | m_HDR: 1 397 | m_AllowMSAA: 1 398 | m_AllowDynamicResolution: 0 399 | m_ForceIntoRT: 0 400 | m_OcclusionCulling: 1 401 | m_StereoConvergence: 10 402 | m_StereoSeparation: 0.022 403 | --- !u!4 &534669905 404 | Transform: 405 | m_ObjectHideFlags: 0 406 | m_CorrespondingSourceObject: {fileID: 0} 407 | m_PrefabInternal: {fileID: 0} 408 | m_GameObject: {fileID: 534669902} 409 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 410 | m_LocalPosition: {x: 0, y: 1, z: -10} 411 | m_LocalScale: {x: 1, y: 1, z: 1} 412 | m_Children: [] 413 | m_Father: {fileID: 0} 414 | m_RootOrder: 0 415 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 416 | --- !u!114 &534669906 417 | MonoBehaviour: 418 | m_ObjectHideFlags: 0 419 | m_CorrespondingSourceObject: {fileID: 0} 420 | m_PrefabInternal: {fileID: 0} 421 | m_GameObject: {fileID: 534669902} 422 | m_Enabled: 1 423 | m_EditorHideFlags: 0 424 | m_Script: {fileID: 11500000, guid: 35833644d88d2468ea0bc404a4b25d53, type: 3} 425 | m_Name: 426 | m_EditorClassIdentifier: 427 | Label: {fileID: 1288266821} 428 | --- !u!1 &1288266819 429 | GameObject: 430 | m_ObjectHideFlags: 0 431 | m_CorrespondingSourceObject: {fileID: 0} 432 | m_PrefabInternal: {fileID: 0} 433 | serializedVersion: 6 434 | m_Component: 435 | - component: {fileID: 1288266820} 436 | - component: {fileID: 1288266822} 437 | - component: {fileID: 1288266821} 438 | m_Layer: 5 439 | m_Name: Text 440 | m_TagString: Untagged 441 | m_Icon: {fileID: 0} 442 | m_NavMeshLayer: 0 443 | m_StaticEditorFlags: 0 444 | m_IsActive: 1 445 | --- !u!224 &1288266820 446 | RectTransform: 447 | m_ObjectHideFlags: 0 448 | m_CorrespondingSourceObject: {fileID: 0} 449 | m_PrefabInternal: {fileID: 0} 450 | m_GameObject: {fileID: 1288266819} 451 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 452 | m_LocalPosition: {x: 0, y: 0, z: 0} 453 | m_LocalScale: {x: 1, y: 1, z: 1} 454 | m_Children: [] 455 | m_Father: {fileID: 248492442} 456 | m_RootOrder: 0 457 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 458 | m_AnchorMin: {x: 0, y: 0} 459 | m_AnchorMax: {x: 1, y: 1} 460 | m_AnchoredPosition: {x: 0, y: 0} 461 | m_SizeDelta: {x: -20, y: -20} 462 | m_Pivot: {x: 0.5, y: 0.5} 463 | --- !u!114 &1288266821 464 | MonoBehaviour: 465 | m_ObjectHideFlags: 0 466 | m_CorrespondingSourceObject: {fileID: 0} 467 | m_PrefabInternal: {fileID: 0} 468 | m_GameObject: {fileID: 1288266819} 469 | m_Enabled: 1 470 | m_EditorHideFlags: 0 471 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 472 | m_Name: 473 | m_EditorClassIdentifier: 474 | m_Material: {fileID: 0} 475 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 476 | m_RaycastTarget: 1 477 | m_OnCullStateChanged: 478 | m_PersistentCalls: 479 | m_Calls: [] 480 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 481 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 482 | m_FontData: 483 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 484 | m_FontSize: 14 485 | m_FontStyle: 0 486 | m_BestFit: 0 487 | m_MinSize: 10 488 | m_MaxSize: 40 489 | m_Alignment: 0 490 | m_AlignByGeometry: 0 491 | m_RichText: 1 492 | m_HorizontalOverflow: 0 493 | m_VerticalOverflow: 0 494 | m_LineSpacing: 1 495 | m_Text: New Text 496 | --- !u!222 &1288266822 497 | CanvasRenderer: 498 | m_ObjectHideFlags: 0 499 | m_CorrespondingSourceObject: {fileID: 0} 500 | m_PrefabInternal: {fileID: 0} 501 | m_GameObject: {fileID: 1288266819} 502 | m_CullTransparentMesh: 0 503 | -------------------------------------------------------------------------------- /unity_project/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity_project/Assets/TestPlugin.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * For more information visit https://github.com/profelis/unity_plugin 3 | * 4 | * Copyright (c) 2018 Dmitri Granetchi 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, 10 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following 13 | * conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be 16 | * included in all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | * OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | using System; 29 | using System.Runtime.InteropServices; 30 | using System.Text; 31 | using UnityEngine; 32 | using UnityEngine.UI; 33 | 34 | public class TestPlugin : MonoBehaviour 35 | { 36 | public Text Label; 37 | 38 | #if !UNITY_EDITOR && (UNITY_IOS || UNITY_WEBGL || UNITY_WEBGL_API) 39 | const string PLUGIN_NAME = "__Internal"; 40 | #else 41 | const string PLUGIN_NAME = "unity_plugin"; 42 | #endif 43 | 44 | [DllImport(PLUGIN_NAME)] 45 | static extern int plugin_abs(int a); 46 | 47 | [DllImport(PLUGIN_NAME)] 48 | static extern int plugin_sum(int a, int b); 49 | 50 | [DllImport(PLUGIN_NAME)] 51 | static extern bool isEqualsString([MarshalAs(UnmanagedType.LPStr)] string a, [MarshalAs(UnmanagedType.LPStr)] string b); 52 | 53 | [DllImport(PLUGIN_NAME)] 54 | [return: MarshalAs(UnmanagedType.LPStr)] 55 | static extern string getString(); 56 | 57 | [DllImport(PLUGIN_NAME)] 58 | static extern void getStringTo(StringBuilder str, int strLength); 59 | 60 | [DllImport(PLUGIN_NAME)] 61 | static extern IntPtr getConstString(); 62 | 63 | [DllImport(PLUGIN_NAME)] 64 | static extern void WriteIntArray(int[] array, int length); 65 | 66 | [DllImport(PLUGIN_NAME)] 67 | static extern void WriteVector3Array(IntPtr array, int length); 68 | 69 | [DllImport(PLUGIN_NAME)] 70 | public static extern float PassVector3ByValue(Vector3 s); 71 | 72 | [DllImport(PLUGIN_NAME)] 73 | public static extern float PassVector3ByRefIn(ref Vector3 s); 74 | 75 | [DllImport(PLUGIN_NAME)] 76 | public static extern void PassVector3ByRefOut(out Vector3 s); // [Out] for classes 77 | 78 | [DllImport(PLUGIN_NAME)] 79 | public static extern void PassVector3ByRefInOut(ref Vector3 s); // [In, Out] for classes 80 | 81 | #if UNITY_EDITOR_OSX || UNITY_IOS || UNITY_STANDALONE_OSX 82 | [DllImport(PLUGIN_NAME)] 83 | static extern int objc_abs(int a); 84 | 85 | [DllImport(PLUGIN_NAME)] 86 | static extern int objc_sum(int a, int b); 87 | 88 | #if SWIFT 89 | [DllImport(PLUGIN_NAME)] 90 | static extern int swift_abs(int a); 91 | 92 | [DllImport(PLUGIN_NAME)] 93 | static extern int swift_sum(int a, int b); 94 | #endif // SWIFT 95 | 96 | #endif // UNITY_EDITOR_OSX || UNITY_IOS || UNITY_STANDALONE_OSX 97 | 98 | void Start() 99 | { 100 | var res = new StringBuilder(); 101 | res.AppendLine("Start test:"); 102 | 103 | var abs1 = plugin_abs(1); 104 | res.AppendFormat("{0} {1}", abs1, Res(abs1 == 1)); 105 | var abs2 = plugin_abs(-2); 106 | res.AppendFormat(" {0} {1}", abs2, Res(abs2 == 2)); 107 | var sum1 = plugin_sum(-4, 7); 108 | res.AppendFormat(" {0} {1}\n", sum1, Res(sum1 == 3)); 109 | var sum2 = plugin_sum(2, 2); 110 | res.AppendFormat("{0} {1}", sum2, Res(sum2 == 4)); 111 | #if UNITY_EDITOR_OSX || UNITY_IOS || UNITY_STANDALONE_OSX 112 | var abs3 = objc_abs(5); 113 | res.AppendFormat(" {0} {1}", abs3, Res(abs3 == 5)); 114 | var sum3 = objc_sum(5, 1); 115 | res.AppendFormat(" {0} {1}\n", sum3, Res(sum3 == 6)); 116 | #if SWIFT 117 | res.AppendLine("Swift tests:"); 118 | var swiftFailed = false; 119 | try 120 | { 121 | var abs4 = swift_abs(-7); 122 | res.AppendFormat("{0} {1}", abs4, Res(abs4 == 7)); 123 | var sum4 = swift_sum(1, 7); 124 | res.AppendFormat(" {0} {1}\n", sum4, Res(sum4 == 8)); 125 | } 126 | catch (Exception e) 127 | { 128 | Debug.Log(e); 129 | swiftFailed = true; 130 | res.AppendLine("swift test failed"); 131 | } 132 | if (swiftFailed) 133 | res.AppendLine("Math Test ended"); 134 | #endif // SWIFT 135 | #endif 136 | res.AppendLine("Math Test ended"); 137 | 138 | res.AppendLine("\nStart string tests:"); 139 | 140 | res.AppendFormat("equals {0} and not equals {1}\n", Res(isEqualsString("foo", "foo")), Res(!isEqualsString("foo", "FOO"))); 141 | 142 | var dynamicString = getString(); 143 | res.AppendFormat("getString returns: {0} {1}\n", dynamicString, Res(dynamicString.Equals("Dynamic string"))); 144 | 145 | var sb = new StringBuilder(200); 146 | getStringTo(sb, sb.Capacity); 147 | res.AppendFormat("StringBuilder contains {0} {1}\n", sb, Res(sb.ToString().Equals("Hello from c++"))); 148 | 149 | var constString = MarshalingCommon.PtrToAnsiString(getConstString()); 150 | res.AppendFormat("const string: {0} {1}\n", constString, Res(constString.Equals("some const string"))); 151 | 152 | res.AppendLine("String test ended"); 153 | 154 | res.AppendLine("\nArrays test start:"); 155 | 156 | var intArray = new int [3]; 157 | WriteIntArray(intArray, intArray.Length); 158 | var valid = intArray[0] == 1 && intArray[1] == 2 && intArray[2] == 3; 159 | res.AppendFormat("int array:{0}, {1}, {2} {3}\n", intArray[0], intArray[1], intArray[2], Res(valid)); 160 | 161 | var vector3Array = new Vector3 [3]; 162 | var vector3ArrayHandle = GCHandle.Alloc(vector3Array, GCHandleType.Pinned); 163 | WriteVector3Array(vector3ArrayHandle.AddrOfPinnedObject(), vector3Array.Length); 164 | res.AppendFormat("vec3 array[0]:{0} {1}\n", vector3Array[0], Res(Vector3.right.Equals(vector3Array[0]))); 165 | res.AppendFormat("vec3 array[1]:{0} {1}\n", vector3Array[1], Res(Vector3.up.Equals(vector3Array[1]))); 166 | res.AppendFormat("vec3 array[2]:{0} {1}\n", vector3Array[2], Res(Vector3.forward.Equals(vector3Array[2]))); 167 | vector3ArrayHandle.Free(); 168 | 169 | res.AppendLine("Arrays test ended"); 170 | 171 | res.AppendLine("\nStructs test start:"); 172 | var len = PassVector3ByValue(Vector3.one); 173 | res.AppendFormat("Vector3.one len: {0} {1}\n", len, Res(Mathf.Approximately(len, Vector3.one.magnitude))); 174 | 175 | var vec = Vector3.one; 176 | var len2 = PassVector3ByRefIn(ref vec); 177 | res.AppendFormat("ref Vector3.one len: {0} {1}\n", len2, Res(Mathf.Approximately(len2, Vector3.one.magnitude))); 178 | 179 | var vec2 = Vector3.zero; 180 | PassVector3ByRefOut(out vec2); 181 | res.AppendFormat("out Vector3.zero->one : {0} {1}\n", vec2, Res(Vector3.one.Equals(vec2))); 182 | 183 | var vec3 = Vector3.one; 184 | PassVector3ByRefInOut(ref vec3); 185 | res.AppendFormat("int out Vector3.one * 2 : {0} {1}\n", vec3, Res((Vector3.one * 2).Equals(vec3))); 186 | 187 | res.AppendLine("Structs test ended"); 188 | Label.text = res.ToString(); 189 | } 190 | 191 | string Res(bool res) 192 | { 193 | return res ? "Correct" : "Error"; 194 | } 195 | } -------------------------------------------------------------------------------- /unity_project/Assets/TestPlugin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35833644d88d2468ea0bc404a4b25d53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity_project/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "2.0.16", 5 | "com.unity.package-manager-ui": "1.9.11", 6 | "com.unity.purchasing": "2.0.3", 7 | "com.unity.textmeshpro": "1.2.4", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | m_EnableTextureStreamingInPlayMode: 1 23 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: c4674424e5088420c83b7b7b2d55f045 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: unity_plugin 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidBlitType: 0 67 | defaultIsNativeResolution: 1 68 | macRetinaSupport: 1 69 | runInBackground: 1 70 | captureSingleScreen: 0 71 | muteOtherAudioSources: 0 72 | Prepare IOS For Recording: 0 73 | Force IOS Speakers When Recording: 0 74 | deferSystemGesturesMode: 0 75 | hideHomeButton: 0 76 | submitAnalytics: 1 77 | usePlayerLog: 1 78 | bakeCollisionMeshes: 0 79 | forceSingleInstance: 0 80 | resizableWindow: 0 81 | useMacAppStoreValidation: 0 82 | macAppStoreCategory: public.app-category.games 83 | gpuSkinning: 1 84 | graphicsJobs: 0 85 | xboxPIXTextureCapture: 0 86 | xboxEnableAvatar: 0 87 | xboxEnableKinect: 0 88 | xboxEnableKinectAutoTracking: 0 89 | xboxEnableFitness: 0 90 | visibleInBackground: 1 91 | allowFullscreenSwitch: 1 92 | graphicsJobMode: 0 93 | fullscreenMode: 1 94 | xboxSpeechDB: 0 95 | xboxEnableHeadOrientation: 0 96 | xboxEnableGuest: 0 97 | xboxEnablePIXSampling: 0 98 | metalFramebufferOnly: 0 99 | n3dsDisableStereoscopicView: 0 100 | n3dsEnableSharedListOpt: 1 101 | n3dsEnableVSync: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOnePresentImmediateThreshold: 0 109 | switchQueueCommandMemory: 0 110 | videoMemoryForVertexBuffers: 0 111 | psp2PowerMode: 0 112 | psp2AcquireBGM: 1 113 | vulkanEnableSetSRGBWrite: 0 114 | vulkanUseSWCommandBuffers: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 0.1 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 0 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | enableVideoLayer: 0 136 | useProtectedVideoMemory: 0 137 | minimumSupportedHeadTracking: 0 138 | maximumSupportedHeadTracking: 1 139 | hololens: 140 | depthFormat: 1 141 | depthBufferSharingEnabled: 0 142 | oculus: 143 | sharedDepthBuffer: 0 144 | dashSupport: 0 145 | enable360StereoCapture: 0 146 | protectGraphicsMemory: 0 147 | useHDRDisplay: 0 148 | m_ColorGamuts: 00000000 149 | targetPixelDensity: 30 150 | resolutionScalingMode: 0 151 | androidSupportedAspectRatio: 1 152 | androidMaxAspectRatio: 2.1 153 | applicationIdentifier: 154 | Android: org.deep.unity_plugin 155 | buildNumber: {} 156 | AndroidBundleVersionCode: 1 157 | AndroidMinSdkVersion: 16 158 | AndroidTargetSdkVersion: 0 159 | AndroidPreferredInstallLocation: 1 160 | aotOptions: 161 | stripEngineCode: 1 162 | iPhoneStrippingLevel: 0 163 | iPhoneScriptCallOptimization: 0 164 | ForceInternetPermission: 0 165 | ForceSDCardPermission: 0 166 | CreateWallpaper: 0 167 | APKExpansionFiles: 0 168 | keepLoadedShadersAlive: 0 169 | StripUnusedMeshComponents: 1 170 | VertexChannelCompressionMask: 4054 171 | iPhoneSdkVersion: 988 172 | iOSTargetOSVersionString: 8.0 173 | tvOSSdkVersion: 0 174 | tvOSRequireExtendedGameController: 0 175 | tvOSTargetOSVersionString: 9.0 176 | uIPrerenderedIcon: 0 177 | uIRequiresPersistentWiFi: 0 178 | uIRequiresFullScreen: 1 179 | uIStatusBarHidden: 1 180 | uIExitOnSuspend: 0 181 | uIStatusBarStyle: 0 182 | iPhoneSplashScreen: {fileID: 0} 183 | iPhoneHighResSplashScreen: {fileID: 0} 184 | iPhoneTallHighResSplashScreen: {fileID: 0} 185 | iPhone47inSplashScreen: {fileID: 0} 186 | iPhone55inPortraitSplashScreen: {fileID: 0} 187 | iPhone55inLandscapeSplashScreen: {fileID: 0} 188 | iPhone58inPortraitSplashScreen: {fileID: 0} 189 | iPhone58inLandscapeSplashScreen: {fileID: 0} 190 | iPadPortraitSplashScreen: {fileID: 0} 191 | iPadHighResPortraitSplashScreen: {fileID: 0} 192 | iPadLandscapeSplashScreen: {fileID: 0} 193 | iPadHighResLandscapeSplashScreen: {fileID: 0} 194 | appleTVSplashScreen: {fileID: 0} 195 | appleTVSplashScreen2x: {fileID: 0} 196 | tvOSSmallIconLayers: [] 197 | tvOSSmallIconLayers2x: [] 198 | tvOSLargeIconLayers: [] 199 | tvOSLargeIconLayers2x: [] 200 | tvOSTopShelfImageLayers: [] 201 | tvOSTopShelfImageLayers2x: [] 202 | tvOSTopShelfImageWideLayers: [] 203 | tvOSTopShelfImageWideLayers2x: [] 204 | iOSLaunchScreenType: 0 205 | iOSLaunchScreenPortrait: {fileID: 0} 206 | iOSLaunchScreenLandscape: {fileID: 0} 207 | iOSLaunchScreenBackgroundColor: 208 | serializedVersion: 2 209 | rgba: 0 210 | iOSLaunchScreenFillPct: 100 211 | iOSLaunchScreenSize: 100 212 | iOSLaunchScreenCustomXibPath: 213 | iOSLaunchScreeniPadType: 0 214 | iOSLaunchScreeniPadImage: {fileID: 0} 215 | iOSLaunchScreeniPadBackgroundColor: 216 | serializedVersion: 2 217 | rgba: 0 218 | iOSLaunchScreeniPadFillPct: 100 219 | iOSLaunchScreeniPadSize: 100 220 | iOSLaunchScreeniPadCustomXibPath: 221 | iOSUseLaunchScreenStoryboard: 0 222 | iOSLaunchScreenCustomStoryboardPath: 223 | iOSDeviceRequirements: [] 224 | iOSURLSchemes: [] 225 | iOSBackgroundModes: 0 226 | iOSMetalForceHardShadows: 0 227 | metalEditorSupport: 1 228 | metalAPIValidation: 1 229 | iOSRenderExtraFrameOnPause: 0 230 | appleDeveloperTeamID: 231 | iOSManualSigningProvisioningProfileID: 232 | tvOSManualSigningProvisioningProfileID: 233 | iOSManualSigningProvisioningProfileType: 0 234 | tvOSManualSigningProvisioningProfileType: 0 235 | appleEnableAutomaticSigning: 0 236 | iOSRequireARKit: 0 237 | appleEnableProMotion: 0 238 | vulkanEditorSupport: 0 239 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 240 | templatePackageId: com.unity.3d@1.0.2 241 | templateDefaultScene: Assets/Scenes/SampleScene.unity 242 | AndroidTargetArchitectures: 5 243 | AndroidSplashScreenScale: 0 244 | androidSplashScreen: {fileID: 0} 245 | AndroidKeystoreName: 246 | AndroidKeyaliasName: 247 | AndroidBuildApkPerCpuArchitecture: 0 248 | AndroidTVCompatibility: 1 249 | AndroidIsGame: 1 250 | AndroidEnableTango: 0 251 | androidEnableBanner: 1 252 | androidUseLowAccuracyLocation: 0 253 | m_AndroidBanners: 254 | - width: 320 255 | height: 180 256 | banner: {fileID: 0} 257 | androidGamepadSupportLevel: 0 258 | resolutionDialogBanner: {fileID: 0} 259 | m_BuildTargetIcons: [] 260 | m_BuildTargetPlatformIcons: 261 | - m_BuildTarget: Android 262 | m_Icons: 263 | - m_Textures: [] 264 | m_Width: 432 265 | m_Height: 432 266 | m_Kind: 2 267 | m_SubKind: 268 | - m_Textures: [] 269 | m_Width: 324 270 | m_Height: 324 271 | m_Kind: 2 272 | m_SubKind: 273 | - m_Textures: [] 274 | m_Width: 216 275 | m_Height: 216 276 | m_Kind: 2 277 | m_SubKind: 278 | - m_Textures: [] 279 | m_Width: 162 280 | m_Height: 162 281 | m_Kind: 2 282 | m_SubKind: 283 | - m_Textures: [] 284 | m_Width: 108 285 | m_Height: 108 286 | m_Kind: 2 287 | m_SubKind: 288 | - m_Textures: [] 289 | m_Width: 81 290 | m_Height: 81 291 | m_Kind: 2 292 | m_SubKind: 293 | - m_Textures: [] 294 | m_Width: 192 295 | m_Height: 192 296 | m_Kind: 0 297 | m_SubKind: 298 | - m_Textures: [] 299 | m_Width: 144 300 | m_Height: 144 301 | m_Kind: 0 302 | m_SubKind: 303 | - m_Textures: [] 304 | m_Width: 96 305 | m_Height: 96 306 | m_Kind: 0 307 | m_SubKind: 308 | - m_Textures: [] 309 | m_Width: 72 310 | m_Height: 72 311 | m_Kind: 0 312 | m_SubKind: 313 | - m_Textures: [] 314 | m_Width: 48 315 | m_Height: 48 316 | m_Kind: 0 317 | m_SubKind: 318 | - m_Textures: [] 319 | m_Width: 36 320 | m_Height: 36 321 | m_Kind: 0 322 | m_SubKind: 323 | - m_Textures: [] 324 | m_Width: 192 325 | m_Height: 192 326 | m_Kind: 1 327 | m_SubKind: 328 | - m_Textures: [] 329 | m_Width: 144 330 | m_Height: 144 331 | m_Kind: 1 332 | m_SubKind: 333 | - m_Textures: [] 334 | m_Width: 96 335 | m_Height: 96 336 | m_Kind: 1 337 | m_SubKind: 338 | - m_Textures: [] 339 | m_Width: 72 340 | m_Height: 72 341 | m_Kind: 1 342 | m_SubKind: 343 | - m_Textures: [] 344 | m_Width: 48 345 | m_Height: 48 346 | m_Kind: 1 347 | m_SubKind: 348 | - m_Textures: [] 349 | m_Width: 36 350 | m_Height: 36 351 | m_Kind: 1 352 | m_SubKind: 353 | m_BuildTargetBatching: 354 | - m_BuildTarget: Standalone 355 | m_StaticBatching: 1 356 | m_DynamicBatching: 0 357 | - m_BuildTarget: tvOS 358 | m_StaticBatching: 1 359 | m_DynamicBatching: 0 360 | - m_BuildTarget: Android 361 | m_StaticBatching: 1 362 | m_DynamicBatching: 0 363 | - m_BuildTarget: iPhone 364 | m_StaticBatching: 1 365 | m_DynamicBatching: 0 366 | - m_BuildTarget: WebGL 367 | m_StaticBatching: 0 368 | m_DynamicBatching: 0 369 | m_BuildTargetGraphicsAPIs: 370 | - m_BuildTarget: AndroidPlayer 371 | m_APIs: 0b00000015000000 372 | m_Automatic: 1 373 | - m_BuildTarget: iOSSupport 374 | m_APIs: 10000000 375 | m_Automatic: 1 376 | - m_BuildTarget: AppleTVSupport 377 | m_APIs: 10000000 378 | m_Automatic: 0 379 | - m_BuildTarget: WebGLSupport 380 | m_APIs: 0b000000 381 | m_Automatic: 1 382 | m_BuildTargetVRSettings: 383 | - m_BuildTarget: Standalone 384 | m_Enabled: 0 385 | m_Devices: 386 | - Oculus 387 | - OpenVR 388 | m_BuildTargetEnableVuforiaSettings: [] 389 | openGLRequireES31: 0 390 | openGLRequireES31AEP: 0 391 | m_TemplateCustomTags: {} 392 | mobileMTRendering: 393 | Android: 1 394 | iPhone: 1 395 | tvOS: 1 396 | m_BuildTargetGroupLightmapEncodingQuality: [] 397 | m_BuildTargetGroupLightmapSettings: [] 398 | playModeTestRunnerEnabled: 0 399 | runPlayModeTestAsEditModeTest: 0 400 | actionOnDotNetUnhandledException: 1 401 | enableInternalProfiler: 0 402 | logObjCUncaughtExceptions: 1 403 | enableCrashReportAPI: 0 404 | cameraUsageDescription: 405 | locationUsageDescription: 406 | microphoneUsageDescription: 407 | switchNetLibKey: 408 | switchSocketMemoryPoolSize: 6144 409 | switchSocketAllocatorPoolSize: 128 410 | switchSocketConcurrencyLimit: 14 411 | switchScreenResolutionBehavior: 2 412 | switchUseCPUProfiler: 0 413 | switchApplicationID: 0x01004b9000490000 414 | switchNSODependencies: 415 | switchTitleNames_0: 416 | switchTitleNames_1: 417 | switchTitleNames_2: 418 | switchTitleNames_3: 419 | switchTitleNames_4: 420 | switchTitleNames_5: 421 | switchTitleNames_6: 422 | switchTitleNames_7: 423 | switchTitleNames_8: 424 | switchTitleNames_9: 425 | switchTitleNames_10: 426 | switchTitleNames_11: 427 | switchTitleNames_12: 428 | switchTitleNames_13: 429 | switchTitleNames_14: 430 | switchPublisherNames_0: 431 | switchPublisherNames_1: 432 | switchPublisherNames_2: 433 | switchPublisherNames_3: 434 | switchPublisherNames_4: 435 | switchPublisherNames_5: 436 | switchPublisherNames_6: 437 | switchPublisherNames_7: 438 | switchPublisherNames_8: 439 | switchPublisherNames_9: 440 | switchPublisherNames_10: 441 | switchPublisherNames_11: 442 | switchPublisherNames_12: 443 | switchPublisherNames_13: 444 | switchPublisherNames_14: 445 | switchIcons_0: {fileID: 0} 446 | switchIcons_1: {fileID: 0} 447 | switchIcons_2: {fileID: 0} 448 | switchIcons_3: {fileID: 0} 449 | switchIcons_4: {fileID: 0} 450 | switchIcons_5: {fileID: 0} 451 | switchIcons_6: {fileID: 0} 452 | switchIcons_7: {fileID: 0} 453 | switchIcons_8: {fileID: 0} 454 | switchIcons_9: {fileID: 0} 455 | switchIcons_10: {fileID: 0} 456 | switchIcons_11: {fileID: 0} 457 | switchIcons_12: {fileID: 0} 458 | switchIcons_13: {fileID: 0} 459 | switchIcons_14: {fileID: 0} 460 | switchSmallIcons_0: {fileID: 0} 461 | switchSmallIcons_1: {fileID: 0} 462 | switchSmallIcons_2: {fileID: 0} 463 | switchSmallIcons_3: {fileID: 0} 464 | switchSmallIcons_4: {fileID: 0} 465 | switchSmallIcons_5: {fileID: 0} 466 | switchSmallIcons_6: {fileID: 0} 467 | switchSmallIcons_7: {fileID: 0} 468 | switchSmallIcons_8: {fileID: 0} 469 | switchSmallIcons_9: {fileID: 0} 470 | switchSmallIcons_10: {fileID: 0} 471 | switchSmallIcons_11: {fileID: 0} 472 | switchSmallIcons_12: {fileID: 0} 473 | switchSmallIcons_13: {fileID: 0} 474 | switchSmallIcons_14: {fileID: 0} 475 | switchManualHTML: 476 | switchAccessibleURLs: 477 | switchLegalInformation: 478 | switchMainThreadStackSize: 1048576 479 | switchPresenceGroupId: 480 | switchLogoHandling: 0 481 | switchReleaseVersion: 0 482 | switchDisplayVersion: 1.0.0 483 | switchStartupUserAccount: 0 484 | switchTouchScreenUsage: 0 485 | switchSupportedLanguagesMask: 0 486 | switchLogoType: 0 487 | switchApplicationErrorCodeCategory: 488 | switchUserAccountSaveDataSize: 0 489 | switchUserAccountSaveDataJournalSize: 0 490 | switchApplicationAttribute: 0 491 | switchCardSpecSize: -1 492 | switchCardSpecClock: -1 493 | switchRatingsMask: 0 494 | switchRatingsInt_0: 0 495 | switchRatingsInt_1: 0 496 | switchRatingsInt_2: 0 497 | switchRatingsInt_3: 0 498 | switchRatingsInt_4: 0 499 | switchRatingsInt_5: 0 500 | switchRatingsInt_6: 0 501 | switchRatingsInt_7: 0 502 | switchRatingsInt_8: 0 503 | switchRatingsInt_9: 0 504 | switchRatingsInt_10: 0 505 | switchRatingsInt_11: 0 506 | switchLocalCommunicationIds_0: 507 | switchLocalCommunicationIds_1: 508 | switchLocalCommunicationIds_2: 509 | switchLocalCommunicationIds_3: 510 | switchLocalCommunicationIds_4: 511 | switchLocalCommunicationIds_5: 512 | switchLocalCommunicationIds_6: 513 | switchLocalCommunicationIds_7: 514 | switchParentalControl: 0 515 | switchAllowsScreenshot: 1 516 | switchAllowsVideoCapturing: 1 517 | switchAllowsRuntimeAddOnContentInstall: 0 518 | switchDataLossConfirmation: 0 519 | switchSupportedNpadStyles: 3 520 | switchNativeFsCacheSize: 32 521 | switchIsHoldTypeHorizontal: 0 522 | switchSupportedNpadCount: 8 523 | switchSocketConfigEnabled: 0 524 | switchTcpInitialSendBufferSize: 32 525 | switchTcpInitialReceiveBufferSize: 64 526 | switchTcpAutoSendBufferSizeMax: 256 527 | switchTcpAutoReceiveBufferSizeMax: 256 528 | switchUdpSendBufferSize: 9 529 | switchUdpReceiveBufferSize: 42 530 | switchSocketBufferEfficiency: 4 531 | switchSocketInitializeEnabled: 1 532 | switchNetworkInterfaceManagerInitializeEnabled: 1 533 | switchPlayerConnectionEnabled: 1 534 | ps4NPAgeRating: 12 535 | ps4NPTitleSecret: 536 | ps4NPTrophyPackPath: 537 | ps4ParentalLevel: 11 538 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 539 | ps4Category: 0 540 | ps4MasterVersion: 01.00 541 | ps4AppVersion: 01.00 542 | ps4AppType: 0 543 | ps4ParamSfxPath: 544 | ps4VideoOutPixelFormat: 0 545 | ps4VideoOutInitialWidth: 1920 546 | ps4VideoOutBaseModeInitialWidth: 1920 547 | ps4VideoOutReprojectionRate: 60 548 | ps4PronunciationXMLPath: 549 | ps4PronunciationSIGPath: 550 | ps4BackgroundImagePath: 551 | ps4StartupImagePath: 552 | ps4StartupImagesFolder: 553 | ps4IconImagesFolder: 554 | ps4SaveDataImagePath: 555 | ps4SdkOverride: 556 | ps4BGMPath: 557 | ps4ShareFilePath: 558 | ps4ShareOverlayImagePath: 559 | ps4PrivacyGuardImagePath: 560 | ps4NPtitleDatPath: 561 | ps4RemotePlayKeyAssignment: -1 562 | ps4RemotePlayKeyMappingDir: 563 | ps4PlayTogetherPlayerCount: 0 564 | ps4EnterButtonAssignment: 1 565 | ps4ApplicationParam1: 0 566 | ps4ApplicationParam2: 0 567 | ps4ApplicationParam3: 0 568 | ps4ApplicationParam4: 0 569 | ps4DownloadDataSize: 0 570 | ps4GarlicHeapSize: 2048 571 | ps4ProGarlicHeapSize: 2560 572 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 573 | ps4pnSessions: 1 574 | ps4pnPresence: 1 575 | ps4pnFriends: 1 576 | ps4pnGameCustomData: 1 577 | playerPrefsSupport: 0 578 | enableApplicationExit: 0 579 | restrictedAudioUsageRights: 0 580 | ps4UseResolutionFallback: 0 581 | ps4ReprojectionSupport: 0 582 | ps4UseAudio3dBackend: 0 583 | ps4SocialScreenEnabled: 0 584 | ps4ScriptOptimizationLevel: 0 585 | ps4Audio3dVirtualSpeakerCount: 14 586 | ps4attribCpuUsage: 0 587 | ps4PatchPkgPath: 588 | ps4PatchLatestPkgPath: 589 | ps4PatchChangeinfoPath: 590 | ps4PatchDayOne: 0 591 | ps4attribUserManagement: 0 592 | ps4attribMoveSupport: 0 593 | ps4attrib3DSupport: 0 594 | ps4attribShareSupport: 0 595 | ps4attribExclusiveVR: 0 596 | ps4disableAutoHideSplash: 0 597 | ps4videoRecordingFeaturesUsed: 0 598 | ps4contentSearchFeaturesUsed: 0 599 | ps4attribEyeToEyeDistanceSettingVR: 0 600 | ps4IncludedModules: [] 601 | monoEnv: 602 | psp2Splashimage: {fileID: 0} 603 | psp2NPTrophyPackPath: 604 | psp2NPSupportGBMorGJP: 0 605 | psp2NPAgeRating: 12 606 | psp2NPTitleDatPath: 607 | psp2NPCommsID: 608 | psp2NPCommunicationsID: 609 | psp2NPCommsPassphrase: 610 | psp2NPCommsSig: 611 | psp2ParamSfxPath: 612 | psp2ManualPath: 613 | psp2LiveAreaGatePath: 614 | psp2LiveAreaBackroundPath: 615 | psp2LiveAreaPath: 616 | psp2LiveAreaTrialPath: 617 | psp2PatchChangeInfoPath: 618 | psp2PatchOriginalPackage: 619 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 620 | psp2KeystoneFile: 621 | psp2MemoryExpansionMode: 0 622 | psp2DRMType: 0 623 | psp2StorageType: 0 624 | psp2MediaCapacity: 0 625 | psp2DLCConfigPath: 626 | psp2ThumbnailPath: 627 | psp2BackgroundPath: 628 | psp2SoundPath: 629 | psp2TrophyCommId: 630 | psp2TrophyPackagePath: 631 | psp2PackagedResourcesPath: 632 | psp2SaveDataQuota: 10240 633 | psp2ParentalLevel: 1 634 | psp2ShortTitle: Not Set 635 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 636 | psp2Category: 0 637 | psp2MasterVersion: 01.00 638 | psp2AppVersion: 01.00 639 | psp2TVBootMode: 0 640 | psp2EnterButtonAssignment: 2 641 | psp2TVDisableEmu: 0 642 | psp2AllowTwitterDialog: 1 643 | psp2Upgradable: 0 644 | psp2HealthWarning: 0 645 | psp2UseLibLocation: 0 646 | psp2InfoBarOnStartup: 0 647 | psp2InfoBarColor: 0 648 | psp2ScriptOptimizationLevel: 0 649 | splashScreenBackgroundSourceLandscape: {fileID: 0} 650 | splashScreenBackgroundSourcePortrait: {fileID: 0} 651 | spritePackerPolicy: 652 | webGLMemorySize: 256 653 | webGLExceptionSupport: 1 654 | webGLNameFilesAsHashes: 0 655 | webGLDataCaching: 1 656 | webGLDebugSymbols: 1 657 | webGLEmscriptenArgs: 658 | webGLModulesDirectory: 659 | webGLTemplate: APPLICATION:Default 660 | webGLAnalyzeBuildSize: 0 661 | webGLUseEmbeddedResources: 0 662 | webGLCompressionFormat: 1 663 | webGLLinkerTarget: 1 664 | scriptingDefineSymbols: {} 665 | platformArchitecture: {} 666 | scriptingBackend: {} 667 | il2cppCompilerConfiguration: {} 668 | incrementalIl2cppBuild: {} 669 | allowUnsafeCode: 0 670 | additionalIl2CppArgs: 671 | scriptingRuntimeVersion: 0 672 | apiCompatibilityLevelPerPlatform: {} 673 | m_RenderingPath: 1 674 | m_MobileRenderingPath: 1 675 | metroPackageName: Template_3D 676 | metroPackageVersion: 677 | metroCertificatePath: 678 | metroCertificatePassword: 679 | metroCertificateSubject: 680 | metroCertificateIssuer: 681 | metroCertificateNotAfter: 0000000000000000 682 | metroApplicationDescription: Template_3D 683 | wsaImages: {} 684 | metroTileShortName: 685 | metroTileShowName: 0 686 | metroMediumTileShowName: 0 687 | metroLargeTileShowName: 0 688 | metroWideTileShowName: 0 689 | metroDefaultTileSize: 1 690 | metroTileForegroundText: 2 691 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 692 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 693 | a: 1} 694 | metroSplashScreenUseBackgroundColor: 0 695 | platformCapabilities: {} 696 | metroFTAName: 697 | metroFTAFileTypes: [] 698 | metroProtocolName: 699 | metroCompilationOverrides: 1 700 | n3dsUseExtSaveData: 0 701 | n3dsCompressStaticMem: 1 702 | n3dsExtSaveDataNumber: 0x12345 703 | n3dsStackSize: 131072 704 | n3dsTargetPlatform: 2 705 | n3dsRegion: 7 706 | n3dsMediaSize: 0 707 | n3dsLogoStyle: 3 708 | n3dsTitle: GameName 709 | n3dsProductCode: 710 | n3dsApplicationId: 0xFF3FF 711 | XboxOneProductId: 712 | XboxOneUpdateKey: 713 | XboxOneSandboxId: 714 | XboxOneContentId: 715 | XboxOneTitleId: 716 | XboxOneSCId: 717 | XboxOneGameOsOverridePath: 718 | XboxOnePackagingOverridePath: 719 | XboxOneAppManifestOverridePath: 720 | XboxOneVersion: 1.0.0.0 721 | XboxOnePackageEncryption: 0 722 | XboxOnePackageUpdateGranularity: 2 723 | XboxOneDescription: 724 | XboxOneLanguage: 725 | - enus 726 | XboxOneCapability: [] 727 | XboxOneGameRating: {} 728 | XboxOneIsContentPackage: 0 729 | XboxOneEnableGPUVariability: 0 730 | XboxOneSockets: {} 731 | XboxOneSplashScreen: {fileID: 0} 732 | XboxOneAllowedProductIds: [] 733 | XboxOnePersistentLocalStorageSize: 0 734 | XboxOneXTitleMemory: 8 735 | xboxOneScriptCompiler: 0 736 | vrEditorSettings: 737 | daydream: 738 | daydreamIconForeground: {fileID: 0} 739 | daydreamIconBackground: {fileID: 0} 740 | cloudServicesEnabled: 741 | UNet: 1 742 | facebookSdkVersion: 7.9.4 743 | apiCompatibilityLevel: 2 744 | cloudProjectId: 745 | projectName: 746 | organizationId: 747 | cloudEnabled: 0 748 | enableNativePlatformBackendsForNewInputSystem: 0 749 | disableOldInputManagerSupport: 0 750 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.2.7f1 2 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /unity_project/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 1 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | --------------------------------------------------------------------------------