Unity-Source-Code
Jan 15

Elements related to Unity source code

By: Anna Louise

License is an important factor related to Unity Source Code. It is also pointless when you’re not a developer or programmer. All these things gives you access to dirty innards of engine (Unity source code). If you they want to make a lot of amendments to engine. But, folks such as you and I only dabble with coding will never need to mess with it. Actually, chances are that for ideas, you can access source code.

Building Unity from Source Code

In this article, you can build another version of ‘Unity trunk’ (locally installed in your home directory), thus, you shouldn’t worry about corrupting the version from repositories and you must not worry to get permission in whole process, except for installing the dependencies.

Installing build dependencies

You must run this once to install all basic build dependencies:

‘sudo apt-get install bzr cmake compiz-dev gnome-common ibbamf3-dev libboost-dev \’
‘libboost-serialization-dev libgconf2-dev libgdu-dev libglewmx1.6-dev \’
‘libgnome-desktop-3-dev libibus-1.0-dev libindicator3-dev libjson-glib-dev \’
‘libnotify-dev libnux-2.0-dev libpci-dev libsigc++-2.0-dev libunity-dev \’
‘libunity-misc-dev libutouch-geis-dev libxxf86vm-dev libzeitgeist-dev xsltproc’

Now you need to enable source code repositories (aka deb-src), you may instead use:

‘sudo apt-get build-dep unity’

Preparing the environment

Replace PREFIX & SOURCE with these directories you will accept the source and create files to go. We’ve mentioned below to explain:

‘export SOURCE=$HOME/source/unity’
‘export PREFIX=$HOME/build/unity’
‘export PKG_CONFIG_PATH=”$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH”’
‘export LD_LIBRARY_PATH=”$PREFIX/lib:$LD_LIBRARY_PATH”’
‘export LD_RUN_PATH=”$PREFIX/lib:$LD_RUN_PATH”’‘export XDG_DATA_DIRS=”$PREFIX/share:$XDG_DATA_DIRS”’ ‘mkdir -p “$PREFIX”’
‘mkdir -p “$SOURCE”’
‘cd “$SOURCE”’

Building Nux

You shoukd grab the updated or new version of Nux to get Unity trunk to compile:

‘bzr branch lp:nux’
‘cd nux’
‘./autogen.sh –disable-examples –disable-gputests –disable-‘tests –prefix=”$PREFIX”
‘make -j4’
‘make install’
‘cd ..’

Latest laptops and modern desktops have different cores. You may speed up the compilation by taking benefits of this. Now make command have developed support for this that you can stimulate with -jN switch where ‘N’ is the number of jobs to run it in parallel position. A proper rule of thumb is to run it twice & the number of cores on processor. Therefore, in a standard dual core desktop computer you have to run ‘make’ -j4 to reduce the compilation time.

Building Unity

Now grab the latest Unity code and create it:

‘bzr branch lp:unity’
‘cd unity’
‘mkdir build’
‘cd build’
‘cmake .. -DCMAKE_BUILD_TYPE=Debug –‘DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DGSETTINGS_LOCALINSTALL=ON –‘DCMAKE_INSTALL_PREFIX=”$PREFIX”
‘Make -j4‘make install

No its end so, log-out and back-in again, you must run the latest Unity. Instead, you can run

setsid $PREFIX/bin/unity

Updating on regular basis

Remember you have to prepare the whole setup and environment like explained in step 1, then enter both top level directories ‘nux’ and ‘unity’, run ‘bzr pull’, re-build, and re-install. I suggest recreating and removing the build directory as  unity, to remember, no old files are missing with build.

Removing Unity

Eliminate or Remove the 3 directories $SOURCE, ~/.compiz-1 & $PREFIX.

Finding Files

If you’ve Unity 3D game then you can access its folder, search it in library and open its properties. Browse files and open them. If game is compiled for 3D and Windows then it must be packed in proper way.

Responses