Search Unity

Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.Texture'

Discussion in 'Localization Tools' started by NKCSS, May 15, 2020.

  1. NKCSS

    NKCSS

    Joined:
    Aug 29, 2015
    Posts:
    19
    When I set up a 'Raw Image' with a 'Localize Texture' component, I get the error below:

    Code (csharp):
    1. ArgumentException: Object of type 'UnityEngine.Object' cannot be converted to type 'UnityEngine.Texture'.
    2. System.RuntimeType.CheckValue (System.Object value, System.Reflection.Binder binder, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <437ba245d8404784b9fbab9b439ac908>:0)
    3. System.Reflection.MonoMethod.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <437ba245d8404784b9fbab9b439ac908>:0)
    4. System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    5. System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
    6. System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    7. UnityEngine.Events.PersistentCall.GetObjectCall (UnityEngine.Object target, System.Reflection.MethodInfo method, UnityEngine.Events.ArgumentCache arguments) (at <d815b7efac424eeb8e053965cccb1f98>:0)
    8. UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) (at <d815b7efac424eeb8e053965cccb1f98>:0)
    9. UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) (at <d815b7efac424eeb8e053965cccb1f98>:0)
    10. UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () (at <d815b7efac424eeb8e053965cccb1f98>:0)
    11. UnityEngine.Events.UnityEventBase.PrepareInvoke () (at <d815b7efac424eeb8e053965cccb1f98>:0)
    12. UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <d815b7efac424eeb8e053965cccb1f98>:0)
    13. UnityEngine.Localization.Components.LocalizedAssetBehaviourEvent`3[TObject,TReference,TEvent].UpdateAsset (TObject localizedAsset) (at Library/PackageCache/com.unity.localization@0.6.1-preview/Runtime/Component Localizers/LocalizedAssetBehaviour.cs:78)
    14. UnityEngine.Localization.LocalizedAsset`1[TObject].AutomaticLoadingCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] loadOperation) (at Library/PackageCache/com.unity.localization@0.6.1-preview/Runtime/Localized Reference/LocalizedAssetReference.cs:103)
    15. DelegateList`1[T].Invoke (T res) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    16. UnityEngine.Debug:LogException(Exception)
    17. DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:73)
    18. UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1:OnWrappedCompleted(AsyncOperationHandle`1)
    19. DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelegateList.cs:69)
    20. UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate() (at Library/PackageCache/com.unity.addressables@1.5.1/Runtime/ResourceManager/Util/DelayedActionManager.cs:169)
    21.  
    upload_2020-5-15_21-51-16.png
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Hi,
    Could you please file a bug report so I can take a look into it?
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Are these images textures or sprites?