Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FastMail
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanqing
FastMail
Commits
ab099649
Commit
ab099649
authored
Dec 28, 2020
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音效默认播放,爪子上升下降音效逻辑修改
parent
7e75d0a8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
31 deletions
+50
-31
SettingPanel.cs
FastMail/Assets/0A2_Scripts/Battle/UI/SettingPanel.cs
+3
-3
ChainRopeView.cs
FastMail/Assets/0A2_Scripts/Battle/View/ChainRopeView.cs
+41
-22
AudioServices.cs
FastMail/Assets/0A2_Scripts/Services/AudioServices.cs
+4
-4
BattleConfig.asset
FastMail/Assets/Resources/BattleConfig.asset
+2
-2
No files found.
FastMail/Assets/0A2_Scripts/Battle/UI/SettingPanel.cs
View file @
ab099649
...
...
@@ -27,7 +27,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_vibrationImageObj
.
SetActive
(
fals
e
);
m_vibrationImageObj
.
SetActive
(
tru
e
);
}
string
varStr2
=
GlobalConfig
.
SoundKey
;
if
(
LocalRecord
.
HasKey
(
varStr2
))
...
...
@@ -36,7 +36,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_soundImageObj
.
SetActive
(
fals
e
);
m_soundImageObj
.
SetActive
(
tru
e
);
}
string
varStr3
=
GlobalConfig
.
BgmKey
;
if
(
LocalRecord
.
HasKey
(
varStr3
))
...
...
@@ -45,7 +45,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_bgmImageObj
.
SetActive
(
fals
e
);
m_bgmImageObj
.
SetActive
(
tru
e
);
}
}
//震动
...
...
FastMail/Assets/0A2_Scripts/Battle/View/ChainRopeView.cs
View file @
ab099649
...
...
@@ -70,7 +70,9 @@ public class ChainRopeView : MonoBehaviour
private
RectTransform
m_thumbRT
;
//摇杆
private
Outlinable
m_outlinable
;
//插件脚本
private
bool
m_bIsClawUp
=
false
;
//是否爪子在上升
private
AudioSource
m_clawDownOrUpAudioSource
;
//下降上升音乐,需要循环播放
//private AudioSource m_clawDownOrUpAudioSource;//下降上升音乐,需要循环播放
private
bool
m_bControlPlayAudio
=
true
;
//控制播放音效
void
Awake
()
{
...
...
@@ -268,7 +270,9 @@ public class ChainRopeView : MonoBehaviour
m_thumbRT
.
sizeDelta
=
varThumb
;
if
(
rope
.
isLoaded
&&
rope
.
restLength
<=
m_ropeStartLength
)
{
m_clawDownOrUpAudioSource
=
GameServices
.
audioServices
.
GetPlayAudioSource
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
m_bControlPlayAudio
=
true
;
GameServices
.
audioServices
.
PlayAudio
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
//m_clawDownOrUpAudioSource = GameServices.audioServices.GetPlayAudioSource(GameServices.configService.audioConfig.clawDownOrUp);
m_lightObj
.
SetParent
(
m_clawBody
.
parent
.
parent
);
if
(
m_bIsCatch
)
{
...
...
@@ -459,11 +463,11 @@ public class ChainRopeView : MonoBehaviour
}
DestroyImmediate
(
blueprint
);
DetachHook
();
if
(
m_clawDownOrUpAudioSource
)
{
GameServices
.
audioServices
.
AudioPlayFinished
(
m_clawDownOrUpAudioSource
);
m_clawDownOrUpAudioSource
=
null
;
}
//
if (m_clawDownOrUpAudioSource)
//
{
//
GameServices.audioServices.AudioPlayFinished(m_clawDownOrUpAudioSource);
//
m_clawDownOrUpAudioSource = null;
//
}
}
/**
...
...
@@ -579,16 +583,21 @@ public class ChainRopeView : MonoBehaviour
//抓到的物体放在正确位置后绳子要回去
if
(
rope
.
restLength
>
m_ropeStartLength
)
{
if
(
m_bControlPlayAudio
)
{
m_bControlPlayAudio
=
false
;
GameServices
.
audioServices
.
PlayAudio
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
}
m_bIsClawUp
=
true
;
cursor
.
ChangeLength
(
rope
.
restLength
-
GameServices
.
configService
.
playerConfig
.
ropeReduceSpeed
*
Time
.
deltaTime
);
}
else
{
if
(
m_clawDownOrUpAudioSource
)
{
GameServices
.
audioServices
.
AudioPlayFinished
(
m_clawDownOrUpAudioSource
);
m_clawDownOrUpAudioSource
=
null
;
}
//
if (m_clawDownOrUpAudioSource)
//
{
//
GameServices.audioServices.AudioPlayFinished(m_clawDownOrUpAudioSource);
//
m_clawDownOrUpAudioSource = null;
//
}
m_bIsCatch
=
false
;
m_bIsNeedRotate
=
true
;
m_bIsCathchObjHitTarget
=
false
;
...
...
@@ -607,17 +616,22 @@ public class ChainRopeView : MonoBehaviour
{
if
(
rope
.
restLength
>
m_ropeStartLength
)
{
if
(
m_bControlPlayAudio
)
{
m_bControlPlayAudio
=
false
;
GameServices
.
audioServices
.
PlayAudio
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
}
m_bIsClawUp
=
true
;
cursor
.
ChangeLength
(
rope
.
restLength
-
GameServices
.
configService
.
playerConfig
.
ropeReduceSpeed
*
Time
.
deltaTime
);
}
else
{
SetJoyStickDirectTrans
(
m_topCollider
.
transform
);
if
(
m_clawDownOrUpAudioSource
)
{
GameServices
.
audioServices
.
AudioPlayFinished
(
m_clawDownOrUpAudioSource
);
m_clawDownOrUpAudioSource
=
null
;
}
//
if (m_clawDownOrUpAudioSource)
//
{
//
GameServices.audioServices.AudioPlayFinished(m_clawDownOrUpAudioSource);
//
m_clawDownOrUpAudioSource = null;
//
}
}
}
}
...
...
@@ -651,16 +665,21 @@ public class ChainRopeView : MonoBehaviour
//碰到物体之后爪子最小角度开始绳子缩回去
if
(
rope
.
restLength
>
m_ropeStartLength
)
{
if
(
m_bControlPlayAudio
)
{
m_bControlPlayAudio
=
false
;
GameServices
.
audioServices
.
PlayAudio
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
}
m_bIsClawUp
=
true
;
cursor
.
ChangeLength
(
rope
.
restLength
-
GameServices
.
configService
.
playerConfig
.
ropeReduceSpeed
*
Time
.
deltaTime
);
}
else
{
if
(
m_clawDownOrUpAudioSource
)
{
GameServices
.
audioServices
.
AudioPlayFinished
(
m_clawDownOrUpAudioSource
);
m_clawDownOrUpAudioSource
=
null
;
}
//
if (m_clawDownOrUpAudioSource)
//
{
//
GameServices.audioServices.AudioPlayFinished(m_clawDownOrUpAudioSource);
//
m_clawDownOrUpAudioSource = null;
//
}
m_bIsNeedRotate
=
true
;
ResetLightPos
();
SetJoyStickDirectTrans
(
m_topCollider
.
transform
);
...
...
FastMail/Assets/0A2_Scripts/Services/AudioServices.cs
View file @
ab099649
...
...
@@ -86,7 +86,7 @@ public class AudioServices : MonoBehaviour
public
void
PlayBgm
(
AudioClip
clip
)
{
if
(
!
LocalRecord
.
HasKey
(
GlobalConfig
.
BgmKey
)
||
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
BgmKey
)
==
0
)
if
(
LocalRecord
.
HasKey
(
GlobalConfig
.
BgmKey
)
&&
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
BgmKey
)
==
0
)
{
return
;
}
...
...
@@ -114,7 +114,7 @@ public class AudioServices : MonoBehaviour
public
void
PlayAudio
(
AudioClip
clip
,
bool
isLoop
=
false
,
Action
onPlayEnd
=
null
)
{
if
(
!
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
||
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
if
(
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
&&
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
{
return
;
}
...
...
@@ -131,7 +131,7 @@ public class AudioServices : MonoBehaviour
}
public
AudioSource
GetPlayAudioSource
(
AudioClip
clip
)
{
if
(
!
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
||
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
if
(
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
&&
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
{
return
null
;
}
...
...
@@ -145,7 +145,7 @@ public class AudioServices : MonoBehaviour
public
void
AudioPlayFinished
(
AudioSource
source
)
{
if
(
!
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
||
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
if
(
LocalRecord
.
HasKey
(
GlobalConfig
.
SoundKey
)
&&
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
SoundKey
)
==
0
)
{
return
;
}
...
...
FastMail/Assets/Resources/BattleConfig.asset
View file @
ab099649
...
...
@@ -16,8 +16,8 @@ MonoBehaviour:
moveSpeed
:
1
xDirMinDis
:
-2.5
xDirMaxDis
:
2.5
yDirMinDis
:
-
3
yDirMaxDis
:
3
yDirMinDis
:
-
4.2
yDirMaxDis
:
4.2
clawMaxAngle
:
34
clawRotateSpeed
:
50
ropeReduceSpeed
:
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment