U4初步使用整理(四)Pawn簡單操作

2021-07-03 15:15:51 字數 983 閱讀 9988

pawn繼承與aactor,能通過玩家輸入和ai驅動。

autopossessplayer = eautoreceiveinput::player0;設定吸收輸入的pawn,新增多個此類pawn,player0取得是最新新增到場景中的pawn.

uproperty屬性可以讓**中變數在ed中可見,同時不會每次跑場景都重新設定變數,賦予editanywhere屬性可以在編輯器中賦值。

乙個控制pawn移動和形變的例子。

uclass()

class basicproj_api amypawn : public apawn

;amypawn::amypawn()

// called when the game starts or when spawned

void amypawn::beginplay()

// called every frame

void amypawn::tick( float deltatime )

else

currentscale = fmath::clamp(currentscale, 1.f, 2.f);

ourvisiblecomponent->setworldscale3d(fvector(currentscale));

if (!currentvelocity.iszero())

}// called to bind functionality to input

void amypawn::setupplayerinputcomponent(class uinputcomponent* inputcomponent)

void amypawn::movex(float delta)

void amypawn::movey(float delta)

void amypawn::startgrow()

void amypawn::stopgrow()

慕課筆記 U4 多型 第5節 UML簡介

第5節 uml簡介 1 uml概念 unified modeling language uml 又稱統一建模語言或標準建模語言,是乙個支援模型化和軟體系統開發的圖形化語言,為軟體開發的所有階段提供模型化和視覺化支援。2 uml圖示 uml2.2中一共定義了14種圖示 diagrams 3 常用uml...

慕課筆記 U4 多型 第6節 綜合練習

一 專案背景介紹 根據所學知識,編寫乙個控制台版的 答答租車系統 功能 1 展示所有可租車輛 2 選擇車型 租車量 3 展示租車清單,包含 總金額 總載貨量及其車型 總載人量及其車型 二 專案分析 1 資料模型分析 2 業務模型分析 3 顯示和流程分析 三 資料模型分析 1 通過對現實世界的事與物主...

django安裝初步使用命令整理

1 pip install django 2 cd c anaconda2 lib site packages django bin 3 python django admin.py startproject helloworld 4cd helloworld 5 python manage.py ...