function StateHolder._callTransitionCallbacks(v,F,w)local B=v._callbacks.global if B then local b=B.onLeave local x=B.onEnter if b then b(v,F,w)end if x then x(v,F,w)end end local b=v._callbacks[F]if b and b.onLeave then b.onLeave(v,F,w)end local x=v._callbacks[w]if x and x.onEnter then x.onEnter(v,F,w)end end

function StateHolder:_callTransitionCallbacks(from, to)
	local globalCallback = self._callbacks.global

	if globalCallback then
		local globalLeave = globalCallback.onLeave
		local globalEnter = globalCallback.onEnter

		if globalLeave then
			globalLeave(self, from, to)
		end

		if globalEnter then
			globalEnter(self, from, to)
		end
	end

	local fromCallbacks = self._callbacks[from]

	if fromCallbacks and fromCallbacks.onLeave then
		fromCallbacks.onLeave(self, from, to)
	end

	local toCallbacks = self._callbacks[to]

	if toCallbacks and toCallbacks.onEnter then
		toCallbacks.onEnter(self, from, to)
	end
end
