Esempio n. 1
0
            public static PlayableBehaviour GetTrackMixer(PlayableGraph graph, TrackAsset track, Type type)
            {
                int rootCount = graph.GetRootPlayableCount();

                for (int i = 0; i < rootCount; i++)
                {
                    Playable root = graph.GetRootPlayable(i);

                    PlayableBehaviour trackMixer = GetTrackMixer(root, track, type);

                    if (trackMixer != null)
                    {
                        return(trackMixer);
                    }
                }

                return(null);
            }
Esempio n. 2
0
    public static int OnPlayableDestroy(IntPtr l)
    {
        int result;

        try
        {
            PlayableBehaviour playableBehaviour = (PlayableBehaviour)LuaObject.checkSelf(l);
            Playable          playable;
            LuaObject.checkValueType <Playable>(l, 2, out playable);
            playableBehaviour.OnPlayableDestroy(playable);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Esempio n. 3
0
    public static int PrepareFrame(IntPtr l)
    {
        int result;

        try
        {
            PlayableBehaviour playableBehaviour = (PlayableBehaviour)LuaObject.checkSelf(l);
            Playable          playable;
            LuaObject.checkValueType <Playable>(l, 2, out playable);
            FrameData info;
            LuaObject.checkValueType <FrameData>(l, 3, out info);
            playableBehaviour.PrepareFrame(playable, info);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Esempio n. 4
0
            private static PlayableBehaviour GetTrackMixer(Playable root, TrackAsset track, Type type)
            {
                int inputCount = root.GetOutputCount();

                for (int i = 0; i < inputCount; i++)
                {
                    Playable rootInput = root.GetOutput(i);

                    if (rootInput.IsValid())
                    {
                        //If this input is a T, check it matches our track
                        if (rootInput.GetPlayableType() is ITrackMixer)
                        {
                            PlayableBehaviour playableBehaviour = GetPlayableBehaviour(rootInput, type);
                            ITrackMixer       trackMixer        = playableBehaviour as ITrackMixer;

                            if (trackMixer != null && trackMixer.GetTrackAsset() == track)
                            {
                                return(playableBehaviour);
                            }
                        }

                        //Otherwise search this playable's inputs
                        {
                            PlayableBehaviour trackMixer = GetTrackMixer(rootInput, track, type);

                            if (trackMixer != null)
                            {
                                return(trackMixer);
                            }
                        }
                    }
                }

                return(null);
            }