Ejemplo n.º 1
0
    public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
    {
        var             director = owner.GetComponent <PlayableDirector>();
        Transform       tf       = ExternalHelp.FetchAttachOfTrack(director, track);
        AnchorBehaviour beha     = new AnchorBehaviour();

        beha.Set(clip_pos, clip_rot, tf, director);
        return(ScriptPlayable <AnchorBehaviour> .Create(graph, beha));
    }
Ejemplo n.º 2
0
    public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
    {
        var        director = owner.GetComponent <PlayableDirector>();
        var        binding  = director.GetGenericBinding(track);
        GameObject go       = null;

        if (binding is Animator)
        {
            go = (binding as Animator).gameObject;
        }
        else if (binding is Animation)
        {
            go = (binding as Animation).gameObject;
        }
        AnchorBehaviour beha = new AnchorBehaviour();

        beha.Set(clip_pos, clip_rot, go);
        return(ScriptPlayable <AnchorBehaviour> .Create(graph, beha));
    }