完成接入
This commit is contained in:
@@ -427,8 +427,8 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Emo);
|
||||
emoManager.OpenView();
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeInAsync(0.5f);
|
||||
emoManager.OpenView();
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.EmoDeep);
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.5f);
|
||||
}
|
||||
|
||||
@@ -56,10 +56,19 @@ namespace AibisDream.Framework
|
||||
_curCameraEnum = CameraEnum.Default;
|
||||
|
||||
// 获取UICamera
|
||||
if (_orthoMainCamera && _orthoMainCamera.TryGetComponent<UniversalAdditionalCameraData>(out var cameraData))
|
||||
if (_orthoMainCamera && _orthoMainCamera.TryGetComponent<UniversalAdditionalCameraData>(out var orthoMaincameraData))
|
||||
{
|
||||
// 获取Stack Cameras
|
||||
var stackCameras = cameraData.cameraStack;
|
||||
var stackCameras = orthoMaincameraData.cameraStack;
|
||||
|
||||
// 获取UICamera
|
||||
uiCamera = stackCameras.Find(cam => cam && cam.name == "UI Camera");
|
||||
}
|
||||
|
||||
if (_perspectiveMainCamera && _perspectiveMainCamera.TryGetComponent<UniversalAdditionalCameraData>(out var perspectiveMaincameraData))
|
||||
{
|
||||
// 获取Stack Cameras
|
||||
var stackCameras = perspectiveMaincameraData.cameraStack;
|
||||
|
||||
// 获取UICamera
|
||||
uiCamera = stackCameras.Find(cam => cam && cam.name == "UI Camera");
|
||||
@@ -221,7 +230,7 @@ namespace AibisDream.Framework
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前激活的相机
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public Camera GetCurrentCamera()
|
||||
{
|
||||
return _camInitStateDict.TryGetValue(_curCameraEnum, out var state) && state.isPerspective ?
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace AibisDream
|
||||
{
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
emoView = transform.Find("Emo View").gameObject;
|
||||
emoView.SetActive(false);
|
||||
var virtualCam = transform.Find("Emo Camera").GetComponent<ICinemachineCamera>();
|
||||
var virtualCam2 = transform.Find("Emo Deep Camera").GetComponent<ICinemachineCamera>();
|
||||
CameraKit.Instance.RegisterCamera(CameraEnum.Emo, virtualCam);
|
||||
@@ -21,12 +22,14 @@ namespace AibisDream
|
||||
|
||||
public void OpenView()
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
//gameObject.SetActive(true);
|
||||
emoView.SetActive(true);
|
||||
}
|
||||
|
||||
public void CloseView()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
//gameObject.SetActive(false);
|
||||
emoView.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,15 +436,17 @@ public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
{
|
||||
if (Application.isPlaying && Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
Camera currentCamera = CameraKit.Instance.GetCurrentCamera();
|
||||
Ray ray = currentCamera.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
if (Physics.Raycast(ray, out RaycastHit hit))
|
||||
{
|
||||
Vector3 hitPos = hit.point;
|
||||
|
||||
// 考虑followOffset的影响
|
||||
Vector3 localHitPos = hitPos - transform.position;
|
||||
ripples.Add(new Ripple
|
||||
{
|
||||
position = new Vector2(hitPos.x, hitPos.z),
|
||||
position = new Vector2(localHitPos.x, localHitPos.z),
|
||||
startTime = Time.time
|
||||
});
|
||||
}
|
||||
@@ -1348,7 +1350,7 @@ public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
|
||||
// 更新位置
|
||||
float floatOffset = elapsed * textFloatSpeed;
|
||||
Vector3 targetPosition = text.startPosition + Vector3.up * floatOffset;
|
||||
Vector3 targetPosition = text.originalPosition + Vector3.up * floatOffset;
|
||||
|
||||
// 处理震动效果
|
||||
if (text.shouldShake)
|
||||
@@ -1363,7 +1365,8 @@ public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
}
|
||||
}
|
||||
|
||||
text.textComponent.transform.position = targetPosition;
|
||||
// 应用父物体的变换
|
||||
text.textComponent.transform.position = transform.TransformPoint(targetPosition);
|
||||
|
||||
// 更新透明度
|
||||
if (elapsed < textFadeInDuration)
|
||||
@@ -1408,8 +1411,8 @@ public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
tmp.text = text;
|
||||
tmp.color = new Color(color.r, color.g, color.b, 0f); // 初始透明
|
||||
|
||||
// 设置世界空间位置
|
||||
textObj.transform.position = position;
|
||||
// 设置世界空间位置,考虑父物体的变换
|
||||
textObj.transform.position = transform.TransformPoint(position);
|
||||
|
||||
floatingTexts.Add(new FloatingText
|
||||
{
|
||||
@@ -1417,7 +1420,9 @@ public class LakeLineDrawer : ImmediateModeShapeDrawer
|
||||
startTime = Time.time,
|
||||
startPosition = position,
|
||||
targetColor = color,
|
||||
shouldShake = shouldShake
|
||||
shouldShake = shouldShake,
|
||||
shakeStartTime = shouldShake ? Time.time : 0f,
|
||||
originalPosition = position
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user