Results 1 to 7 of 7

Thread: How to Hack Unity 3d

  1. #1
    Join Date
    Feb 2011
    Location
    new york state
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Wink How to Hack Unity 3d

    This is going to be a small tutorial on how I hack away at Unity 3d.
    Before reading this I must say that there are many ways to skin a cat. Meaning that I am sure that there are other ways of doing this but , that being said this is how I do it.

    Things that you are going to need
    some C++
    Qt Creator

    This is the C++ /qt / Awesome IDE that I will be using for this tutorial. You can install it via sotware center or
    Code:
    sudo apt-get install qtcreator
    Next we are going to need all of Unity's and Nux's dependency's
    so

    Code:
    sudo apt-get build-dep unity && sudo apt-get build-dep nux
    It is imorant that I mention that I am going to be building this out of the directory
    Code:
    ~/Desktop
    so
    Code:
    cd ~/Desktop
    Next we need The source code for Unity its self there are a couple of ways of doing this. I just say gather with apt
    make sure you are still located at ~/Desktop
    Code:
    apt-get source unity
    Once that is downloaded you should get a folder That is like this.
    Code:
    unity-6.2.0+bzr2635ubuntu0+762

    Now lets make are build dir so in terminal
    Code:
    mkdir ~/Desktop/unity-6.2.0+bzr2635ubuntu0+762-build
    make sure that it is the same name so if you source code of unity is

    Code:
    unity-6.2.0+bzr2622ubuntu0+762
    make sure that it is

    Code:
    unity-6.2.0+bzr2622ubuntu0+762-build

    Now it is time too open qtcreator

    Once qtcreator is open go to

    File-->Open FIle or Project

    then open

    ~/Desktop/unity-6.2.0+bzr2635ubuntu0+762/CMakeList.txt






    You should get a screen that looks like this






    Make sure that you add the -build on at the end if it is not there already. Then press Next

    Next you will get the Cmake options for now sense we are going to be building to are unity-6.2.0+bzr2635ubuntu0+762-build. we do not have to add any arguments. So just press Run Cmake.
    after cmake runs just press the Finish button.






    If you are getting errors make sure that you ran the build-deps above.


    All right Now it is time to start Hacking away at unity.
    for purposes of this tutorial I am only going to get into changing a icon size at the bottom of the dash.(your lens icons)

    to do this we go to dash-->LensBarIcon.cpp

    Lines 33 and 34 might look like this.
    Code:
    const int FOCUS_OVERLAY_HEIGHT = 44;
    const int FOCUS_OVERLAY_WIDTH = 60;
    Lets make them look like this

    Code:
    const int FOCUS_OVERLAY_HEIGHT = 64;
    const int FOCUS_OVERLAY_WIDTH = 64;
    then go down to line 41 it should look like this

    Code:
     : IconTexture(icon_hint, 24)
    Lets change that to
    Code:
     : IconTexture(icon_hint, 48)







    Now lets save are work. (ctrl+s) or go to File->Save

    Now this next part is only included with Unity 6.2 and up.

    we go to the thing that looks like a monitor that is above the green arrow then we set are running point to be

    Unity-Standalone









    then we press the run button or press ctrl+r and we wait for it to build. Once it is build it will launch Unity-Standalone



    Now that you have previewed your changes you can go back to qtcreator and stop it from Running







    Once you like whatt you got and you want to replace the stock Unity with what you have just built
    remove old unity.
    Code:
    sudo apt-get remove unity
    and back in qtcreator
    Go to Build-->Run Cmake and this time in the option's add
    Code:
    -DCMAKE_INSTALL_PREFIX:PATH=/usr
    and Click Run Cmake. after that runs. It is now Build your unity .
    press ctrl+b and it will build your unity.
    then in the terminal go to

    Code:
    cd ~/Desktop/unity-6.2.0+bzr2635ubuntu0+762-build
    then run
    Code:
    sudo make install

    reboot and enjoy your new Unity. Hope you enjoyed reading this.
    Attached Images Attached Images
    Last edited by josephmills; August 29th, 2012 at 06:51 PM. Reason: adding picture and making pretty
    Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men, even when they exercise influence and not authority

  2. #2
    Join Date
    Feb 2012
    Location
    Athens, Alabama
    Beans
    630
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to Hack Unity 3d

    Good job! I enjoyed reading this and will be attempting it in the future!

  3. #3
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: How to Hack Unity 3d

    Two things:

    Code:
    bzr branch lp:unity
    will get the most up-to-date revision in the upstream source.

    You shouldn't have to "remove old unity" - simply overwriting the files should work great.

    Other than, great. I'm looking forward to it.

  4. #4
    Join Date
    Apr 2006
    Beans
    996
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to Hack Unity 3d

    Code:
    sudo checkinstall
    Might be better, as you will be able to remove the package to uninstall it.

    --
    Howto needs before and after pics.

    Actually, making those icons larger seems like a good idea. May try to follow this tutorial to make it a configurable option.
    Last edited by vexorian; September 22nd, 2012 at 10:58 PM.
    Xye incredibly difficult puzzle game with minimal graphics. Also at playdeb
    Got a blog: Will Stay Free

  5. #5
    Join Date
    Feb 2009
    Location
    Boone, NC
    Beans
    517
    Distro
    Ubuntu Studio 11.10 Oneiric Ocelot

    Re: How to Hack Unity 3d

    Is it possible to change the position of the unity dock through various edits in the QT editor?
    "Be who you are and say what you feel because those that mind don't matter and those that matter don't mind."
    Ubuntu Registered User #29486

  6. #6
    Join Date
    Feb 2009
    Location
    Boone, NC
    Beans
    517
    Distro
    Ubuntu Studio 11.10 Oneiric Ocelot

    Re: How to Hack Unity 3d

    It's okay if there isn't currently. I was just asking. Great tutorial, btw OP. If such fields don't exist in the code, I may have to add the methods and method calls in myself to accomplish this. Knowing the inner workings of Unity will help me to create a version of it that can be placed on the bottom of the screen again - like what was done back in Ubuntu 11.04 and 11.10.
    "Be who you are and say what you feel because those that mind don't matter and those that matter don't mind."
    Ubuntu Registered User #29486

  7. #7
    Join Date
    Feb 2009
    Location
    Boone, NC
    Beans
    517
    Distro
    Ubuntu Studio 11.10 Oneiric Ocelot

    Re: How to Hack Unity 3d

    Bump.
    "Be who you are and say what you feel because those that mind don't matter and those that matter don't mind."
    Ubuntu Registered User #29486

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •