【UE4 C++】获取运行时间、设置时间流速、暂停游戏
基于UGameplayStatics
获取运行时间
/** Returns the frame delta time in seconds, adjusted by time dilation. */
UFUNCTION(BlueprintPure, Category = "Utilities|Time", meta = (WorldContext="WorldContextObject"))
static float GetWorldDeltaSeconds(const UObject* WorldContextObject);
/** Returns time in seconds since world was brought up for play, adjusted by time dilation and IS stopped when game pauses */
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject"))
static float GetTimeSeconds(const UObject* WorldContextObject);
/** Returns time in seconds since world was brought up for play, adjusted by time dilation and IS NOT stopped when game pauses */
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject"))
static float GetUnpausedTimeSeconds(const UObject* WorldContextObject);
/** Returns time in seconds since world was brought up for play, does NOT stop when game pauses, NOT dilated/clamped */
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject"))
static float GetRealTimeSeconds(const UObject* WorldContextObject);
/** Returns time in seconds since world was brought up for play, IS stopped when game pauses, NOT dilated/clamped. */
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject"))
static float GetAudioTimeSeconds(const UObject* WorldContextObject);
/** Returns time in seconds since the application was started. Unlike the other time functions this is accurate to the exact time this function is called instead of set once per frame. */
UFUNCTION(BlueprintPure, Category="Utilities|Time", meta=(WorldContext="WorldContextObject"))
static void GetAccurateRealTime(const UObject* WorldContextObject, int32& Seconds, float& PartialSeconds);
设置时间流速
设置全局时间流速
static float GetGlobalTimeDilation(const UObject* WorldContextObject); static void SetGlobalTimeDilation(const UObject* WorldContextObject, float TimeDilation);
设置指定Actor时间流速
AActor* MyActor;
MyActor->CustomTimeDilation = 0.5f;
暂停游戏
static bool SetGamePaused(const UObject* WorldContextObject, bool bPaused);
static bool IsGamePaused(const UObject* WorldContextObject);
【UE4 C++】获取运行时间、设置时间流速、暂停游戏的更多相关文章
- [WinAPI] API 14 [获取、设置文件属性和时间]
>_< 为了获取文件属性,用户可以使用GetFileAttributes与GetFileAttributesEx函数. GetFileAttributesEx函数除了返回文件属性外,还返回 ...
- Delphi获取与设置系统时间格式,即GetLocaleInfo和SetLocaleInfo
在Delphi中,特别是在写管理系统软件时,经常要用到 FormatDateTime 以将 TDateTime 格式的日期时间转换成字符串形式的值显示或保存起来,或者用 StrToDateTime将字 ...
- redis中获取没有设置ttl过期时间的key
需求:redis作为一个内存型的数据库,我们需要对过期key保持关注,从info keyspace中可以看出有多少key没有设置过期时间,那么到底是哪些呢? 说明:关于redis ttl 的返回值,请 ...
- [转载] C/C++中怎样获取日期和时间
C/C++中怎样获取日期和时间摘要: 本文从介绍基础概念入手,探讨了在C/C++中对日期和时间操作所用到的数据结构和函数,并对计时.时间的获取.时间的计算和显示格式等方面进行了阐述.本文还通过大量的 ...
- C/C++中怎样获取日期和时间
C/C++中怎样获取日期和时间摘要: 本文从介绍基础概念入手,探讨了在C/C++中对日期和时间操作所用到的数据结构和函数,并对计时.时间的获取.时间的计算和显示格式等方面进行了阐述.本文还通过大量的实 ...
- JAVA中获取当前系统时间及格式转换
JAVA中获取当前系统时间 一. 获取当前系统时间和日期并格式化输出: import java.util.Date;import java.text.SimpleDateFormat; publi ...
- Java 获取当前系统时间方法比较
转载: http://blog.csdn.net/zzjjiandan/article/details/8372617 一. 获取当前系统时间和日期并格式化输出: import java.util.D ...
- java中获取日期和时间的方法总结
1.获取当前时间,和某个时间进行比较.此时主要拿long型的时间值. 方法如下: 要使用 java.util.Date .获取当前时间的代码如下 Date date = new Date(); da ...
- JAVA中获取当前系统时间
一. 获取当前系统时间和日期并格式化输出: import java.util.Date;import java.text.SimpleDateFormat; public class NowStrin ...
随机推荐
- java基础之ThreadLocal
早在JDK 1.2的版本中就提供java.lang.ThreadLocal,ThreadLocal为解决多线程程序的并发问题提供了一种新的思路.使用这个工具类可以很简洁地编写出优美的多线程程序.Thr ...
- 使用ogr裁剪矢量数据
使用ogr裁剪矢量数据 由来: 近期有个需求,内容是这样的:我们有两个矢量数据,现在要求以一个矢量文件为底板,按字段对另一个矢量文件进行分割,生成若干小的shpfile文件 分析: 经过分析之 ...
- 【第七篇】- Git 分支管理之Spring Cloud直播商城 b2b2c电子商务技术总结
Git 分支管理 几乎每一种版本控制系统都以某种形式支持分支.使用分支意味着你可以从开发主线上分离开来,然后在不影响主线的同时继续工作. 有人把 Git 的分支模型称为必杀技特性,而正是因为它,将 ...
- 通过mstsc复制粘贴失败需要重新启动RDP剪切板监视程序rdpclip.exe
先结束程序 再重新启动程序
- CodeForce-812C Sagheer and Nubian Market(二分)
Sagheer and Nubian Market CodeForces - 812C 题意:n个货物,每个货物基础价格是ai. 当你一共购买k个货物时,每个货物的价格为a[i]+k*i. 每个货物只 ...
- Java基础系列(35)- 数组声明创建
数组声明创建 首先必须声明数组变量,才能在程序中使用数组.下面是声明数组变量的语法: dataType[] arrayRefVar; //首选的方法 或 dataType arrayRefVar[]; ...
- Linux系列(42) - 防火墙相关命令
# 开启 service firewalld start # 重启 service firewalld restart # 关闭 service firewalld stop # 查看防火墙规则 fi ...
- 鸿蒙内核源码分析(进程回收篇) | 老父亲如何向老祖宗临终托孤 ? | 百篇博客分析OpenHarmony源码 | v47.01
百篇博客系列篇.本篇为: v47.xx 鸿蒙内核源码分析(进程回收篇) | 临终前如何向老祖宗托孤 | 51.c.h .o 进程管理相关篇为: v02.xx 鸿蒙内核源码分析(进程管理篇) | 谁在管 ...
- vm 将宿主机文件夹 映射至 虚拟机
一.关于centos如何安装(自行百度) 二.设置共享文件夹 添加共享文件夹(关闭虚拟机时操作) 虚拟机->设置->选项->共享文件夹 三.安装vm-tools (请用root用户执 ...
- Pycharm软件学生和老师可申请免费专业版激活码
有一种邮箱,叫做教育邮箱,这东西在这个互联网的世界有很大的优惠及特权,在 Jetbrain 这里, 如果你有教育邮箱(没有教育邮箱怎么办?.edu.cn后缀的邮箱)但很多学生.甚至老师都未必有. 你只 ...