官术网_书友最值得收藏!

Time for action – Editable variables

  1. This one's simple. To make a variable changeable in the editor, add a set of parentheses after var, like this:
    var() int MyEditableInt;
  2. 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.
    Time for action – Editable variables
  3. 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;
  4. Let's compile and take a look.
    Time for action – Editable variables

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?

主站蜘蛛池模板: 南华县| 洮南市| 改则县| 邯郸县| 景东| 曲麻莱县| 齐齐哈尔市| 泗洪县| 宁津县| 牟定县| 庐江县| 宜兰县| 淳安县| 开远市| 芜湖市| 瑞金市| 哈巴河县| 夏邑县| 二连浩特市| 永嘉县| 乌鲁木齐县| 灌南县| 罗定市| 毕节市| 同仁县| 唐海县| 宽甸| 山阴县| 偏关县| 怀安县| 吉隆县| 南郑县| 吴忠市| 台前县| 临安市| 松桃| 高陵县| 贵港市| 新宁县| 肇源县| 西宁市|