mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-12 02:09:01 +08:00
Update Unity plug-ins
Updated Unity README.md
This commit is contained in:
parent
d83342256e
commit
f75f480d73
Binary file not shown.
Binary file not shown.
@ -3,7 +3,7 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>BuildMachineOSBuild</key>
|
<key>BuildMachineOSBuild</key>
|
||||||
<string>16G29</string>
|
<string>17D47</string>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
@ -27,17 +27,17 @@
|
|||||||
<key>DTCompiler</key>
|
<key>DTCompiler</key>
|
||||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||||
<key>DTPlatformBuild</key>
|
<key>DTPlatformBuild</key>
|
||||||
<string>8E3004b</string>
|
<string>9C40b</string>
|
||||||
<key>DTPlatformVersion</key>
|
<key>DTPlatformVersion</key>
|
||||||
<string>GM</string>
|
<string>GM</string>
|
||||||
<key>DTSDKBuild</key>
|
<key>DTSDKBuild</key>
|
||||||
<string>16E185</string>
|
<string>17C76</string>
|
||||||
<key>DTSDKName</key>
|
<key>DTSDKName</key>
|
||||||
<string>macosx10.12</string>
|
<string>macosx10.13</string>
|
||||||
<key>DTXcode</key>
|
<key>DTXcode</key>
|
||||||
<string>0833</string>
|
<string>0920</string>
|
||||||
<key>DTXcodeBuild</key>
|
<key>DTXcodeBuild</key>
|
||||||
<string>8E3004b</string>
|
<string>9C40b</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
</dict>
|
</dict>
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -66,21 +66,15 @@ C:\Users\nobody> cmake path/to/draco -G "Visual Studio 14 2015 Win64" -DBUILD_UN
|
|||||||
Android
|
Android
|
||||||
-------
|
-------
|
||||||
|
|
||||||
You should first follow the [Android Studio Project Integration](../README.md#android-studio-project-integration) to build Draco within an Android project. Then, to build the plugin for Unity, just add the following flag to build.gradle.
|
You should first follow the steps in [Android Native Builds](../README.md#native-android-builds) to build Draco for Android. Then, to build the plugin for Unity, add the following text to your cmake command line "-DBUILD_UNITY_PLUGIN=ON".
|
||||||
|
|
||||||
~~~~ bash
|
~~~~ bash
|
||||||
cppFlags "-DBUILD_UNITY_PLUGIN"
|
cmake path/to/draco -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/armv7-android-ndk-libcpp.cmake -DBUILD_UNITY_PLUGIN=ON
|
||||||
~~~~
|
|
||||||
|
|
||||||
You should be able to find the plugin library under:
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
path/to/your/project/build/intermediates/cmake/debug(or release)/obj/your_platform/libdracodec_unity.so
|
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Change file extension
|
Change file extension
|
||||||
---------------------
|
---------------------
|
||||||
Because Unity can not recognize un-native file extension, you need to change your compressed .drc file to .drc.bytes so that Unity will recognize it as binary file. For example, if you have file `bunny.drc` then change the file name to `bunny.drc.bytes`.
|
Because Unity can only recognize file extensions known to Unity, you need to change your compressed .drc file to .bytes so that Unity will recognize it as a binary file. For example, if you have file `bunny.drc` then change the file name to `bunny.bytes`.
|
||||||
|
|
||||||
Copy Library to Your Project
|
Copy Library to Your Project
|
||||||
----------------------------
|
----------------------------
|
||||||
@ -110,20 +104,15 @@ Copy the scripts in this folder to your project.
|
|||||||
Copy wrapper:
|
Copy wrapper:
|
||||||
|
|
||||||
~~~~ bash
|
~~~~ bash
|
||||||
|
cp DracoDecodingObject.cs path/to/your/Unity/Project/Assets/
|
||||||
cp DracoMeshLoader.cs path/to/your/Unity/Project/Assets/
|
cp DracoMeshLoader.cs path/to/your/Unity/Project/Assets/
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
Copy extened AssetPostProcessor which enables loading (This file is only used for import Draco files):
|
|
||||||
|
|
||||||
~~~~ bash
|
|
||||||
cp DracoFileImporter.cs path/to/your/Unity/Project/Assets/Editor/
|
|
||||||
~~~~
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Load Draco Assets in Runtime
|
Load Draco Assets in Runtime
|
||||||
============================
|
============================
|
||||||
For example, please see [DracoDecodingObject.cs](DracoDecodingObject.cs) for usage. To start, you can create an empty GameObject and attach this script to it.
|
For example, please see [DracoDecodingObject.cs](DracoDecodingObject.cs) for usage. To start, you can create an empty GameObject and attach this script to it. [DracoDecodingObject.cs](DracoDecodingObject.cs) will load `bunny.bytes` by default.
|
||||||
|
|
||||||
Enable Library in Script Debugging
|
Enable Library in Script Debugging
|
||||||
----------------------------------
|
----------------------------------
|
||||||
@ -134,8 +123,14 @@ If you have library for the platform you are working on, e.g. `dracodec_unity.bu
|
|||||||
Import Compressed Draco Assets
|
Import Compressed Draco Assets
|
||||||
==============================
|
==============================
|
||||||
In this section we will describe how to import Draco files (.drc) to Unity as
|
In this section we will describe how to import Draco files (.drc) to Unity as
|
||||||
other 3D formats in design time, e.g. obj, fbx.
|
other 3D formats at design time, e.g. obj, fbx.
|
||||||
To note that importing Draco files doesn't mean the Unity project will export Draco files as models. It will not save space when exported to package.
|
Note that importing Draco files doesn't mean the Unity project will export models as Draco files.
|
||||||
|
|
||||||
|
Copy [DracoFileImporter.cs](Editor/DracoFileImporter.cs) which enables loading (This file is only used for import Draco files):
|
||||||
|
|
||||||
|
~~~~ bash
|
||||||
|
cp DracoFileImporter.cs path/to/your/Unity/Project/Assets/Editor/
|
||||||
|
~~~~
|
||||||
|
|
||||||
If you have followed the previous steps, you just need to copy your asset, e.g. `bunny.drc.bytes`, to `Your/Unity/Project/Assets/Resources`, the project will automatically load the file and add the models to the project.
|
If you have followed the previous steps, you just need to copy your asset, e.g. `bunny.drc.bytes`, to `Your/Unity/Project/Assets/Resources`, the project will automatically load the file and add the models to the project.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user