소스 검색

Merge remote-tracking branch 'origin/master'

NathanSweet 9 년 전
부모
커밋
9ff1d11e1b
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      spine-lua/AnimationState.lua

+ 4 - 4
spine-lua/AnimationState.lua

@@ -65,7 +65,7 @@ function AnimationState.new (data)
 		end
 		end
 
 
 		self.tracks[index] = entry
 		self.tracks[index] = entry
-		self.trackCount = math.max(self.trackCount, index)
+		self.trackCount = math.max(self.trackCount, index + 1)
 
 
 		if entry.onStart then entry.onStart(index) end
 		if entry.onStart then entry.onStart(index) end
 		if self.onStart then self.onStart(index) end
 		if self.onStart then self.onStart(index) end
@@ -73,7 +73,7 @@ function AnimationState.new (data)
 
 
 	function self:update (delta)
 	function self:update (delta)
 		delta = delta * self.timeScale
 		delta = delta * self.timeScale
-		for i = 0, self.trackCount do
+		for i = 0, self.trackCount - 1 do
 			local current = self.tracks[i]
 			local current = self.tracks[i]
 			if current then
 			if current then
 				current.time = current.time + delta * current.timeScale
 				current.time = current.time + delta * current.timeScale
@@ -96,7 +96,7 @@ function AnimationState.new (data)
 	end
 	end
 
 
 	function self:apply(skeleton)
 	function self:apply(skeleton)
-		for i = 0, self.trackCount do
+		for i = 0, self.trackCount - 1 do
 			local current = self.tracks[i]
 			local current = self.tracks[i]
 			if current then
 			if current then
 				local time = current.time
 				local time = current.time
@@ -211,7 +211,7 @@ function AnimationState.new (data)
 			end
 			end
 			last.next = entry
 			last.next = entry
 		else
 		else
-			self.tracks[trackIndex] = entry
+			setCurrent(trackIndex, entry)
 		end
 		end
 
 
 		delay = delay or 0
 		delay = delay or 0