44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
/*
|
|
文件名:1.nut
|
|
路径:User/ObjectActScript/MonsterObjectFunc/act1/goblin/1.nut
|
|
创建日期:2024-05-10 20:20
|
|
文件用途:哥布林ACT文件
|
|
*/
|
|
|
|
MonsterObjectFunction.MonsterObject_Create_1 <- function(obj, parent_obj) {
|
|
//注册待机状态
|
|
obj.StateMachine.RegisterStaticState(BASE_STATE.REST, {
|
|
OnStart = GoblinState_Start_Rest.bindenv(obj),
|
|
OnProc = GoblinState_Proc_Rest.bindenv(obj),
|
|
OnEnd = GoblinState_End_Rest.bindenv(obj),
|
|
});
|
|
//注册移动状态
|
|
obj.StateMachine.RegisterStaticState(BASE_STATE.MOVE, {
|
|
OnStart = GoblinState_Start_Move.bindenv(obj),
|
|
OnProc = GoblinState_Proc_Move.bindenv(obj),
|
|
OnEnd = GoblinState_End_Move.bindenv(obj),
|
|
});
|
|
//注册受击状态
|
|
obj.StateMachine.RegisterStaticState(BASE_STATE.DAMAGE, {
|
|
OnStart = GoblinState_Start_Damage.bindenv(obj),
|
|
OnProc = GoblinState_Proc_Damage.bindenv(obj),
|
|
OnEnd = GoblinState_End_Damage.bindenv(obj),
|
|
});
|
|
|
|
//初始化完设置为站立状态
|
|
obj.SetState(BASE_STATE.REST);
|
|
}
|
|
|
|
MonsterObjectFunction.MonsterObject_Proc_1 <- function(obj, dt) {
|
|
// local MyPosition = obj.GetPosition();
|
|
// //左键按下 和 弹起
|
|
// if (Input_IsDown(MouseButton.Right, 0)) {
|
|
// obj.SetPosition(MyPosition.x - 1, MyPosition.y, 0);
|
|
// } else if (Input_IsDown(MouseButton.Left, 0)) {
|
|
// obj.SetPosition(MyPosition.x + 1, MyPosition.y, 0);
|
|
// }
|
|
}
|
|
|
|
MonsterObjectFunction.MonsterObject_Destroy_1 <- function(obj, parent_obj) {
|
|
|
|
} |