浏览代码

Fixed LinkGameView behavior + added deactivation of VirtualCameraManager when in linked view

/main
Thomas ICHÉ 6 年前
当前提交
df32f88d
共有 2 个文件被更改,包括 29 次插入0 次删除
  1. 21
      Editor/GameViewLink/LinkGameView.cs
  2. 8
      Runtime/Managers/Implementations/VirtualCameraManager.cs

21
Editor/GameViewLink/LinkGameView.cs


static void OnPlayModeChanged(PlayModeStateChange state)
{
// Reset State when entering editmode or play mode
if(state == PlayModeStateChange.EnteredEditMode || state == PlayModeStateChange.EnteredPlayMode)
{
if (Active)

}
else // Cleanup before switching state
{
if (s_GameObject != null)
Object.DestroyImmediate(s_GameObject);
}
}

if (Application.isPlaying)
Active = false;
}
// If we have a VirtualCameraManager, manage its state here
if(Manager.Get<VirtualCameraManager>() != null)
{
var camera = Manager.Get<VirtualCameraManager>().gameObject;
if(camera.activeInHierarchy && Active) // We need to disable the VirtualCameraManager
{
camera.SetActive(false);
}
else if (!camera.activeInHierarchy && !Active) // We need to re-enable the VirtualCameraManager
{
camera.SetActive(true);
}
}
if (Active)

8
Runtime/Managers/Implementations/VirtualCameraManager.cs


[ManagerDefaultPrefab("VirtualCameraManager")]
public class VirtualCameraManager : Manager
{
public Camera Camera
{
get
{
return m_Camera;
}
}
Camera m_Camera;
CinemachineBrain m_Brain;

正在加载...
取消
保存