浏览代码

cinematic artefact wip

/cinematic-demo-ME
etienne cella 5 年前
当前提交
a6d88ad7
共有 4 个文件被更改,包括 91 次插入0 次删除
  1. 33
      Assets/ClusterDisplay/Scripts/ResetVolumetricsOnCut.cs
  2. 11
      Assets/ClusterDisplay/Scripts/ResetVolumetricsOnCut.cs.meta
  3. 36
      Assets/ClusterDisplay/Scripts/TimelineLoop.cs
  4. 11
      Assets/ClusterDisplay/Scripts/TimelineLoop.cs.meta

33
Assets/ClusterDisplay/Scripts/ResetVolumetricsOnCut.cs


using System;
using Cinemachine;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
[RequireComponent(typeof(CinemachineBrain))]
public class ResetVolumetricsOnCut : MonoBehaviour
{
CinemachineBrain m_Brain;
void OnEnable()
{
m_Brain = GetComponent<CinemachineBrain>();
m_Brain.m_CameraCutEvent.AddListener(CutHandler);
}
void OnDisable()
{
m_Brain.m_CameraCutEvent.RemoveListener(CutHandler);
}
void CutHandler(CinemachineBrain brain)
{
var cam = brain.OutputCamera;
if (cam != null)
{
HDCamera hdCam = HDCamera.GetOrCreate(cam);
hdCam.Reset();
hdCam.volumetricHistoryIsValid = false;
hdCam.colorPyramidHistoryIsValid = false;
}
}
}

11
Assets/ClusterDisplay/Scripts/ResetVolumetricsOnCut.cs.meta


fileFormatVersion: 2
guid: 2ef4e595ebdfdbc409b50a52171f91f7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

36
Assets/ClusterDisplay/Scripts/TimelineLoop.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
[RequireComponent(typeof(PlayableDirector))]
public class TimelineLoop : MonoBehaviour
{
PlayableDirector m_Director;
[SerializeField]
float m_Start;
[SerializeField]
float m_Duration;
void OnEnable()
{
m_Director = GetComponent<PlayableDirector>();
StartCoroutine(Loop());
}
void OnDisable()
{
StopAllCoroutines();
}
IEnumerator Loop()
{
for (;;)
{
m_Director.time = m_Start;
yield return new WaitForSeconds(m_Duration);
}
}
}

11
Assets/ClusterDisplay/Scripts/TimelineLoop.cs.meta


fileFormatVersion: 2
guid: 7bdbb8afafc8f7349a0b4e429eb99774
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存