音效提交
parent
99861a2235
commit
35d0f1337f
Binary file not shown.
|
@ -42,6 +42,11 @@ function SingleStoryPlayerView:SetData(data,playerType)
|
||||||
|
|
||||||
self.gameObject.transform.localPosition = self.startPos
|
self.gameObject.transform.localPosition = self.startPos
|
||||||
self.gameObject.transform.localScale = Vector3.one * 1.5
|
self.gameObject.transform.localScale = Vector3.one * 1.5
|
||||||
|
|
||||||
|
self._PlayTimeStamp = {
|
||||||
|
[0] = 0,
|
||||||
|
[1] = 0
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function SingleStoryPlayerView:SetRoads0(data)
|
function SingleStoryPlayerView:SetRoads0(data)
|
||||||
|
@ -134,7 +139,6 @@ function SingleStoryPlayerView:SetRoads1(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SingleStoryPlayerView:RunMap(isSetRoleDir)
|
function SingleStoryPlayerView:RunMap(isSetRoleDir)
|
||||||
self._PlayTimeStamp = 0
|
|
||||||
self.roadsIndex = 0
|
self.roadsIndex = 0
|
||||||
self.state = 1
|
self.state = 1
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
|
@ -182,19 +186,37 @@ function SingleStoryPlayerView:RunMap(isSetRoleDir)
|
||||||
end
|
end
|
||||||
self:StackPop()
|
self:StackPop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SingleStoryPlayerView:PlaySound(time,Sound,curTimeStamp,timeStamp)
|
||||||
|
LogGreen("curTimeStamp:"..curTimeStamp.." timeStamp:"..timeStamp.." curTimeStamp - timeStamp:"..curTimeStamp - timeStamp)
|
||||||
|
if curTimeStamp - timeStamp >= time then
|
||||||
|
LogGreen("播放音效:"..Sound)
|
||||||
|
SoundManager.PlaySound(Sound)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
function SingleStoryPlayerView:PlayStepSound(indexType,isSetRoleDir)
|
function SingleStoryPlayerView:PlayStepSound(indexType,isSetRoleDir)
|
||||||
local curTimeStamp = GetTimeStamp()
|
local curTimeStamp = GetTimeStamp()
|
||||||
if curTimeStamp - self._PlayTimeStamp >= 0.5 then
|
if indexType == 0 then
|
||||||
self._PlayTimeStamp = curTimeStamp
|
self.isSet = self:PlaySound(1,(isSetRoleDir == 10 and SoundConfig.STORY_VOICE_1_4 or SoundConfig.STORY_FOOT_1_2),curTimeStamp,self._PlayTimeStamp[0])
|
||||||
if indexType == 0 then
|
if self.isSet then
|
||||||
if isSetRoleDir == 10 then
|
self._PlayTimeStamp[0] = curTimeStamp
|
||||||
SoundManager.PlaySound(SoundConfig.STORY_VOICE_1_4)
|
end
|
||||||
else
|
elseif indexType == 1 then
|
||||||
SoundManager.PlaySound(SoundConfig.STORY_FOOT_1_2)
|
self.isSet = self:PlaySound(0.2,SoundConfig.STORY_FOOT_1_1,curTimeStamp,self._PlayTimeStamp[1])
|
||||||
end
|
if self.isSet then
|
||||||
else
|
self._PlayTimeStamp[1] = curTimeStamp
|
||||||
SoundManager.PlaySound(SoundConfig.STORY_FOOT_1_1)
|
end
|
||||||
end
|
else
|
||||||
|
self.isSet = self:PlaySound(1,(isSetRoleDir == 10 and SoundConfig.STORY_VOICE_1_4 or SoundConfig.STORY_FOOT_1_2),curTimeStamp,self._PlayTimeStamp[0])
|
||||||
|
if self.isSet then
|
||||||
|
self._PlayTimeStamp[0] = curTimeStamp
|
||||||
|
end
|
||||||
|
self.isSet = self:PlaySound(0.2,SoundConfig.STORY_FOOT_1_1,curTimeStamp,self._PlayTimeStamp[1])
|
||||||
|
if self.isSet then
|
||||||
|
self._PlayTimeStamp[1] = curTimeStamp
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 角色相关
|
-- 角色相关
|
||||||
|
|
Loading…
Reference in New Issue