在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
-- 组件行为基础 local Behavior = class("Behavior"); function Behavior:ctor(name) self.owner = nil; self.name = name; self.id = getNextID(); self.isOk = false; end function Behavior:getGameObject( ) return self.owner; end function Behavior:setGameObject(owner) self.owner = owner; self.isOk = true; end function Behavior:getName( ) return name; end function Behavior:deltaTime( ) return CCDirector:sharedDirector():deltaTime(); end function Behavior:performWithDelay(callback, delay) if (self.isOK == false) then echoError("Behavior init after addComponet") return; end local action = Transition.sequence({ CCDelayTime:create(delay), CCCallFunc:create(callback), }) self.owner:runAction(action) return action end return Behavior;
|
请发表评论