コード例 #1
0
	int Instance::lua_Destroy(lua_State* L){
		Instance* inst = checkInstance(L, 1);
		if(inst){
			inst->Destroy();
			return 0;
		}
		return luaL_error(L, COLONERR, "Destroy");
	}
コード例 #2
0
	void Instance::Destroy(){
		setParent(NULL);
		ParentLocked = true;
		Changed->disconnectAll();
		for(std::vector<Instance*>::size_type i = 0; i != children.size(); i++){
			Instance* kid = children[i];
			if(kid != NULL){
				kid->Destroy();
			}
		}
	}