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

57 lines
1.9 KiB
C#

2 years ago
using System;
using Game;
2 years ago
using UnityEngine;
using UnityEngine.Playables;
[Serializable]
public class AttackBehaviour : PlayableBehaviour
{
[Rename("强制位移方向")] public Vector3 flowSpeed;
[Rename("强制位移持续时间")] public float flowTime;
[Rename("可以从地面击飞")] public bool isFlow;
[Rename("伤害修正")] public float damageRate;
[Rename("眩晕修正")] public float stunRate;
[Rename("硬直等级")] public int staggerLevel = 2;
[Rename("卡帧时间")] public float pauseTime;
[Rename("命中id")] public int hitId; //同一hitId视为一段伤害
[Rename("伤害类型")] public EHitType hitType;
[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;
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
};
}
}
2 years ago
public override void OnPlayableCreate(Playable playable)
{
}
}