人物攻击

[复制链接]
查看2133 | 回复3 | 2017-11-21 23:07:33 | 显示全部楼层 |阅读模式
我在.h头文件中添加了三个Montage:

[mw_shl_code=cpp,true]UPROPERTY(EditAnywhere,BlueprintReadWrite)
                UAnimMontage* PiKan1Montage;

        UPROPERTY(EditAnywhere,BlueprintReadWrite)
                UAnimMontage* PiKan2Montage;

        UPROPERTY(EditAnywhere, BlueprintReadWrite)
                UAnimMontage* PiKan3Montage;
[/mw_shl_code]


然后在cpp的PiKan函数里添加

[mw_shl_code=applescript,true]void AOneCharacter:iKan()
{
        if (PiKan1Montage != NULL, PiKan2Montage != NULL, PiKan3Montage != NULL)
        {
                UAnimInstance * AnimInstance = Mesh1P->GetAnimInstance();

                  if (AnimInstance != NULL)
                  {
                        AnimInstance->Montage_Play(PiKan1Montage, 1.0f);
                        AnimInstance->Montage_Play(PiKan2Montage, 1.0f);
                        AnimInstance->Montage_Play(PiKan2Montage, 1.0f);
                  }
        }

}
[/mw_shl_code]

请问为啥它只会执行PiKan1Montage呢?
mknmknmk | 2017-11-22 12:09:50 | 显示全部楼层
只写montage2呢
回复 支持 反对

使用道具 举报

天天爱学习 | 2017-11-29 18:50:25 | 显示全部楼层

那样的话,只会播放第二个蒙太奇
回复 支持 反对

使用道具 举报

mknmknmk | 2017-11-30 09:53:20 | 显示全部楼层
本帖最后由 mknmknmk 于 2017-11-30 09:58 编辑

使用 TQueue<>   结合Timer 或者 Update 可以 播放依次播放Tqueue 里的东西;
元素是自定义结构体 ,  结构体元素有Montage, duration, 剩余时间。  timer 或者 Update 减少剩余时间。 到0时 dequeue
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/15793-play-aninimation-form-c-how-to-get-current-and-remaining-time
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

12

主题

34

回帖

41

积分

初始化成员

积分
41