Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: LanguageSource Inspector Assets auto destroy

LanguageSource Inspector Assets auto destroy 5 months 4 days ago #3035

  • yuewah
  • yuewah's Avatar
  • Offline
  • Junior Member
  • Posts: 26
  • Karma: 0
In v2.8.6 f2, If LanguageSource.Assets is added during runtime, when select the Assets Tab in inspector, the object will auto destroy one by one until empty.
The administrator has disabled public write access.

LanguageSource Inspector Assets auto destroy 5 months 4 days ago #3036

  • yuewah
  • yuewah's Avatar
  • Offline
  • Junior Member
  • Posts: 26
  • Karma: 0
I find that it is because LanguageSource.Assets is added by loading asset in Resources folder.
However, In LocalizationEditor.cs
GUITools.DrawObjectsArray( mProp_Assets, false, false, false, testAddObj, testReplaceObj, testReplaceIndx, testDeleteIndx);

Since allowResources is false, so it will auto destroy.
The administrator has disabled public write access.

LanguageSource Inspector Assets auto destroy 5 months 3 days ago #3041

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
Hi,
The problem is that LanguageSource.Assets shouldn't contain any asset from Resources.
The idea of that array is that it includes references to those assets that the plugin can't load at runtime because they are not in the Resources folder.
If you need to add assets (sprites, fonts, etc) from the resources folder, just add the path+name to the translation.

For example:
Term: "MY_FONT", English: "Arial", Spanish:"CustomFonts/Comic"

That will automatically load the Arial font from "Resources/Arial" when in English, and the "Resources/CustomFonts/Comic" when in spanish.
However, if "Arial" is not found in a Resources folder, then the plugin will look for it in the Assets array.

More details here: inter-illusion.com/assets/I2LocalizationManual/AssetsTab.html

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
Last Edit: 5 months 3 days ago by Frank.
The administrator has disabled public write access.

LanguageSource Inspector Assets auto destroy 5 months 3 days ago #3042

  • yuewah
  • yuewah's Avatar
  • Offline
  • Junior Member
  • Posts: 26
  • Karma: 0
But I would like to preload all font and material assets during app startup. I tried I2.Loc.ResourceManager, but it doesn't have Addsset( Object Obj ) like LanguageSource
The administrator has disabled public write access.

LanguageSource Inspector Assets auto destroy 5 months 3 days ago #3043

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
You can do:
ResourceManager.pInstance.GetAsset<Font>("Custom Fonts/Comic");

That will load the font if it's not already loaded and save it into the mResourcesCache dictionary so that any time the plugin needs to request that font, it will get it from there.
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.

LanguageSource Inspector Assets auto destroy 5 months 2 days ago #3045

  • yuewah
  • yuewah's Avatar
  • Offline
  • Junior Member
  • Posts: 26
  • Karma: 0
we need to load all font assets in resources folders, however, there are no method to get all font assets name in the resources folder.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.223 seconds
Colors