GameToolkit-Localization icon indicating copy to clipboard operation
GameToolkit-Localization copied to clipboard

Cannot set property of custom MonoBehaviours

Open rstecca opened this issue 4 years ago • 1 comments

In my case I have a LocalizedVideoClip which I would love to be able to use to set a public VideoClip property of a MonoBehaviour class but it seems to only be able to find the VideoClip property of a VideoPlayer component. All properties of my own classes, even though they have a compatible type, are completely ignored. Is this how it's supposed to work?

At the moment I'm using a workaround based on this method:

VideoClip videoClip;
GameToolkit.Localization.LocalizedVideoClip lvc =
            Resources.Load<GameToolkit.Localization.LocalizedVideoClip>(_localizedResourcePath);
lvc.TryGetLocaleValue(Localization.Instance.CurrentLanguage, out videoClip);

which works but it would be great to also have the option to point to any public variables (of matching type) from LocalizedAsset<T>'s editor. Not sure if this is feasible.

Thanks for this Localization asset and for looking into this.

rstecca avatar Jan 27 '21 14:01 rstecca

Hi can you send me an example?

ibrahimpenekli avatar May 05 '21 16:05 ibrahimpenekli