1、 fixes lua TriggerTest bug.

This commit is contained in:
zhangcheng 2014-07-16 14:50:35 +08:00
parent e431d4f824
commit 80de57be39
3 changed files with 79 additions and 80 deletions

View File

@ -262,12 +262,12 @@ bool TriggerMng::isEmpty(void) const
}
else
{
rapidjson::Type type = pDataItemArray[i4].GetType(pCocoLoader);
rapidjson::Type type = pDataItemArray[i5].GetType(pCocoLoader);
if (type == rapidjson::kStringType)
{
dataitem.AddMember("value", str3, allocator);
}
else if(type == rapidjson::kNumberType)
else
{
int nV = atoi(str3);
float fV = atof(str3);

View File

@ -255,7 +255,7 @@ void TriggerObj::serialize(const rapidjson::Value &val)
{
if (str0 != nullptr)
{
_id = atoi(str0); //(unsigned int)(DICTOOL->getIntValue_json(val, "id"));
_id = atoi(str0);
}
}
else if (key.compare("conditions") == 0)

View File

@ -174,6 +174,7 @@ function SceneEditorTestLayer:createMenu()
if sceneEditorTestIdx == #SceneEditorTestLayer.title then
self:unscheduleUpdate()
ccs.TriggerMng.getInstance():removeAll()
end
SceneEditorTestLayer.fileName = self:loadFileChangeHelper(SceneEditorTestLayer.fileName)
@ -846,13 +847,11 @@ function TriggerTest:onEnter()
ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_UPDATESCENE)
end
self:scheduleUpdateWithPriorityLua(update,0)
ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_ENTERSCENE)
end
end
function TriggerTest:defaultPlay()
ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_ENTERSCENE)
end
function TriggerTest:onExit()