Пример #1
0
        public override Playable CreateTrackMixer(
            PlayableGraph graph, GameObject go, int inputCount)
        {
            foreach (var c in GetClips())
            {
                CinemachineShot shot = (CinemachineShot)c.asset;
                CinemachineVirtualCameraBase vcam = shot.VirtualCamera.Resolve(graph.GetResolver());
                c.displayName = vcam == null ? "CinemachineShot" : vcam.Name;
            }

            var mixer = ScriptPlayable <CinemachineMixer> .Create(graph);

            mixer.SetInputCount(inputCount);
            return(mixer);
        }
Пример #2
0
        public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
        {
            foreach (TimelineClip timelineClip in base.GetClips())
            {
                CinemachineShot cinemachineShot = (CinemachineShot)timelineClip.asset;
                CinemachineVirtualCameraBase cinemachineVirtualCameraBase = cinemachineShot.VirtualCamera.Resolve(graph.GetResolver());
                if (cinemachineVirtualCameraBase != null)
                {
                    timelineClip.displayName = cinemachineVirtualCameraBase.Name;
                }
            }
            ScriptPlayable <CinemachineMixer> playable = ScriptPlayable <CinemachineMixer> .Create(graph, 0);

            playable.SetInputCount(inputCount);
            return(playable);
        }
Пример #3
0
        public override Playable CreateTrackMixer(
            PlayableGraph graph, GameObject go, int inputCount)
        {
            // Hack to set the display name of the clip to match the vcam
            foreach (var c in GetClips())
            {
                CinemachineShot shot = (CinemachineShot)c.asset;
                CinemachineVirtualCameraBase vcam = shot.VirtualCamera.Resolve(graph.GetResolver());
                if (vcam != null)
                {
                    c.displayName = vcam.Name;
                }
            }

            var mixer = ScriptPlayable <CinemachineMixer> .Create(graph);

            mixer.SetInputCount(inputCount);
            return(mixer);
        }