Search Unity

[WSA] Exceptions in WinRTBridge.winmd and UnityEngineProxy.ni.DLL

Discussion in 'Windows' started by Qbit86, Mar 29, 2016.

  1. lilichao

    lilichao

    Joined:
    Sep 27, 2016
    Posts:
    3
    I have the same problem,you know.When I start the DoTween looped animation script,this issue would appear.Is there anybody who can help me ? please ,thank you!!
     

    Attached Files:

  2. ldy105cn

    ldy105cn

    Joined:
    Sep 27, 2016
    Posts:
    1
    i got the same problem, debug and release mode is ok, when master mode, it crash when running DoTween looped animation, WinRTBridge Utils ThrowNewNullReferenceExceptione
     
  3. lilichao

    lilichao

    Joined:
    Sep 27, 2016
    Posts:
    3
     

    Attached Files:

  4. lilichao

    lilichao

    Joined:
    Sep 27, 2016
    Posts:
    3
    thie error code line.
     

    Attached Files:

  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,920
    This is a known issue, while we're working on it, it's not clear when the fix will land.

    We also contacted the author of DoTween regarding this problem, he's also working on it as far as I know.

    Here's the workaround you could do.
    * Clone DoTween - https://github.com/Demigiant/dotween
    * In this package code, some logic depends on the thrown exception, particular issue above rises when exception is thrown by Unity native part instead of C# code, thus to fix this, you need to ensure that exceptions are throw in C# instead of native part.
    For ex.,

    In _dotween.assembly\dotween\shortcutextensions.cs
    create a function
    Code (csharp):
    1.  
    2. private static Transform ValidateTransform(Transform target)
    3.             {
    4.                     if (target == null)
    5.                             throw new System.NullReferenceException();
    6.                         return target;
    7.             }
    8.  
    Change places where transform property is being accessed, for ex.,

    Code (csharp):
    1.  
    2.         public static Tweener DOLocalMoveY(this Transform target, float endValue, float duration, bool snapping = false)
    3.         {
    4.             return DOTween.To(() => target.localPosition, x => target.localPosition = x, new Vector3(0, endValue, 0), duration)
    5.                 .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
    6.         }
    7.  
    change to

    Code (csharp):
    1.  
    2. public static Tweener DOLocalMoveY(this Transform target, float endValue, float duration, bool snapping = false)
    3.                 {
    4.             return DOTween.To(() => ValidateTransform(target).localPosition, x => ValidateTransform(target).localPosition = x, new Vector3(0, endValue, 0), duration)
    5.                 .SetOptions(AxisConstraint.Y, snapping).SetTarget(ValidateTransform(target));
    6.         }
    7.  
    8.  
    this will ensure that NullReferenceException is thrown by C# when target is null.

    Hope that helps.