Author Topic: UI Architecture - How to reduct asset duplication?  (Read 2189 times)

0xbdf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
UI Architecture - How to reduct asset duplication?
« on: February 15, 2014, 06:48:53 PM »
Hey everyone!

In our game, we are using 2 UI plugins: NGUI and 2D Toolkit. Our gameplay scene uses both: NGUI for the UI/HUD (because NGUI), and 2D Toolkit for the gameplay (because performance with animations). Now, we have some assets that are used in both the UI and the Gameplay elements of that scene, and this results in a fair bit of asset duplication (between NGUI's Atlases and 2D Toolkit's Sprite Collections), which is going to grow steadily through the course of the project.

We want to stop duplicating these assets. Will you help me figure out how?

Some options we see:
  • Stop using 2d Toolkit, and see what kind of performance hit we take for animating things in NGUI. Is there anything concrete to be known about NGUI's performance with animations, scaling, moving objects, etc?
  • Build everything out of 2D Toolkit , and give up NGUI's anchoring system and other amazing features. We'd rather avoid this.
  • Find a design solution around this. Use separate and smaller assets within the gameplay, eg.

Our thinking is that we can't be the only people that have run into this. What's been tried before, what's worked, what's possible that we're missing?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Architecture - How to reduct asset duplication?
« Reply #1 on: February 16, 2014, 02:49:58 AM »
You can use UITexture to draw just about any texture in NGUI without having to add it to an atlas. This would include what 2D toolkit uses. You can also take this one step further and create a custom widget type that pulls its data from whatever the 2D toolkit uses. This way you would have an NGUI widget using a 2D tookit's sprite. Have a look at UITexture's source code for an example. It's a pretty short class. The important function to look at is the OnFill function.