Exemplo n.º 1
0
        public GameObject GenerateUnityObject(SymbolData symbol, Context ctx)
        {
            if (symbol.Playables.Count == 0)
            {
                return(null);
            }

            int frameStart  = symbol.GetLocalTrimStart(ctx.fps);
            int frameEnd    = symbol.GetLocalTrimEnd(ctx.fps);
            int frameLength = frameEnd - frameStart;

            if (ctx.parentTransform == ctx.rootTransform)
            {
                frameStart  = 0;
                frameLength = stage.timelineLength;
            }

            var symbolObj = MakePlayableBaseObject(symbol, ref ctx, frameStart / ctx.fps, frameLength / ctx.fps);

            ctx.frameOffset = symbol.AbsoluteTimeOffset - frameStart;
            foreach (var playbale in symbol.Playables)
            {
                if (playbale.isVisible)
                {
                    GenerateUnityObject(playbale, ctx);
                }
            }

            return(symbolObj);
        }