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
d971ab1a
Commit
d971ab1a
authored
Dec 28, 2020
by
Yuyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into YuYang
parents
563e82f4
5b55ea73
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
4104 additions
and
3559 deletions
+4104
-3559
DemoScenes.unity
FastMail/Assets/0A1_Scenes/DemoScenes.unity
+42
-129
BattleCtrl.cs
FastMail/Assets/0A2_Scripts/Battle/BattleCtrl.cs
+2
-2
ThirdLevelBoxCollision.cs
...ts/0A2_Scripts/Battle/Collision/ThirdLevelBoxCollision.cs
+11
-2
LevelLimitTrigger.cs
...il/Assets/0A2_Scripts/Battle/Trigger/LevelLimitTrigger.cs
+3
-1
TargetTrigger.cs
FastMail/Assets/0A2_Scripts/Battle/Trigger/TargetTrigger.cs
+3
-2
BattleUI.cs
FastMail/Assets/0A2_Scripts/Battle/UI/BattleUI.cs
+36
-0
SettingPanel.cs
FastMail/Assets/0A2_Scripts/Battle/UI/SettingPanel.cs
+6
-3
ChainRopeView.cs
FastMail/Assets/0A2_Scripts/Battle/View/ChainRopeView.cs
+28
-2
AudioServices.cs
FastMail/Assets/0A2_Scripts/Services/AudioServices.cs
+48
-22
BattleConfig.cs
FastMail/Assets/0A2_Scripts/Services/BattleConfig.cs
+3
-0
BattleUI.prefab
FastMail/Assets/0A3_Prefabs/BattleUI.prefab
+3922
-3396
No files found.
FastMail/Assets/0A1_Scenes/DemoScenes.unity
View file @
d971ab1a
...
...
@@ -121,63 +121,6 @@ NavMeshSettings:
debug
:
m_Flags
:
0
m_NavMeshData
:
{
fileID
:
0
}
---
!u!1001
&44176021
PrefabInstance
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
1384633641988006
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_Name
value
:
TinySauce
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalPosition.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalPosition.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalRotation.x
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalRotation.y
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalRotation.z
value
:
-0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
2
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
4464613669252742
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
0b960778462d34f7283156e4edafb7a2
,
type
:
3
}
---
!u!1
&186647394
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -259,7 +202,7 @@ Transform:
-
{
fileID
:
1872965181
}
-
{
fileID
:
186647395
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
2
m_RootOrder
:
1
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!114
&707446925
MonoBehaviour
:
...
...
@@ -273,38 +216,8 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
eac3ab1cd8d56dc4fb10ca3966649e25
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
battleUI
:
{
fileID
:
8344528902126245600
}
battleUI
:
{
fileID
:
9106672011051914353
}
m_levelManager
:
{
fileID
:
186647396
}
---
!u!1
&1859283441
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
44176021
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
1859283442
}
m_Layer
:
0
m_Name
:
TinySauce (Missing Prefab)
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&1859283442
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
44176021
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1859283441
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&1872965180
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -349,8 +262,8 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
65d718b4fac224944ad7728793e3fdc7
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
pad
:
{
fileID
:
8344528901304131775
}
joyStick
:
{
fileID
:
2874693686150493834
}
pad
:
{
fileID
:
9106672010263290414
}
joyStick
:
{
fileID
:
3046733044930327579
}
---
!u!114
&1872965183
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -363,43 +276,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
ff376a18ea419e546ba78667f1b5c6b3
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&2874693686150493834
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
1259541852
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
8990117750319156764
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
c26c7a0dcd8138d4194e0a4435a4740c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&8344528901304131775
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464676810081129
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
8990117750319156764
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
4e3ca8d9f66bfdf4da1bfb54682c658b
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&8344528902126245600
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464677632144694
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
8990117750319156764
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
719c0ad6d83af074a83455f6c88d41e0
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!1001
&8990117750319156764
---
!u!1001
&551544051915097355
PrefabInstance
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
...
...
@@ -449,7 +326,7 @@ PrefabInstance:
-
target
:
{
fileID
:
6064464677632144690
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
1
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
6064464677632144690
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
...
...
@@ -518,3 +395,39 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
---
!u!114
&3046733044930327579
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
1259541852
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
551544051915097355
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
c26c7a0dcd8138d4194e0a4435a4740c
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&9106672010263290414
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464676810081129
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
551544051915097355
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
4e3ca8d9f66bfdf4da1bfb54682c658b
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
---
!u!114
&9106672011051914353
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464677632144694
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
551544051915097355
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
0
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
11500000
,
guid
:
719c0ad6d83af074a83455f6c88d41e0
,
type
:
3
}
m_Name
:
m_EditorClassIdentifier
:
FastMail/Assets/0A2_Scripts/Battle/BattleCtrl.cs
View file @
d971ab1a
...
...
@@ -47,7 +47,7 @@ public class BattleCtrl : MonoBehaviour
//Assert.IsNotNull(battleUI, "battleUI is null");
InitServices
();
Init
();
TinySauce
.
OnGameStarted
();
//
TinySauce.OnGameStarted();
}
void
Start
()
...
...
@@ -196,7 +196,7 @@ public class BattleCtrl : MonoBehaviour
_GameServices
=
null
;
//m_levelManager.curLevel.OnDispose();
//m_levelManager = null;
TinySauce
.
OnGameFinished
(
0
);
//
TinySauce.OnGameFinished(0);
}
}
FastMail/Assets/0A2_Scripts/Battle/Collision/ThirdLevelBoxCollision.cs
View file @
d971ab1a
...
...
@@ -11,6 +11,7 @@ public class ThirdLevelBoxCollision : MonoBehaviour
private
bool
m_bIsTrigger
=
false
;
//是否碰到了目标
private
Vector3
m_pos
=
new
Vector3
(-
0.73f
,
1.19f
,
-
2.54f
);
private
Quaternion
m_rotation
=
Quaternion
.
Euler
(
0
,
83.33f
,
0
);
private
bool
m_bControl
=
true
;
private
void
OnCollisionEnter
(
Collision
other
)
{
if
(
string
.
Equals
(
other
.
gameObject
.
name
,
"Claw"
))
...
...
@@ -37,7 +38,11 @@ public class ThirdLevelBoxCollision : MonoBehaviour
});
if
(
m_bIsTrigger
&&
m_bIsRigid
)
{
BattleCtrl
.
instance
.
OnBattleWin
();
if
(
m_bControl
)
{
m_bControl
=
false
;
BattleCtrl
.
instance
.
OnBattleWin
();
}
//m_targetTrans.localPosition = m_pos;
//m_targetTrans.localRotation = m_rotation;
}
...
...
@@ -49,7 +54,11 @@ public class ThirdLevelBoxCollision : MonoBehaviour
m_bIsTrigger
=
true
;
if
(
m_bIsTrigger
&&
m_bIsRigid
)
{
BattleCtrl
.
instance
.
OnBattleWin
();
if
(
m_bControl
)
{
m_bControl
=
false
;
BattleCtrl
.
instance
.
OnBattleWin
();
}
//m_targetTrans.localPosition = m_pos;
//m_targetTrans.localRotation = m_rotation;
}
...
...
FastMail/Assets/0A2_Scripts/Battle/Trigger/LevelLimitTrigger.cs
View file @
d971ab1a
...
...
@@ -5,14 +5,16 @@ using UnityEngine;
public
class
LevelLimitTrigger
:
MonoBehaviour
{
private
ChainRopeView
m_chainRopeView
;
private
bool
m_bControl
=
true
;
private
void
Start
()
{
m_chainRopeView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
chainRopeView
;
}
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
!
m_chainRopeView
.
IsCatch
)
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
!
m_chainRopeView
.
IsCatch
&&
m_bControl
)
{
m_bControl
=
false
;
BattleCtrl
.
instance
.
OnBattleFail
();
}
}
...
...
FastMail/Assets/0A2_Scripts/Battle/Trigger/TargetTrigger.cs
View file @
d971ab1a
...
...
@@ -4,11 +4,12 @@ using UnityEngine;
public
class
TargetTrigger
:
MonoBehaviour
{
private
bool
m_bControl
=
true
;
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
))
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
m_bControl
)
{
m_bControl
=
false
;
BattleCtrl
.
instance
.
OnBattleWin
();
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
chainRopeView
.
CatchObjEnterTarget
();
}
...
...
FastMail/Assets/0A2_Scripts/Battle/UI/BattleUI.cs
View file @
d971ab1a
...
...
@@ -28,11 +28,16 @@ public class BattleUI : MonoBehaviour
public
Text
m_cameraFieldView
;
public
GameObject
m_battleObj
;
//战斗UI
public
GameObject
m_mouseObj
;
//手势UI
public
Text
m_clawMoveSpeed
;
//爪子移动速度
public
Button
m_settingBtn
;
//设置按钮
public
GameObject
m_settingPanel
;
//设置界面
public
Action
onStartBtn
;
public
Action
onPosUpBtn
;
public
Action
onPosDownBtn
;
public
Action
onFieldFarBtn
;
public
Action
onFieldNearBtn
;
public
Action
onClawMoveSpeedAddBtn
;
public
Action
onClawMoveSpeedDownBtn
;
void
Awake
()
{
m_dragBtn
.
onClick
.
AddListener
(
SetDragMode
);
...
...
@@ -42,11 +47,13 @@ public class BattleUI : MonoBehaviour
m_selectBtn
.
onClick
.
AddListener
(
SelectLevel
);
m_tryAgain
.
onClick
.
AddListener
(
TryAgainLevel
);
m_startBtn
.
onClick
.
AddListener
(
StartBtn
);
m_settingBtn
.
onClick
.
AddListener
(
SettingBtn
);
//m_posUpBtn.onClick.AddListener(PosUpBtn);
//m_posDownBtn.onClick.AddListener(PosDownBtn);
//m_fieldFarBtn.onClick.AddListener(FieldFarBtn);
//m_fieldNearBtn.onClick.AddListener(FieldNearBtn);
GameServices
.
audioServices
.
PlayBgm
(
GameServices
.
configService
.
audioConfig
.
GameBgm
);
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
=
0.8f
;
//开始默认值
}
void
SetDragMode
()
{
...
...
@@ -86,6 +93,18 @@ public class BattleUI : MonoBehaviour
onStartBtn
?.
Invoke
();
m_startBtn
.
gameObject
.
SetActive
(
false
);
m_startLogoObj
.
SetActive
(
false
);
SetBattleObjState
(
true
);
SettingBtnState
(
false
);
}
//设置
void
SettingBtn
()
{
m_settingPanel
.
SetActive
(!
m_settingPanel
.
activeSelf
);
}
//设置按钮状态
public
void
SettingBtnState
(
bool
bool_
)
{
m_settingBtn
.
gameObject
.
SetActive
(
bool_
);
}
//镜头拉上
public
void
PosUpBtn
()
...
...
@@ -127,6 +146,19 @@ public class BattleUI : MonoBehaviour
m_cameraFieldView
.
text
=
string
.
Format
(
"fieldView{0:f1}"
,
varCam
.
fieldOfView
);
}
}
//爪子移动速度增加
public
void
ClawMoveSpeedAddBtn
()
{
onClawMoveSpeedAddBtn
?.
Invoke
();
m_clawMoveSpeed
.
text
=
string
.
Format
(
"系数越小,越快\n{0:f3}"
,
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
);
}
//爪子移动速度减少
public
void
ClawMoveSpeedDownBtn
()
{
onClawMoveSpeedDownBtn
?.
Invoke
();
m_clawMoveSpeed
.
text
=
string
.
Format
(
"系数越小,越快\n{0:f3}"
,
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
);
}
//胜利
public
void
OnBattleWin
()
{
...
...
@@ -178,6 +210,10 @@ public class BattleUI : MonoBehaviour
m_cameraPosY
.
text
=
string
.
Format
(
"pos{0:f3}"
,
varCam
.
transform
.
position
.
y
);
m_cameraFieldView
.
text
=
string
.
Format
(
"fieldView{0:f1}"
,
varCam
.
fieldOfView
);
}
GameServices
.
timerServices
.
Push
(
this
,
1
,
delegate
{
m_clawMoveSpeed
.
text
=
string
.
Format
(
"系数越小,越快\n{0:f3}"
,
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
);
});
}
//设置战斗UI状态
public
void
SetBattleObjState
(
bool
bool_
)
...
...
FastMail/Assets/0A2_Scripts/Battle/UI/SettingPanel.cs
View file @
d971ab1a
...
...
@@ -11,6 +11,7 @@ public class SettingPanel : MonoBehaviour
public
GameObject
m_vibrationImageObj
;
//震动✔
public
GameObject
m_soundImageObj
;
//音效✔
public
GameObject
m_bgmImageObj
;
//背景音乐✔
public
GameObject
m_settingObj
;
//设置按钮
private
void
Awake
()
{
m_vibrationBtn
.
onClick
.
AddListener
(
OnVibrationClick
);
...
...
@@ -26,7 +27,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_vibrationImageObj
.
SetActive
(
tru
e
);
m_vibrationImageObj
.
SetActive
(
fals
e
);
}
string
varStr2
=
GlobalConfig
.
SoundKey
;
if
(
LocalRecord
.
HasKey
(
varStr2
))
...
...
@@ -35,7 +36,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_soundImageObj
.
SetActive
(
tru
e
);
m_soundImageObj
.
SetActive
(
fals
e
);
}
string
varStr3
=
GlobalConfig
.
BgmKey
;
if
(
LocalRecord
.
HasKey
(
varStr3
))
...
...
@@ -44,7 +45,7 @@ public class SettingPanel : MonoBehaviour
}
else
{
m_bgmImageObj
.
SetActive
(
tru
e
);
m_bgmImageObj
.
SetActive
(
fals
e
);
}
}
//震动
...
...
@@ -78,7 +79,9 @@ public class SettingPanel : MonoBehaviour
}
public
void
OnCloseClick
()
{
m_settingObj
.
SetActive
(
false
);
gameObject
.
SetActive
(
false
);
BattleCtrl
.
instance
.
battleUI
.
SetBattleObjState
(
true
);
BattleCtrl
.
instance
.
battleUI
.
SettingBtnState
(
false
);
}
}
FastMail/Assets/0A2_Scripts/Battle/View/ChainRopeView.cs
View file @
d971ab1a
...
...
@@ -119,6 +119,9 @@ public class ChainRopeView : MonoBehaviour
m_rightClawTrans
.
localRotation
=
Quaternion
.
Euler
(
0
,
m_rightClawStartRatateY
,
0
);
m_thumbRT
=
GameServices
.
inputService
.
joyStick
.
thumb
;
//m_threeClawTrans.localRotation = Quaternion.Euler(0, m_threeClawStartRatateY, m_addAngleSpeed);
BattleCtrl
.
instance
.
battleUI
.
onClawMoveSpeedAddBtn
=
onClawMoveSpeedAddBtn
;
BattleCtrl
.
instance
.
battleUI
.
onClawMoveSpeedDownBtn
=
onClawMoveSpeedDownBtn
;
}
//按下鼠标
void
OnClickDown
()
...
...
@@ -128,9 +131,22 @@ public class ChainRopeView : MonoBehaviour
BattleCtrl
.
instance
.
battleUI
.
SetMousePos
(
varX
,
varY
);
}
void
onClawMoveSpeedAddBtn
()
{
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
-=
Time
.
deltaTime
;
}
void
onClawMoveSpeedDownBtn
()
{
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
+=
Time
.
deltaTime
;
}
//移动
void
OnMove
(
Vector3
dir
)
{
//移动区域
if
(
Input
.
mousePosition
.
y
>
Screen
.
height
/
2f
)
{
return
;
}
float
varX
=
Input
.
mousePosition
.
x
-
Screen
.
width
/
2f
;
float
varY
=
Input
.
mousePosition
.
y
-
Screen
.
height
/
2f
;
BattleCtrl
.
instance
.
battleUI
.
SetMousePos
(
varX
,
varY
);
...
...
@@ -149,7 +165,7 @@ public class ChainRopeView : MonoBehaviour
m_rigidBody
.
drag
=
10
;
m_rigidBody
.
angularDrag
=
10
;
}
float
varParamDis
=
Screen
.
width
*
0.8f
/
2
;
//参数距离
float
varParamDis
=
Screen
.
width
*
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
/
2
;
//参数距离
Vector3
varPos
=
m_topCollider
.
transform
.
position
;
//向左滑
if
(
dir
.
x
>
0
)
...
...
@@ -222,12 +238,16 @@ public class ChainRopeView : MonoBehaviour
// 抬起回调
void
OnTouchUp
()
{
//移动区域
if
(
Input
.
mousePosition
.
y
>
Screen
.
height
/
2f
)
{
return
;
}
BattleCtrl
.
instance
.
battleUI
.
SetMousePos
(
0
,
0
);
if
(!
BattleCtrl
.
instance
.
isStartBattle
)
{
return
;
}
m_clawDownOrUpAudioSource
=
GameServices
.
audioServices
.
GetPlayAudioSource
(
GameServices
.
configService
.
audioConfig
.
clawDownOrUp
);
//第五关特殊处理
//if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
//{
...
...
@@ -248,6 +268,7 @@ 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_lightObj
.
SetParent
(
m_clawBody
.
parent
.
parent
);
if
(
m_bIsCatch
)
{
...
...
@@ -438,6 +459,11 @@ public class ChainRopeView : MonoBehaviour
}
DestroyImmediate
(
blueprint
);
DetachHook
();
if
(
m_clawDownOrUpAudioSource
)
{
GameServices
.
audioServices
.
AudioPlayFinished
(
m_clawDownOrUpAudioSource
);
m_clawDownOrUpAudioSource
=
null
;
}
}
/**
...
...
FastMail/Assets/0A2_Scripts/Services/AudioServices.cs
View file @
d971ab1a
...
...
@@ -6,8 +6,11 @@ using UnityEngine;
public
class
AudioServices
:
MonoBehaviour
{
public
AudioSource
bgmSource
;
public
List
<
AudioSource
>
activeSource
=
new
List
<
AudioSource
>();
public
List
<
AudioSource
>
inActiveSouce
=
new
List
<
AudioSource
>();
//public List<AudioSource> activeSource = new List<AudioSource>();
//public List<AudioSource> inActiveSouce = new List<AudioSource>();
Stack
<
AudioSource
>
m_audioSourceStack
=
new
Stack
<
AudioSource
>();
List
<
AudioSource
>
m_lstaudioSource
=
new
List
<
AudioSource
>();
static
AudioServices
m_Instance
;
public
static
AudioServices
instance
...
...
@@ -35,35 +38,55 @@ public class AudioServices : MonoBehaviour
private
AudioSource
GetSource
()
{
AudioSource
source
=
null
;
if
(
inActiveSouce
.
Count
>
0
)
if
(
m_audioSourceStack
.
Count
>
0
)
{
source
=
inActiveSouce
[
0
];
inActiveSouce
.
RemoveAt
(
0
);
activeSource
.
Add
(
source
);
source
=
m_audioSourceStack
.
Pop
();
}
else
{
source
=
transform
.
gameObject
.
AddComponent
<
AudioSource
>();
source
.
playOnAwake
=
false
;
activeSource
.
Add
(
source
);
m_lstaudioSource
.
Add
(
source
);
}
if
(
source
)
{
source
.
volume
=
GlobalConfig
.
isEnableSound
?
1
:
0
;
//根据全局配置设置音量
}
source
.
volume
=
GlobalConfig
.
isEnableSound
?
1
:
0
;
//根据全局配置设置音量
return
source
;
//AudioSource source = null;
//if (inActiveSouce.Count > 0)
//{
// source = inActiveSouce[0];
// inActiveSouce.RemoveAt(0);
// activeSource.Add(source);
//}
//else
//{
// source = transform.gameObject.AddComponent<AudioSource>();
// source.playOnAwake = false;
// activeSource.Add(source);
//}
//source.volume = GlobalConfig.isEnableSound ? 1 : 0; //根据全局配置设置音量
//return source;
}
private
void
RecycleSource
(
AudioSource
source
)
{
source
.
Stop
();
source
.
clip
=
null
;
activeSource
.
Remove
(
source
);
inActiveSouce
.
Add
(
source
);
//activeSource.Remove(source);
//inActiveSouce.Add(source);
if
(
source
)
{
m_audioSourceStack
.
Push
(
source
);
source
.
Stop
();
source
.
clip
=
null
;
}
}
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
;
}
...
...
@@ -91,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
;
}
...
...
@@ -108,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
;
}
...
...
@@ -122,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
;
}
...
...
@@ -138,10 +161,13 @@ public class AudioServices : MonoBehaviour
private
void
OnDestroy
()
{
activeSource
.
Clear
();
inActiveSouce
.
Clear
();
activeSource
=
null
;
inActiveSouce
=
null
;
//
activeSource.Clear();
//
inActiveSouce.Clear();
//
activeSource = null;
//
inActiveSouce = null;
bgmSource
=
null
;
m_lstaudioSource
.
Clear
();
m_lstaudioSource
=
null
;
m_audioSourceStack
=
null
;
}
}
\ No newline at end of file
FastMail/Assets/0A2_Scripts/Services/BattleConfig.cs
View file @
d971ab1a
...
...
@@ -60,6 +60,9 @@ public class PlayerConfig
public
float
cameraMoveSpeed
=
2
;
[
Header
(
"镜头远近速度"
)]
public
float
cameraFieldSpeed
=
2
;
//爪子移动速度
public
float
ClawMoveSpeed
{
get
;
set
;
}
}
[Serializable]
public
class
LevelConfig
...
...
FastMail/Assets/0A3_Prefabs/BattleUI.prefab
View file @
d971ab1a
This diff is collapsed.
Click to expand it.
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