|
#注册molang变量
comp = clientApi.GetEngineCompFactory().CreateQueryVariable(clientApi.GetLevelId())
comp.Register('query.mod.haimian', 0.0)
#更改molang变量的值, 同一个实体
comp = clientApi.GetEngineCompFactory().CreateQueryVariable(entityId)
comp.Set('query.mod.haimian', 2.0)
result = comp.Get("query.mod.haimian") #result == 2.0
#退出游戏重进游戏后
result = comp.Get("query.mod.haimian") #result == 0
|
|