You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.7 KiB

// using Cinemachine;
// using Entitas.CodeGeneration.Attributes;
// using UnityEngine;
//
// namespace CoreGame.Render
// {
// [Combat, Unique]
// public class VirtualCameraProxy : ProxyBase
// {
// public CinemachineVirtualCamera virtualCamera;
// public CinemachineBrain brain;
// private Transform m_Target;
//
// internal Vector3 followPos;
// internal bool hasSynced;
// private Vector3 m_CachePos;
//
// // todo 需要加绑点
// protected override void Initialize(GameObject go, CombatEntity ent)
// {
// this.virtualCamera = go.GetComponentsInChildren<CinemachineVirtualCamera>()[0];
// brain = Camera.main.gameObject.GetComponent<CinemachineBrain>();
// hasSynced = false;
// // virtualCamera.m_Lens.OrthographicSize = 8.5f; //调整相机大小
// m_CachePos = brain.OutputCamera.transform.position;
// var componentsInChildren = go.GetComponentsInChildren<Transform>();
// for (int i = 0; i < componentsInChildren.Length; i++)
// {
// if (componentsInChildren[i].name == "Folloe")
// {
// virtualCamera.Follow = componentsInChildren[i];
// m_Target = componentsInChildren[i];
// break;
// }
// }
// brain.ManualUpdate();
//
// }
//
// public void Sync()
// {
// // m_Target.position = followPos;
// // brain.ManualUpdate();
// brain.OutputCamera.transform.position = new Vector3(followPos.x, followPos.y, m_CachePos.z);
// hasSynced = true;
// }
// }
// }