|  |  |  | using System; | 
					
						
							|  |  |  | using Game; | 
					
						
							|  |  |  | using UnityEngine; | 
					
						
							|  |  |  | using UnityEngine.Playables; | 
					
						
							|  |  |  | using UnityEngine.Serialization; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Serializable] | 
					
						
							|  |  |  | public class AttackBehaviour : PlayableBehaviour | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     [Rename("强制位移方向")] public Vector3 flowSpeed; | 
					
						
							|  |  |  |     [Rename("强制位移持续时间")] public float flowTime; | 
					
						
							|  |  |  |     [Rename("可以从地面击飞")] public bool isFlow; | 
					
						
							|  |  |  |     [Rename("Aoe")] public bool isAoe = true; | 
					
						
							|  |  |  |     [Rename("伤害修正")] public float damageRate = 1; | 
					
						
							|  |  |  |     [Rename("眩晕修正")] public float stunRate = 1; | 
					
						
							|  |  |  |     [Rename("硬直等级")] public int staggerLevel = 2; | 
					
						
							|  |  |  |     [Rename("卡帧时间(帧)")] public int pauseTime; | 
					
						
							|  |  |  |     [Rename("命中id")] public int hitId; //同一hitId视为一段伤害 | 
					
						
							|  |  |  |     [Rename("伤害类型")] public EHitType hitType; | 
					
						
							|  |  |  |     [Rename("结算顺序")] public EHitOrderType hitOrderType = EHitOrderType.Forward; | 
					
						
							|  |  |  |     [Rename("命中方向")] public EHitDirType hitDirType = EHitDirType.Forward; | 
					
						
							|  |  |  |     [Rename("命中形状")] public EShapeType Type; | 
					
						
							|  |  |  |     [Rename("偏移(格)")] public Vector3 Offset; | 
					
						
							|  |  |  |     [Rename("高度(格)")] public float Height; | 
					
						
							|  |  |  |     [Rename("长(格)")] public float SizeX; | 
					
						
							|  |  |  |     [Rename("宽(格)")] public float SizeY; | 
					
						
							|  |  |  |     [Rename("半径(格)")] public float Radius; | 
					
						
							|  |  |  |     [Rename("角度")] public float Angle; | 
					
						
							|  |  |  |     [Rename("投技时间轴")] public PlayableAsset throwTimeline; | 
					
						
							|  |  |  |     [Rename("仅对投技目标结算")] public bool throwOnly; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     private Shape _shape = null; | 
					
						
							|  |  |  |     private const float ToGridSize = 16f / 64f; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public Shape Shape | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         get { return _shape ??= ShapeNew; } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public Shape ShapeNew | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         get | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             return Type switch | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 EShapeType.Dot => | 
					
						
							|  |  |  |                     Shape.NewDot(Offset * ToGridSize), | 
					
						
							|  |  |  |                 EShapeType.Circle => | 
					
						
							|  |  |  |                     Shape.NewCircle(Offset * ToGridSize, Height * ToGridSize, Radius * ToGridSize), | 
					
						
							|  |  |  |                 EShapeType.Sector => | 
					
						
							|  |  |  |                     Shape.NewSector(Offset * ToGridSize, Height * ToGridSize, Radius * ToGridSize, Angle), | 
					
						
							|  |  |  |                 EShapeType.Box => | 
					
						
							|  |  |  |                     Shape.NewBox(Offset * ToGridSize, Height * ToGridSize, SizeX * ToGridSize, SizeY * ToGridSize), | 
					
						
							|  |  |  |                 _ => _shape | 
					
						
							|  |  |  |             }; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public override void OnPlayableCreate(Playable playable) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |