对话框优化

This commit is contained in:
2025-05-28 15:58:50 +08:00
parent 34f6aac9a1
commit 26e48ec37f
24 changed files with 1579 additions and 1321 deletions
@@ -35,7 +35,6 @@ namespace AibisDream.FixSystem
// 模块基本数据
[SerializeField] public BodyModuleData data;
private float clickRadius = 0.05f;
public bool available = true;
private bool _cutting;
@@ -51,7 +50,7 @@ namespace AibisDream.FixSystem
_bodyModuleSystem = transform.parent.parent.GetComponent<BodyModuleSystem>();
_targetSpriteRenderer = transform.Find("Module Pic").GetComponent<SpriteRenderer>();
_originalMaterial = _targetSpriteRenderer.GetComponent<SpriteRenderer>().material;
_originalMaterial = _targetSpriteRenderer.GetComponent<SpriteRenderer>().material;
_cutSpriteRenderer = transform.Find("Cut Pic").GetComponent<SpriteRenderer>();
@@ -119,18 +118,14 @@ namespace AibisDream.FixSystem
#endregion
#region
public SpriteRenderer GetSpriteRenderer()
{
return _targetSpriteRenderer;
}
public void OnCuttingDown()
{
_bodyModuleSystem.RemoveModule(this);
DialogController.Instance?.StartDialogNode($"{data.moduleName}CutDown");
EnumEventSystem.Global.Send(EventEnum.CutEnd);
Destroy(gameObject);
DialogController.Instance?.StartDialogNode($"{data.moduleName}CutDown");
EnumEventSystem.Global.Send(EventEnum.CutEnd);
Destroy(gameObject);
}
public SpriteRenderer GetCutSpriteRenderer()
@@ -138,66 +133,6 @@ namespace AibisDream.FixSystem
return _cutSpriteRenderer;
}
// public void EnableCut()
// {
// // 打开或获取CutLine
// ShowCutLine();
// _cutLine.OnCuttingDown += OnCuttingDown;
// _cutting = true;
// EnumEventSystem.Global.Send(EventEnum.CutStart);
// }
// private void OnCut()
// {
// Vector2 mousePos = CommonUtil.GetMouseWorldPos(Input.mousePosition);
// _cutLine.DetectLineClick(mousePos, clickRadius);
// }
// private void OnCuttingDown()
// {
// _cutLine.OnCuttingDown -= OnCuttingDown;
// _cutting = false;
// // 模块脱落
// _cutLine.HideLine();
// _bodyModuleSystem.RemoveModule(this);
// ActionKit.Sequence()
// .Delay(0.8f)
// .DOTween(() => transform.DOMoveY(ConstRef.TweenEndY,
// (transform.position.y - ConstRef.TweenEndY) / (ConstRef.FallSpeed * 0.6f))
// .SetEase(Ease.InQuad))
// .Callback(() => DialogController.Instance?.StartDialogNode($"{data.moduleName}CutDown"))
// .Callback(() => EnumEventSystem.Global.Send(EventEnum.CutEnd))
// .Start(this, () => Destroy(gameObject));
// }
// private void ShowCutLine()
// {
// // 切割线不存在,就新建一个
// if (!_cutLine)
// {
// var prefab = ResourceKit.LoadAssetSync<GameObject>(ConstRef.CutLinePrefabName);
// var cutLineObj = Instantiate(prefab, transform);
// _cutLine = cutLineObj.GetComponent<CutLine>();
// }
// // 对切割线进行初始化
// var shapePoints = new List<Vector2>();
// _targetSpriteRenderer.sprite.GetPhysicsShape(0, shapePoints);
// if (shapePoints.Count <= 0)
// {
// Debug.LogWarning($"{name} has no shape");
// return;
// }
// // 本地坐标转世界坐标
// var shapePointsV3 = shapePoints
// .Select(item => _targetSpriteRenderer.transform.TransformPoint(item))
// .ToList();
// _cutLine.Init(shapePointsV3, clickRadius);
// }
#endregion
}