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 );
    	}
    }
  • 相关阅读:
    SpringBoot前端模板
    Http协议与TCP协议简单理解
    Kafka简介、基本原理、执行流程与使用场景
    初学Kafka工作原理流程介绍
    Redis数据持久化、数据备份、数据的故障恢复
    zookeeper的分布式锁
    eclipse下将maven项目打包为jar(1.不带第三方jar,2.带第三方jar)
    Redis入门篇(安装与启动)
    java操作Redis缓存设置过期时间
    java单例模式实现
  • 原文地址:https://www.cnblogs.com/sunchuankai/p/13266561.html
Copyright © 2011-2022 走看看