diff --git a/client/Assets/Game/Driver.unity b/client/Assets/Game/Driver.unity index e702d7a..e68b2e4 100644 --- a/client/Assets/Game/Driver.unity +++ b/client/Assets/Game/Driver.unity @@ -1263,11 +1263,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 2900688634913248021, guid: a3b5dc6ed38d00b498bf4e8a547cfa36, - type: 3} - propertyPath: InitialModule.startLifetime.scalar - value: 0.2 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a3b5dc6ed38d00b498bf4e8a547cfa36, type: 3} --- !u!1 &1879270969 @@ -1480,7 +1475,7 @@ PlayableDirector: m_GameObject: {fileID: 1645380337361164332} m_Enabled: 1 serializedVersion: 3 - m_PlayableAsset: {fileID: 11400000, guid: c1797a25beab8924885805980777dd56, type: 2} + m_PlayableAsset: {fileID: 11400000, guid: 1c56e66a1df59614383a8ea99af21081, type: 2} m_InitialState: 0 m_WrapMode: 2 m_DirectorUpdateMode: 1 @@ -1527,13 +1522,13 @@ PlayableDirector: - key: {fileID: -4750574827767443630, guid: 1c56e66a1df59614383a8ea99af21081, type: 2} value: {fileID: 1645380337361164335} - key: {fileID: 2359698281133013487, guid: e4774a4e814dded49a1ec154b070dd3d, type: 2} - value: {fileID: 1645380337361164332} + value: {fileID: 1645380337361164335} - key: {fileID: -4824941642191393376, guid: 8132180b67c90a04c89a4dfcc47f81f9, type: 2} value: {fileID: 5972941309607553105} - key: {fileID: -4824941642191393376, guid: dd907a25a9bbb4e4780e7978cce9c563, type: 2} value: {fileID: 5972941309607553105} - key: {fileID: -4750574827767443630, guid: dd907a25a9bbb4e4780e7978cce9c563, type: 2} - value: {fileID: 1645380337361164332} + value: {fileID: 1645380337361164335} - key: {fileID: -4750574827767443630, guid: 47a64edc9a09a3d41b5b399b240429f5, type: 2} value: {fileID: 1645380337361164335} - key: {fileID: -4824941642191393376, guid: 50230db49392e40499149400a6ba78ff, type: 2} @@ -1721,7 +1716,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 5972941309607553105} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.45000005, z: 0} + m_LocalPosition: {x: 0, y: 0.40625, z: 0} m_LocalScale: {x: 1, y: 1, z: 2} m_Children: [] m_Father: {fileID: 1645380337361164335} diff --git a/client/Assets/Game/Scripts/Util/Common/UtilCommon.cs b/client/Assets/Game/Scripts/Util/Common/UtilCommon.cs index e397805..4083714 100644 --- a/client/Assets/Game/Scripts/Util/Common/UtilCommon.cs +++ b/client/Assets/Game/Scripts/Util/Common/UtilCommon.cs @@ -54,33 +54,51 @@ namespace Game { var posReal = pos + shape.Offset; var posRealTop = posReal + Vector3.up * shape.Height; + var posRealMid = posReal + Vector3.up * (shape.Height / 2); switch (shape.Type) { case EShapeType.Dot: - Debug.DrawLine(posReal + Vector3.left, posReal + Vector3.right, color); - Debug.DrawLine(posReal + Vector3.down, posReal + Vector3.up, color); - Debug.DrawLine(posReal + Vector3.back, posReal + Vector3.forward, color); + DrawShapeCross(posReal, 1, color); + DrawShapeCenter(posReal, 1, color); break; case EShapeType.Box: - shape.ForeachVerticesPair(direction, (v1, v2) => - { - Debug.DrawLine(posReal + v1, posReal + v2, color); - Debug.DrawLine(posRealTop + v1, posRealTop + v2, color); - }); - shape.ForeachVertices(direction, v => { Debug.DrawLine(posReal + v, posRealTop + v, color); }); + DrawShapeBody(shape, pos, direction, color); + break; + case EShapeType.Sector: + DrawShapeBody(shape, pos, direction, color); break; case EShapeType.Circle: - var r = shape.Radius; - var h = shape.Height; - Debug.DrawLine(posReal + Vector3.left * r, posReal + Vector3.right * r, color); - Debug.DrawLine(posReal + Vector3.back * r, posReal + Vector3.forward * r, color); - Debug.DrawLine(posRealTop + Vector3.left * r, posRealTop + Vector3.right * r, color); - Debug.DrawLine(posRealTop + Vector3.back * r, posRealTop + Vector3.forward * r, color); - Debug.DrawLine(posReal, posRealTop, color); + DrawShapeBody(shape, pos, direction, color); + DrawShapeCenter(posRealMid, shape.Height / 2, color); + DrawShapeCross(posReal, shape.Radius, color); + DrawShapeCross(posRealTop, shape.Radius, color); break; } } + private static void DrawShapeCenter(Vector3 pos, float h, Color color) + { + Debug.DrawLine(pos + Vector3.down * h, pos + Vector3.up * h, color); + } + + private static void DrawShapeCross(Vector3 pos, float r, Color color) + { + Debug.DrawLine(pos + Vector3.left * r, pos + Vector3.right * r, color); + Debug.DrawLine(pos + Vector3.back * r, pos + Vector3.forward * r, color); + } + + private static void DrawShapeBody(Shape shape, Vector3 pos, Vector3 direction, Color color) + { + var posReal = pos + shape.Offset; + var posRealTop = posReal + Vector3.up * shape.Height; + shape.ForeachVerticesPair(direction, (v1, v2) => + { + Debug.DrawLine(posReal + v1, posReal + v2, color); + Debug.DrawLine(posRealTop + v1, posRealTop + v2, color); + }); + shape.ForeachVertices(direction, v => { Debug.DrawLine(posReal + v, posRealTop + v, color); }); + } + public static void Print(params object[] values) { string text = ""; diff --git a/client/Assets/Game/Scripts/Util/Shape/UtilShapeObject.cs b/client/Assets/Game/Scripts/Util/Shape/UtilShapeObject.cs index a423f8b..3249d39 100644 --- a/client/Assets/Game/Scripts/Util/Shape/UtilShapeObject.cs +++ b/client/Assets/Game/Scripts/Util/Shape/UtilShapeObject.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using UnityEngine; using UnityEngine.Serialization; @@ -21,6 +22,7 @@ namespace Game public float SizeY; public float Radius; public float Angle; + private List vertices = new List(); public static Shape NewDot(Vector3 offset) { @@ -94,40 +96,71 @@ namespace Game return aabb; } - public void ForeachVertices(Vector3 direction, Action action) + public void SetVertices(Vector3 direction) { - var (halfX, halfY) = (SizeX / 2, SizeY / 2); + vertices.Clear(); + switch (Type) + { + case EShapeType.Circle: + for (var i = 0; i < 360; i += 15) + { + var angle = i * Mathf.Deg2Rad; + var x = Mathf.Cos(angle) * Radius; + var z = Mathf.Sin(angle) * Radius; + vertices.Add(new Vector3(x, 0, z)); + } - var up = new Vector3(direction.z, 0, direction.x); - var right = new Vector3(direction.x, 0, -direction.z); + break; + case EShapeType.Sector: + var rotAdd = Util.Vec3ToRot(direction); + vertices.Add(Vector3.zero); + var vertNum = (int)(Angle / 15); + var anglePerVertex = Angle / vertNum; + for (var i = 0; i <= vertNum; i++) + { + var angle = (i * anglePerVertex + rotAdd - Angle / 2) * Mathf.Deg2Rad; + var x = Mathf.Cos(angle) * Radius; + var z = Mathf.Sin(angle) * Radius; + vertices.Add(new Vector3(x, 0, z)); + } - var topLeft = right * halfX - up * halfY; - var topRight = right * halfX + up * halfY; - var bottomLeft = -right * halfX - up * halfY; - var bottomRight = -right * halfX + up * halfY; + break; + case EShapeType.Box: + var (halfX, halfY) = (SizeX / 2, SizeY / 2); + + var up = new Vector3(direction.z, 0, direction.x); + var right = new Vector3(direction.x, 0, -direction.z); + + var topLeft = right * halfX - up * halfY; + var topRight = right * halfX + up * halfY; + var bottomLeft = -right * halfX - up * halfY; + var bottomRight = -right * halfX + up * halfY; + vertices.Add(topLeft); + vertices.Add(topRight); + vertices.Add(bottomLeft); + vertices.Add(bottomRight); + break; + } + } - action(topLeft); - action(topRight); - action(bottomLeft); - action(bottomRight); + public void ForeachVertices(Vector3 direction, Action action) + { + SetVertices(direction); + foreach (var item in vertices) + { + action(item); + } } public void ForeachVerticesPair(Vector3 direction, Action action) { - var (halfX, halfY) = (SizeX / 2, SizeY / 2); - - var up = new Vector3(direction.z, 0, direction.x); - var right = new Vector3(direction.x, 0, -direction.z); - - var topLeft = right * halfX - up * halfY; - var topRight = right * halfX + up * halfY; - var bottomLeft = -right * halfX - up * halfY; - var bottomRight = -right * halfX + up * halfY; - - action(topLeft, topRight); - action(topRight, bottomRight); - action(bottomRight, bottomLeft); - action(bottomLeft, topLeft); + SetVertices(direction); + for (var i = 0; i < vertices.Count; i++) + { + var next = i + 1; + if (next >= vertices.Count) next = 0; + action(vertices[i], vertices[next]); + } } } } \ No newline at end of file diff --git a/client/Assets/Resources/Timeline/skill_hero01_long_attack01.playable b/client/Assets/Resources/Timeline/skill_hero01_long_attack01.playable index be80d01..a9ddbf2 100644 --- a/client/Assets/Resources/Timeline/skill_hero01_long_attack01.playable +++ b/client/Assets/Resources/Timeline/skill_hero01_long_attack01.playable @@ -334,7 +334,7 @@ MonoBehaviour: m_Start: 0.21666666666666667 m_ClipIn: 0 m_Asset: {fileID: 4898924959087489963} - m_Duration: 0.05 + m_Duration: 0.04999999999999999 m_TimeScale: 1 m_ParentTrack: {fileID: -4750574827767443630} m_EaseInDuration: 0 @@ -723,6 +723,14 @@ MonoBehaviour: staggerLevel: 2 pauseTime: 0.05 hitId: 0 + hitType: 0 + Type: 2 + Offset: {x: 1, y: 0, z: 0} + Height: 2.5 + SizeX: 2 + SizeY: 2 + Radius: 2 + Angle: 98.6 --- !u!114 &5178577764301111608 MonoBehaviour: m_ObjectHideFlags: 1