浏览代码

dolly fix

/cinematic-demo-ME
etienne cella 5 年前
当前提交
4549b477
共有 2 个文件被更改,包括 14 次插入10 次删除
  1. 15
      Assets/ClusterDisplay/Scripts/DirectorController.cs
  2. 9
      Assets/Scenes/Demo/Demo.unity

15
Assets/ClusterDisplay/Scripts/DirectorController.cs


float m_SpeedDelta;
PlayableDirector m_Director;
float m_Speed;
void OnEnable()

delta = -1;
else if (Input.GetKey(KeyCode.UpArrow))
delta = 1;
else return;
m_Speed = Mathf.Clamp(m_Speed + delta * m_SpeedDelta, m_MinSpeed, m_MaxSpeed);
if(!m_Director.playableGraph.IsValid())
m_Director.RebuildGraph();
m_Director.playableGraph.GetRootPlayable(0).SetSpeed(m_Speed);
if (delta != 0)
{
m_Speed = Mathf.Clamp(m_Speed + delta * m_SpeedDelta, m_MinSpeed, m_MaxSpeed);
if(!m_Director.playableGraph.IsValid())
m_Director.RebuildGraph();
m_Director.playableGraph.GetRootPlayable(0).SetSpeed(m_Speed);
}
}
}

9
Assets/Scenes/Demo/Demo.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1367818371}
m_Enabled: 0
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 0}
m_CullingMode: 0

- key: {fileID: -4878163679587137354, guid: 5e39f607d08b95148be44fb50062293f, type: 2}
value: {fileID: 0}
- key: {fileID: 4627053967029438951, guid: 5e39f607d08b95148be44fb50062293f, type: 2}
value: {fileID: 1963778099}
value: {fileID: 1367818375}
- key: {fileID: -5447609427781532511, guid: 5e39f607d08b95148be44fb50062293f, type: 2}
value: {fileID: 1367818375}
m_ExposedReferences:

m_Script: {fileID: 11500000, guid: 1a49aa03c779a7b4e992c853226ec40e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_MaxSpeed: 2
m_MinSpeed: 0.1
m_MaxSpeed: 4
m_MinSpeed: 0
m_Speed: 1
--- !u!1 &1711691666
GameObject:
m_ObjectHideFlags: 0

正在加载...
取消
保存