Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Exposed Reference Bug

Discussion in 'Timeline' started by C10110, Apr 21, 2017.

  1. C10110

    C10110

    Joined:
    Jan 19, 2013
    Posts:
    58
    Hello,

    Really enjoying the new features! Timeline looks very promising!! I am having a little bit of trouble with exposed references though.

    In the picture below, you can see the text variable says 'none' I know you can't tell in the picture, but even when I drag and drop the referenced text, it doesn't want to add the updated variable. It seams to work consistently when restarting Unity. But when you press play (and then stop), it goes back to 'none' and the problem persists.



    Here is the code we are using, please let me know if any of it is amiss!


    Code (CSharp):
    1. using UnityEngine.Playables;
    2. using UnityEngine.Timeline;
    3. using UnityEngine.UI;
    4. using DG.Tweening;
    5.  
    6. public class ConversationPlayable : BasicScriptPlayable
    7. {
    8.  
    9.     public string dialogueText;
    10.  
    11.     public float textAnimationTime = 1;
    12.  
    13.     //private new Transform transform;
    14.  
    15.     private Tweener textTween;
    16.  
    17.     public ExposedReference<Text> text;
    18.  
    19.     private Text _text;
    20.  
    21.  
    22.     public override void OnGraphStart()
    23.     {
    24.         Debug.Log("Graph start");
    25.         _text = text.Resolve(handle.graph.resolver);
    26.     }
    27.  
    28.     public override void OnGraphStop()
    29.     {
    30.    
    31.     }
    32.  
    33.     public override void PrepareFrame(FrameData info)
    34.     {
    35.      
    36.     }
    37.  
    38.     public override void ProcessFrame(FrameData info, object playerData)
    39.     {
    40.      
    41.     }
    42.  
    43.     public override void OnPlayStateChanged(FrameData info, PlayState newState)
    44.     {
    45.         bool state = newState == PlayState.Playing;
    46.         Debug.Log(state);
    47.  
    48.         if (state == true)
    49.         {
    50.             textTween = _text.DOText(dialogueText, textAnimationTime).Play().SetAutoKill(false);
    51.         }
    52.  
    53.         else if (state == false)
    54.         {
    55.             textTween.PlayBackwards();
    56.             textTween.SetAutoKill(true);
    57.         }
    58.  
    59.         if (newState == PlayState.Paused)
    60.         {
    61.  
    62.         }
    63.  

    Thank you for any help! I look forward to hearing some thoughts!

    EDIT: This is the error I get when I try to drag a reference onto an exposed reference variable.

     
    Last edited: Apr 21, 2017
  2. thierry_unity

    thierry_unity

    Joined:
    Jun 10, 2015
    Posts:
    187
    Hi,
    Unfortunately B1 was missing a lot of bugfixes. Just jumping on B2 or more recent beta should fix that problem.
    Thanks for the report!
     
  3. C10110

    C10110

    Joined:
    Jan 19, 2013
    Posts:
    58
    Hey, Thierry!!

    I am currently on B10 and am using the latest examples package to test Timeline. I still can not drag game objects into the exposed reference variable. I am using the LerpToMove example scene, all unmodified, and just can't get it to work, with the demo, or making my own version.

    Thanks for the help!