94 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			94 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
 | 
						||
# Class
 | 
						||
## FightGameAction 
 | 
						||
FightGameAction  => GameAction => HitBoxAction => Actor
 | 
						||
 | 
						||
CustomEvent:
 | 
						||
- 继承事件:
 | 
						||
	- ActionStart:取得当前Pawn并且赋予FgPawn变量,以及当前AnimInstance赋予PawnAnim。
 | 
						||
	- SpecialEvent:调用IsParry()来判断是否是格挡事件,如果是就调用Parry事件。
 | 
						||
	- StrikeEvent:
 | 
						||
		1. StrikeFeedback:触发对应的反馈效果。包括粒子、声音、力、镜头摇晃。
 | 
						||
		2. ApplyHitDamage:应用伤害。
 | 
						||
	- OtherEvent:其他Hit逻辑。
 | 
						||
- 新事件:
 | 
						||
	- Parry:格挡事件。
 | 
						||
	- Freeze:硬直效果。
 | 
						||
	- ResetFreeze:重置硬直效果。
 | 
						||
 | 
						||
### HitBoxAction
 | 
						||
Component:
 | 
						||
- HitBoxEditor:编辑用组件,用于编辑每帧Action时切换指定Index的帧。***ComponentTag:"hb.Editor"***
 | 
						||
	- FrameSlider
 | 
						||
		- FrameIdTx
 | 
						||
	- AnimSlider
 | 
						||
 | 
						||
Method:
 | 
						||
- Initialize()
 | 
						||
	1. SetOwner()
 | 
						||
	2. SetFrameList():遍历所有HitBoxFrameComponent,并且根据**组件名称**取得FrameID
 | 
						||
	3. ActionStart():调用ActionStart()事件。
 | 
						||
 | 
						||
CustomEvent:
 | 
						||
1. ActionStart
 | 
						||
2. HitBox
 | 
						||
3. OtherHits
 | 
						||
 | 
						||
 Editor相关:
 | 
						||
 CustomEvent:
 | 
						||
 1. InitializeEditor:**根据FrameSlider的Location来设置HitBoxFrame**,该逻辑会在ConstructScript中被调用,每移动一次就会被调用一次。
 | 
						||
 2. EditorSliders:根据FrameSlider、AnimSlider的当前帧数(根据相对Location来记录FrameId)来设置显示文字。
 | 
						||
 3. DestroyEditor
 | 
						||
 | 
						||
### GameAction
 | 
						||
主要实现了HitBox事件。判断是否是StrikeEvent与SpcialEvent后,调用StrikeEvent()与SpcialEvent()。
 | 
						||
 | 
						||
CustomEvent:
 | 
						||
1. StrikeEvent
 | 
						||
2. SpcialEvent
 | 
						||
 | 
						||
 Editor相关:
 | 
						||
 CustomEvent:
 | 
						||
 1. InitializeEditor:在父类事件的基础上,用相对位移来存储开始播放Montage的初始位置,设置到**SkeleMesh->AnimationData->InitialPosition**。
 | 
						||
 | 
						||
 | 
						||
## ActionComponent
 | 
						||
>主要使用这个组件来管理当前Action?设置HitBoxAction类给ChildActor,并且调用HitBoxAction的Initialize并且绑定ActionEvent。
 | 
						||
 | 
						||
Event
 | 
						||
- BeginPlay:设置ChildActorComponent到ChildActor变量上。可根据Tag来选择ChildActorComponent。
 | 
						||
- EndPlay:触发DestoryAction事件。
 | 
						||
 | 
						||
CustomEvent
 | 
						||
- ***SetAction***:设置新的HitBoxAction类以及Frame Id。
 | 
						||
	- SetActionClass(),其中SetActionClass的逻辑会调用HitBoxAction的Initialize并且绑定ActionEvent。
 | 
						||
	- 调用Action类的SetActiveFrame()。
 | 
						||
- NewAction:依次调用DestoryAction、SetAction事件。
 | 
						||
- DestoryAction:将ChildActor置空。
 | 
						||
 | 
						||
## HitBoxFrame
 | 
						||
HitBoxFrame => SceneComponent
 | 
						||
 | 
						||
CustomEvent
 | 
						||
- InitializeFrame:取得所有ChildrenComponent(HitBox),并且加入BodyList中。并且对每个HitBox调用InitializeHitBox()
 | 
						||
- UpdateFrame:判断FrameId,销毁旧OldFrame创建新的。
 | 
						||
- DestroyFrame:
 | 
						||
 | 
						||
# AnimNotify
 | 
						||
## FrameNotify
 | 
						||
- RecivedNotify:调用SetNewAction()
 | 
						||
	1. 通过SkeletalMeshComponent取得OwnerActor
 | 
						||
	2. 取得ActionComponent
 | 
						||
	3. 根据StartAction执行对应的逻辑
 | 
						||
		1. true,ActionComponent->NewAction()
 | 
						||
		2. false, 判断ActionComponent中的Action类是否与AnimNotify的Action类相同?如相同执行ActionComponent->SetAction()
 | 
						||
 | 
						||
## FrameState
 | 
						||
- Recived_NotifyBegin:逻辑与FrameNotify的逻辑相同。
 | 
						||
- Recived_NotifyTick:每帧判断ActionComponent的FrameId与Class是否与FrameState是否相同,如果不相同,就调用ActionComponent->SetNewAction()
 | 
						||
 | 
						||
## MovementModeState
 | 
						||
用于设置角色的MovementMode
 | 
						||
 | 
						||
## RunMontageSection
 | 
						||
用于让Montage跳转Section。 |