- Unreal Development Kit Game Programming with UnrealScript:Beginner's Guide
- Rachel Cordone
- 225字
- 2021-08-27 11:59:07
Time for action – Editable variables
- This one's simple. To make a variable changeable in the editor, add a set of parentheses after var, like this:
var() int MyEditableInt;
- Add that variable to our class, then compile and open the editor. Double-click on the AwesomeActor to open up its properties, and we'll see the variable show up.
- We can also put it in a specific category if we wanted to separate our variables into groups. Let's see what it would look like in the Physics tab.
var(Physics) int MyEditableInt;
- Let's compile and take a look.
What just happened?
The level designers don't need to know about every variable an actor has, but some may need to be exposed this way. This is how lights have their brightness and color changed, for instance. When creating an actor class, it's best to give some thought to what a level designer might need to change and give them access to it.
Config variables
That's good for the level designer, but what about the player? Sometimes we want to let the player themselves change a variable. For instance, which hand the character holds the weapon in or the amount of bob as the player walks. We briefly discussed this in the first chapter, but now we'll cover it more in depth. Remember the INI files in the Config folder?
推薦閱讀
- Intel FPGA/CPLD設計(基礎篇)
- Linux KVM虛擬化架構實戰指南
- 電腦常見問題與故障排除
- 電腦常見故障現場處理
- 筆記本電腦維修不是事兒(第2版)
- 筆記本電腦使用、維護與故障排除從入門到精通(第5版)
- 筆記本電腦維修300問
- Machine Learning with Go Quick Start Guide
- Source SDK Game Development Essentials
- IP網絡視頻傳輸:技術、標準和應用
- 嵌入式系統原理及應用:基于ARM Cortex-M4體系結構
- Drupal Rules How-to
- 計算機組成技術教程
- The Reinforcement Learning Workshop
- 基于S5PV210處理器的嵌入式開發完全攻略