Hello Guest

Author Topic: SystemInfo.deviceModel  (Read 5454 times)

Osteel

  • Newbie
  • *
  • Posts: 2
    • View Profile
SystemInfo.deviceModel
« on: March 13, 2015, 09:00:46 pm »
Hey Unity,

I'm working on a mobile game, and plan on purchasing and using TK2D to help with managing the x1, x2 assets, etc. However, it seems that you're still responsible for determining which of the asset collections to use which needs to be predetermined.

I found this script online:
https://github.com/CostelloNicho/Tutorials/blob/master/Tk2dResolutionSupport/Scripts/ResolutionManger.cs

It uses SystemInfo.deviceModel to determine which platform to set TK2D to.

SO, my question:

1. Does this work for Android devices as well?

2. Is there somewhere where ALL the deviceModels can be found in order to build this list?

Thanks. :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: SystemInfo.deviceModel
« Reply #1 on: March 13, 2015, 10:24:48 pm »
There are many many devices, with new ones being released daily. This isn't a good way of doing it. You can guess which assets to load based on resolution and dpi if that matters. Resolution alone will work pretty well most of the time.

Osteel

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SystemInfo.deviceModel
« Reply #2 on: March 14, 2015, 12:57:01 am »
Oh, okay. Thanks for responding!

So I suppos I would just take the Screen.width/height which will give me the screen resolution. From there, I would determine the assets to use based on the requirements from iOS/Android? (@1x, mdpi, etc.)

I'm going to purchase the plugin. Thanks!