Ejemplo n.º 1
0
        protected internal virtual Playable CreatePlayable(PlayableGraph graph, GameObject go, TimelineClip clip)
        {
            IPlayableAsset playableAsset = clip.asset as IPlayableAsset;
            Playable       result;

            if (playableAsset != null)
            {
                Playable playable = playableAsset.CreatePlayable(graph, go);
                if (playable.IsValid <Playable>())
                {
                    playable.SetAnimatedProperties(clip.curves);
                    playable.SetSpeed(clip.timeScale);
                }
                result = playable;
            }
            else
            {
                result = Playable.Null;
            }
            return(result);
        }
    public static int CreatePlayable(IntPtr l)
    {
        int result;

        try
        {
            IPlayableAsset playableAsset = (IPlayableAsset)LuaObject.checkSelf(l);
            PlayableGraph  graph;
            LuaObject.checkValueType <PlayableGraph>(l, 2, out graph);
            GameObject owner;
            LuaObject.checkType <GameObject>(l, 3, out owner);
            Playable playable = playableAsset.CreatePlayable(graph, owner);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, playable);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }