wordpress国内视频网站吗,抽奖网站怎么制作,江门做网站价格,乐清网新闻目录 准备工作
1.创建插件
2.修改插件设置
快速资产操作#xff08;quick asset action) 自定义编辑器功能
0.创建编辑器button#xff0c;测试debug message功能 大致流程
详细步骤
1.ctrlF5 launch editor
2.创建新的cpp class#xff0c;derived from AssetAction…目录 准备工作
1.创建插件
2.修改插件设置
快速资产操作quick asset action) 自定义编辑器功能
0.创建编辑器button测试debug message功能 大致流程
详细步骤
1.ctrlF5 launch editor
2.创建新的cpp classderived from AssetActionUtility 如下图
3.ACCESS HEADER FILE
Header File
Blutility
4.DECLARE A FUNCTION放进编辑器中
UFUNCTION(CallInEditor)
key -1
版本bug:editor面板没有Scripted Asset Action...
补充GEngine
详细解释
1. GEngine 是什么
2. 常见用途
3. 注意事项
4. 示例代码
总结
待更新
1.add prefix
2.batch duplication
3.remove unused assets
4.create editor message
5.dynamically load other modules to help fix up redirectors from code 准备工作
1.创建插件 插件名字不可修改 2.修改插件设置
.uplugin 是 Unreal Engine 插件的描述文件它以 JSON 格式存储插件的元数据和配置信息用于定义插件的基本属性、模块、依赖项以及启用方式。
在.uplugin文件中
Type: Runtime是游戏实时使用的插件Editor是编辑器使用的插件LoadingPhase改成PreDefault插件会在游戏模块前被加载
ctrlB编译 快速资产操作quick asset action) 自定义编辑器功能
we create three custom editor functionalities that could allow us to automatically add prefix to assets, batch duplication, and remove unused assets from selection.我们主要会制作三个编辑器工具批量添加前缀批量复制批量移除无用资产。另外还有创建编辑器信息、修复重定向器
——————————————————————————————————————————
0.创建编辑器button测试debug message功能 大致流程
对于actions to assets, 有一个built-in class叫做AssetActionUtility我们创建一个classderived from AssetActionUtility我们创建一个function inside that classMark as UFUNCTION(CallInEditor)
详细步骤
1.ctrlF5 launch editor
2.创建新的cpp classderived from AssetActionUtility 如下图
放在新创的插件模块里name后面可以选择插件模块我的插件是SuperManagereditor不是默认的ExtendEditor(Runtime)模块class name起名叫做QuickAssetAction路径在SuperManager下新建一个AssetAction文件夹。Class type选publicheader file will be put into public folder, and cpp file will be in private folder. 3.ACCESS HEADER FILE
Header File
头文件Header File是编程中常用的一种文件类型尤其在 C 和 C 语言中尤为重要。它们主要用于声明函数、类、宏、常量和其他编程元素以便在多个源文件.c 或 .cpp 文件之间共享和重用代码。
头文件通常以 .h 或 .hpp 为扩展名包含了程序中需要共享的声明部分而具体的实现部分则放在源文件(.cpp)中。通过包含头文件多个源文件可以访问和使用这些声明从而实现代码的模块化和组织。
在QuickAssetAction.h里
#include AssetActionUtility.h
如果#include下面有red squigglemeans无法access这个 header file证明这个headerfile在一个我们无法access的module里。
去VS右边的search solution explorer搜索会找到AssetActionUtility.h在Blutility下
Blutility
Blutility 是 Unreal Engine 中的一个功能是 Blueprint Utility 的缩写专门用于创建可以在编辑器内执行的 Blueprint 工具或功能。它允许开发者通过 Blueprint 脚本创建自定义的编辑器实用工具从而自动化一些常见的任务提高工作效率。
去插件的build.cs SuperManager.Build.cs文件里找到PublicDependencyModuleNames.AddRange();部分加入Blutility
此时出现identifierUAssetActionUtility is undefined.证明还有一些private include path我们需要去include
clear search, 然后去到Blutility.Build.cs文件会看到一个
PrivateIncludePaths.Add(Editor/Blutility/Private);
by default, anything in private folder, we do not have the access to, unless we add it to this include path.
去插件的build.cs SuperManager.Build.cs文件里找到 PrivateIncludePaths.AddRange();部分加入System.IO.Path.GetFullPath(Target.RelativeEnginePath)/Source/Editor/Blutility/Private是按private文件层级
System.IO.Path.GetFullPath(Target.RelativeEnginePath)/Source/Editor/Blutility/Private
depending where your engine is installed, the path for the engine folder varies from computer to computer, System.IO.Path.GetFullPath(Target.RelativeEnginePath) this big chunk simply means engine path. 总结在SuperManager.Build.cs里加入如下代码↓ PrivateIncludePaths.AddRange(new string[] {System.IO.Path.GetFullPath(Target.RelativeEnginePath)/Source/Editor/Blutility/Private//D:\\Epic Games\\UE_5.2\\Engine\\Source\\Editor\\Blutility\\Private//Path.Combine(Target.RelativeEnginePath, Source, Editor, Blutility, Private)});PublicDependencyModuleNames.AddRange(new string[]{Core,Blutility// ... add other public dependencies that you statically link with here ...}); 4.DECLARE A FUNCTION放进编辑器中
在QuickAssetAction.h里declare a function如下图我们就可以在右键时加一个按键。
public:UFUNCTION(CallInEditor)void TestFuckingFunc();
};
UFUNCTION(CallInEditor) UFUNCTION 是 Unreal Engine 的一个宏用于向 Unreal Engine 的反射系统注册函数。通过这个宏你可以为函数指定各种属性和功能。 CallInEditor 是这个 UFUNCTION 宏中的修饰符表明该函数可以在 编辑器中 调用。它的作用是在不运行游戏的情况下在 Unreal Editor 的界面中手动触发该函数。常用于创建在编辑器中帮助开发的功能如自动化工具、批量处理任务等。
void TestFuckingFunc(); 这是一个函数声明名为 TestFuckingFunc返回类型为 void即无返回值。这个函数没有参数。 5.编写打印debug message的功能
创建DebugHeader.h 里面声明print和print log两个function然后QuickAssetAction.cpp里调用这个头文件省的一直写GEngine
#pragma oncevoid Print(const FString Message, const FColor Color)
{if (GEngine){GEngine-AddOnScreenDebugMessage(-1, 8.f, Color, Message);}
}void PrintLog(const FString Message)
{UE_LOG(LogTemp, Warning, TEXT(%s),*Message);
} 8.f是debugMessage显示8秒的意思 6.去QuickAssetAction.cpp里具体实现QuickAssetAction.h声明的这个TestFuckingFunc功能
头文件声明函数而具体的实现部分则放在源文件(.cpp)中。 #include AssetAction/QuickAssetAction.h
#include DebugHeader.hvoid UQuickAssetAction::TestFuckingFunc()
{Print(TEXT(I hate the plugin), FColor::Cyan);PrintLog(TEXT(杀杀杀));//if (GEngine) //{// GEngine-AddOnScreenDebugMessage(-1, 8.f, FColor::Yellow, TEXT(I hate this plugin));//}
} key -1
// key 为 0 的调试消息 GEngine-AddOnScreenDebugMessage(0, 5.f, FColor::Green, TEXT(Message with key 0));
// key 为 2 的调试消息 GEngine-AddOnScreenDebugMessage(2, 5.f, FColor::Blue, TEXT(Message with key 2));
// 再次调用 key 为 0会替换之前 key 为 0 的消息 GEngine-AddOnScreenDebugMessage(0, 5.f, FColor::Red, TEXT(Updated message with key 0));
key只会覆盖相同编号的messagewhich means, 下一个key是-1时就会覆盖它 10.这时候创建一个Blueprint右键就可以在Scripted Asset Action里看到自定义的这个TestFuckingFunc 版本bug: 面板没有Scripted Asset Action...黑字英文为讲师回答
This is a bug reappearing in versions above 5.2. To get rid of it, youll need to create an AssetActionUtilityBlueprint asset for debugging.(Valid for 5.3 and above)
这是一个在5.2以上版本重复出现的bug你需要创建一个AssetActionUtilityBlueprint资产用于debug。
1. An AssetActionUtilityBlueprint asset
Go to your plugins content folder. Very important. Not your projects content folder. 亲测直接在content folder里创建EditorUtilityBlueprint (can rename it EUB_dummy) 并reparent也可以parent class改为QuickAssetAction默认的parent class是Asset Action Utilities
Right mouse click your content browser, go to EditorUtilities, select EditorUtilityBlueprint , a window will pop out,select AssetActionUtility, then an asset will appear. Double click to open that asset, click file and select reparent blueprint如下图. In the selection panel, type in the C class we created. In my case, its called QuickAssetAction. Click compile and save, and now you should see ScriptedAssetAction. 2.I cant see new menu entry created after I create a new CallInEditor function in C这个bug我没有遇到
In case you run into this issue as well, you just need to manually open the debug asset we created. Click compile and save again. That should do the trick.
Keep this newly created asset in your plugins content folder during development. 补充GEngine “GEngine” 通常出现在 Unreal Engine虚幻引擎 的 C 编程中。它是一个全局指针指向当前运行的引擎实例允许开发者在代码中访问引擎的各种功能比如日志记录、调试信息输出、渲染管理等。
详细解释
1. GEngine 是什么
在 Unreal Engine 中GEngine 是一个全局变量类型为 UEngine*。它提供了一种访问引擎核心功能的便捷方式。通过 GEngine你可以执行诸如打印调试信息、访问渲染设置、管理游戏状态等操作。
2. 常见用途 打印调试信息 使用 GEngine 可以在游戏窗口中显示调试信息这对于调试非常有用。 if (GEngine)
{GEngine-AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT(Hello, Unreal!));
}//此代码会在游戏屏幕上显示一条持续 5 秒的红色调试信息“Hello, Unreal!”。访问引擎功能 你可以通过 GEngine 访问引擎的各种子系统例如渲染、声音、输入等。 if (GEngine GEngine-GameViewport)
{// 例如获取当前视口大小FVector2D ViewportSize;GEngine-GameViewport-GetViewportSize(ViewportSize);UE_LOG(LogTemp, Log, TEXT(Viewport Size: %f, %f), ViewportSize.X, ViewportSize.Y);
}3. 注意事项 空指针检查 在使用 GEngine 之前最好检查它是否为 nullptr以避免潜在的崩溃。 if (GEngine)
{// 安全地使用 GEngine
}if (GEngine)
{// 安全地使用 GEngineGEngine-AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT(Hello, Unreal!));
}
else
{// 处理 GEngine 为 nullptr 的情况UE_LOG(LogTemp, Warning, TEXT(GEngine is not available.));
}性能考虑 虽然 GEngine 很有用但过度依赖全局变量可能会影响代码的可维护性和测试性。尽量在需要的地方使用并考虑依赖注入或其他设计模式来减少对全局变量的依赖。 仅在适当的上下文中使用 GEngine 通常在游戏运行时有效但在编辑器模式或某些特殊情况下可能不可用。因此确保在适当的上下文中使用它。
4. 示例代码
以下是一个在角色类中使用 GEngine 打印玩家位置的示例
#include GameFramework/Actor.h
#include Engine/Engine.hvoid AMyCharacter::PrintPlayerLocation()
{if (GEngine){FVector Location GetActorLocation();FString LocationString FString::Printf(TEXT(Player Location: X%f, Y%f, Z%f), Location.X, Location.Y, Location.Z);GEngine-AddOnScreenDebugMessage(-1, 5.f, FColor::Green, LocationString);}
}//这个函数获取角色的位置并在屏幕上显示出来持续 5 秒颜色为绿色。总结
总结GEngine 是 Unreal Engine 中一个非常有用的全局指针允许开发者在 C 代码中方便地访问引擎的各种功能。正确使用 GEngine 可以大大简化调试和开发过程但也要注意其使用场景和潜在的风险。 ——————————————————————————————————————————
待更新
1.add prefix
2.batch duplication
3.remove unused assets
4.create editor message
5.dynamically load other modules to help fix up redirectors from code 文章转载自: http://www.morning.bfgbz.cn.gov.cn.bfgbz.cn http://www.morning.mnwmj.cn.gov.cn.mnwmj.cn http://www.morning.sbrjj.cn.gov.cn.sbrjj.cn http://www.morning.kqnwy.cn.gov.cn.kqnwy.cn http://www.morning.llllcc.com.gov.cn.llllcc.com http://www.morning.cfmrb.cn.gov.cn.cfmrb.cn http://www.morning.mqtzd.cn.gov.cn.mqtzd.cn http://www.morning.mjpgl.cn.gov.cn.mjpgl.cn http://www.morning.czcbl.cn.gov.cn.czcbl.cn http://www.morning.dkqyg.cn.gov.cn.dkqyg.cn http://www.morning.xqzrg.cn.gov.cn.xqzrg.cn http://www.morning.wqmpd.cn.gov.cn.wqmpd.cn http://www.morning.iterlog.com.gov.cn.iterlog.com http://www.morning.lxyyp.cn.gov.cn.lxyyp.cn http://www.morning.zqdhr.cn.gov.cn.zqdhr.cn http://www.morning.rjnky.cn.gov.cn.rjnky.cn http://www.morning.tygn.cn.gov.cn.tygn.cn http://www.morning.ctswj.cn.gov.cn.ctswj.cn http://www.morning.rzmzm.cn.gov.cn.rzmzm.cn http://www.morning.zpfqh.cn.gov.cn.zpfqh.cn http://www.morning.ylklr.cn.gov.cn.ylklr.cn http://www.morning.wjxtq.cn.gov.cn.wjxtq.cn http://www.morning.mwlxk.cn.gov.cn.mwlxk.cn http://www.morning.fhqdb.cn.gov.cn.fhqdb.cn http://www.morning.lsnhs.cn.gov.cn.lsnhs.cn http://www.morning.dgwrz.cn.gov.cn.dgwrz.cn http://www.morning.mnjyf.cn.gov.cn.mnjyf.cn http://www.morning.fllfz.cn.gov.cn.fllfz.cn http://www.morning.lfpzs.cn.gov.cn.lfpzs.cn http://www.morning.jpkk.cn.gov.cn.jpkk.cn http://www.morning.tkxr.cn.gov.cn.tkxr.cn http://www.morning.fkflc.cn.gov.cn.fkflc.cn http://www.morning.grtwn.cn.gov.cn.grtwn.cn http://www.morning.ysbrz.cn.gov.cn.ysbrz.cn http://www.morning.lgxzj.cn.gov.cn.lgxzj.cn http://www.morning.qgfhr.cn.gov.cn.qgfhr.cn http://www.morning.rjrz.cn.gov.cn.rjrz.cn http://www.morning.hgtr.cn.gov.cn.hgtr.cn http://www.morning.lgznf.cn.gov.cn.lgznf.cn http://www.morning.nmnhs.cn.gov.cn.nmnhs.cn http://www.morning.bhgnj.cn.gov.cn.bhgnj.cn http://www.morning.wmglg.cn.gov.cn.wmglg.cn http://www.morning.srckl.cn.gov.cn.srckl.cn http://www.morning.jbmbj.cn.gov.cn.jbmbj.cn http://www.morning.krqhw.cn.gov.cn.krqhw.cn http://www.morning.sthgm.cn.gov.cn.sthgm.cn http://www.morning.wftrs.cn.gov.cn.wftrs.cn http://www.morning.tmrjb.cn.gov.cn.tmrjb.cn http://www.morning.tdzxy.cn.gov.cn.tdzxy.cn http://www.morning.cfhwn.cn.gov.cn.cfhwn.cn http://www.morning.wjrtg.cn.gov.cn.wjrtg.cn http://www.morning.qhmhz.cn.gov.cn.qhmhz.cn http://www.morning.rymd.cn.gov.cn.rymd.cn http://www.morning.sxcwc.cn.gov.cn.sxcwc.cn http://www.morning.wzyfk.cn.gov.cn.wzyfk.cn http://www.morning.rwjfs.cn.gov.cn.rwjfs.cn http://www.morning.lxhny.cn.gov.cn.lxhny.cn http://www.morning.mwkwg.cn.gov.cn.mwkwg.cn http://www.morning.gkdhf.cn.gov.cn.gkdhf.cn http://www.morning.rcwbc.cn.gov.cn.rcwbc.cn http://www.morning.ndnhf.cn.gov.cn.ndnhf.cn http://www.morning.lgpzq.cn.gov.cn.lgpzq.cn http://www.morning.mkpkz.cn.gov.cn.mkpkz.cn http://www.morning.xtxp.cn.gov.cn.xtxp.cn http://www.morning.hwprz.cn.gov.cn.hwprz.cn http://www.morning.qmwzr.cn.gov.cn.qmwzr.cn http://www.morning.hrnrx.cn.gov.cn.hrnrx.cn http://www.morning.kxscs.cn.gov.cn.kxscs.cn http://www.morning.sjpbh.cn.gov.cn.sjpbh.cn http://www.morning.rfwrn.cn.gov.cn.rfwrn.cn http://www.morning.tsnmt.cn.gov.cn.tsnmt.cn http://www.morning.lokext.com.gov.cn.lokext.com http://www.morning.rqckh.cn.gov.cn.rqckh.cn http://www.morning.kjsft.cn.gov.cn.kjsft.cn http://www.morning.ygztf.cn.gov.cn.ygztf.cn http://www.morning.tnbsh.cn.gov.cn.tnbsh.cn http://www.morning.fxqjz.cn.gov.cn.fxqjz.cn http://www.morning.xkhhy.cn.gov.cn.xkhhy.cn http://www.morning.kpbgp.cn.gov.cn.kpbgp.cn http://www.morning.rnds.cn.gov.cn.rnds.cn