zoukankan      html  css  js  c++  java
  • UE4源码摘录(424)

    https://docs.unrealengine.com/en-US/Programming/Introduction/index.html

    UE4 prefix:

    • Classes derived from Actor prefixed with A, such as AController.

    • Classes derived from Object are prefixed with U, such as UComponent.

    • Enums are prefixed with E, such as EFortificationType.

    • Interface classes are usually prefixed with I, such as IAbilitySystemInterface.

    • Template classes are prefixed by T, such as TArray.

    • Classes that derive from SWidget (Slate UI) are prefixed by S, such as SButton.

    • Everything else is prefixed by the letter F , such as FVector.

    Letter F:

    This gets asked all the time and I thought I would share the official story, as I remember wondering the same thing.

    'U' stands for UObject, 'A' stands for actor, 'T' stands for Template. Everyone gets that. But what does 'F' stand for? It's used almost everywhere else!

    The 'F' prefix actually stands for "Float" (as in Floating Point.)

    Tim Sweeney wrote the original "FVector" class along with many of the original math classes, and the 'F' prefix was useful to distinguish from math constructs that would support either integers or doubles, even before such classes were written. Much of the engine code dealt with floating point values, so the pattern spread quickly to other new engine classes at the time, then eventually became standard everywhere.

    This was in the mid-nineties sometime. Even though most of Unreal Engine has been rewritten a few times over since then, some of the original math classes still resemble their Unreal 1 counterparts, and certain idioms remain part of Epic's coding standard today.

    Just a quick and fun story about Unreal's history I thought I'd share.


    --Mike

    创建对象方法(转载:https://blog.csdn.net/luofeixiongsix/article/details/81061764 )

    Actor:

    UWorld* World = GetWorld();  
    FVector pos(150, 0, 20);  
     //生成Actor
    AMyActor* MyActor = World->SpawnActor<AMyActor>(pos, FRotator::ZeroRotator);
    //创建Component
    MyComponent = CreateDefaultSubobject<UMyActorComponent>(TEXT("MyComponent"));

    //加载资源对象
    UStaticMesh* SM_Vase = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("/Game/Assets/StaticMeshes/SM_Vase")) ); StaticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMeshComponent")); StaticMeshComponent->SetStaticMesh(SM_Vase);

    //创建UObject
    MyObject = NewObject<UMyObject>();

      

    UE4 Commandlet:

    execute project:

    "D:UE_4.24EngineBinariesWin64UE4Editor-Cmd.exe" "D:UE_ProjProj424MyProject2MyProject2.uproject" 

    注意引号

    ContentBrowser import:

    SContentBrowser.cpp 1005

    FReply SContentBrowser::HandleImportClicked()
    {
        ImportAsset( GetCurrentPath() );
        return FReply::Handled();
    }
    void SContentBrowser::ImportAsset( const FString& InPath )
    {
    	if ( ensure( !InPath.IsEmpty() ) )
    	{
    		FAssetToolsModule& AssetToolsModule = FModuleManager::Get().LoadModuleChecked<FAssetToolsModule>( "AssetTools" );
    		AssetToolsModule.Get().ImportAssetsWithDialog( InPath );
    	}
    }
  • 相关阅读:
    cento7快速修改主机名和修改root密码
    [goolegke]nginxingress建立测试
    filebeat安装读取nginx json日志
    MySQL索引背后的数据结构及算法原理
    Lua脚本在redis分布式锁场景的运用
    Sentinel实现限流
    java架构技术流程图
    mybatis数据加解密处理方案
    vue 自定义代码片段
    node项目vue 自动化部署之pm2
  • 原文地址:https://www.cnblogs.com/sunchuankai/p/13266561.html
Copyright © 2011-2022 走看看