Ejemplo n.º 1
0
//----------------------------------------------------------------------------------------------------------------------    
    /// <inheritdoc/>
    public override void OnCreate(TimelineClip clip, TrackAsset track, TimelineClip clonedFrom) {
        
        SceneCachePlayableAsset asset = clip.asset as SceneCachePlayableAsset;
        if (null == asset) {
            Debug.LogError("[MeshSync] Asset is not a SceneCachePlayableAsset: " + clip.asset);
            return;
        }
        
        SceneCachePlayerConfig config = MeshSyncProjectSettings.GetOrCreateSettings().GetDefaultSceneCachePlayerConfig();        
        asset.SetSnapToFrame((SnapToFrame) config.TimelineSnapToFrame);

        //OnCreate() is called before the clip is assigned to the track, but we need the track for creating curves.
        clip.TryMoveToTrack(track);
                       
    }