UE4中tick的两种方式

UCLASS()
class UCoolDownMgr : public UObject, public FTickableGameObject
{
    GENERATED_BODY()
public:
    // Sets default values for this character's properties
    UCoolDownMgr();
    virtual ~UCoolDownMgr();
    // Begin FTickableGameObject Interface.
    virtual void Tick(float DeltaTime) override;
    virtual bool IsTickable() const override;
    virtual TStatId GetStatId() const override;
    // End FTickableGameObject Interface.
};

注册回调函数:

TickDelegate = FTickerDelegate::CreateUObject(this, &UShooterGameInstance::Tick);
TickDelegateHandle = FTicker::GetCoreTicker().AddTicker(TickDelegate);

你可能感兴趣的:(UE4中tick的两种方式)