Skip to content

Commit

Permalink
Fix problem for binding game object
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian-Jiang committed May 21, 2023
1 parent 8ed4763 commit 7279926
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Runtime/TimelinePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ public void SaveTimeline() {
foreach (var binding in outputs) {
if (binding.outputTargetType == null) continue;

var bindingObject = (Component) Director.GetGenericBinding(track);
if (bindingObject.transform.IsChildOf(transform)) continue;
var bindingObject = Director.GetGenericBinding(track);
if (bindingObject is Component component && component.transform.IsChildOf(transform) ||
bindingObject is GameObject go && go.transform.IsChildOf(transform)) continue;

var trackBindInfo = new TrackBindInfo {
trackAsset = track,
Expand Down

0 comments on commit 7279926

Please sign in to comment.