Unreal uc脚本的一些使用方法

1. editconst关键字能使变量可见又不能被编辑
eg. var() editconst int TestValue;

2. 结构体中使用默认值
struct native TestClass
{
    var() float TestValue;

    structdefaultproperties
    {
        TestValue = 1.0f;
    }
}

3. private
uc: var private{private} Pawn m_Pawn; ==>
h: private: class APawn* m_Pawn;

4.
uc: var AnimController m_Channels[6]; ==>
h: public: struct FAnimController m_Channels[6];

5. 使用默认值
event ChangeWalkRunAnim(optional name walkAnim = 'None', optional name runAnim = 'None')
{
m_Pawn.m_Behavior.ChangeWalkRunAnim(walkAnim, runAnim);
}

6. delegate代理
http://udn.epicgames.com/Three/UnrealScriptDelegatesCH.html

7.
uc: var const native private{private} transient Map_Mirror m_LoopCountMap{TMap}; =>
h:  private: TMap m_LoopCountMap;

8. simulated

9. final 
绝对不会被子类重载

10. state/auto state

11. latent

12. Goto/GotoState
Goto跳到状态中的标签
GotoState跳到指定状态,如果未指定状态标签则从begin开始

13.
var native map{ INT, INT }

你可能感兴趣的:(Unreal uc脚本的一些使用方法)