Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BoomMaster
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
BoomMaster
Commits
a27163da
Commit
a27163da
authored
Feb 03, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
星级显示
parent
25ef8846
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6415 additions
and
5698 deletions
+6415
-5698
.suo
BoomMaster/.vs/BoomMaster/v16/.suo
+0
-0
DemoScenes.unity
BoomMaster/Assets/#A1_Scenes/DemoScenes.unity
+27
-27
BattleCtrl.cs
BoomMaster/Assets/#A2_Scripts/Battle/BattleCtrl.cs
+19
-6
BattleUI.cs
BoomMaster/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
+8
-2
LevelBtnItem.cs
BoomMaster/Assets/#A2_Scripts/Battle/UI/LevelBtnItem.cs
+13
-4
BombView.cs
BoomMaster/Assets/#A2_Scripts/Battle/View/BombView.cs
+47
-20
LevelCtrl.cs
BoomMaster/Assets/#A2_Scripts/Level/LevelCtrl.cs
+3
-1
BattleUI.prefab
BoomMaster/Assets/#A3_Prefabs/BattleUI.prefab
+6298
-5638
No files found.
BoomMaster/.vs/BoomMaster/v16/.suo
View file @
a27163da
No preview for this file type
BoomMaster/Assets/#A1_Scenes/DemoScenes.unity
View file @
a27163da
...
@@ -282,7 +282,7 @@ MonoBehaviour:
...
@@ -282,7 +282,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
eac3ab1cd8d56dc4fb10ca3966649e25
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
eac3ab1cd8d56dc4fb10ca3966649e25
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
battleUI
:
{
fileID
:
6598198701804661606
}
battleUI
:
{
fileID
:
2163652508806551532
}
m_levelManager
:
{
fileID
:
186647396
}
m_levelManager
:
{
fileID
:
186647396
}
---
!u!1
&1872965180
---
!u!1
&1872965180
GameObject
:
GameObject
:
...
@@ -329,7 +329,7 @@ MonoBehaviour:
...
@@ -329,7 +329,7 @@ MonoBehaviour:
m_Script
:
{
fileID
:
11500000
,
guid
:
65d718b4fac224944ad7728793e3fdc7
,
type
:
3
}
m_Script
:
{
fileID
:
11500000
,
guid
:
65d718b4fac224944ad7728793e3fdc7
,
type
:
3
}
m_Name
:
m_Name
:
m_EditorClassIdentifier
:
m_EditorClassIdentifier
:
pad
:
{
fileID
:
6598198702626774329
}
pad
:
{
fileID
:
2163652508018123187
}
---
!u!114
&1872965183
---
!u!114
&1872965183
MonoBehaviour
:
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -358,31 +358,7 @@ MonoBehaviour:
...
@@ -358,31 +358,7 @@ MonoBehaviour:
type
:
3
}
type
:
3
}
m_rayfireBombObj
:
{
fileID
:
7079061562166580387
,
guid
:
6494bd2f9be30d54ab414db21e0d1beb
,
m_rayfireBombObj
:
{
fileID
:
7079061562166580387
,
guid
:
6494bd2f9be30d54ab414db21e0d1beb
,
type
:
3
}
type
:
3
}
---
!u!114
&6598198701804661606
stripped
---
!u!1001
&792154237216420726
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464677632144694
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
8411132485852915138
}
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!114
&6598198702626774329
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464676810081129
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
8411132485852915138
}
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!1001
&8411132485852915138
PrefabInstance
:
PrefabInstance
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
serializedVersion
:
2
serializedVersion
:
2
...
@@ -501,3 +477,27 @@ PrefabInstance:
...
@@ -501,3 +477,27 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
---
!u!114
&2163652508018123187
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464676810081129
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
792154237216420726
}
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
&2163652508806551532
stripped
MonoBehaviour
:
m_CorrespondingSourceObject
:
{
fileID
:
6064464677632144694
,
guid
:
919382978f5e2684ba83e6daf6491458
,
type
:
3
}
m_PrefabInstance
:
{
fileID
:
792154237216420726
}
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
:
BoomMaster/Assets/#A2_Scripts/Battle/BattleCtrl.cs
View file @
a27163da
...
@@ -117,18 +117,31 @@ public class BattleCtrl : MonoBehaviour
...
@@ -117,18 +117,31 @@ public class BattleCtrl : MonoBehaviour
{
{
_IsEndBattle
=
true
;
_IsEndBattle
=
true
;
battleUI
.
OnBattleWin
();
battleUI
.
OnBattleWin
();
int
varCurTime
=
(
int
)
levelManager
.
curLevel
.
bestTime
;
//int varCurTime = (int)levelManager.curLevel.bestTime;
if
(
LocalRecord
.
HasKey
(
levelManager
.
CurLevelIndex
.
ToString
()))
//if(LocalRecord.HasKey(levelManager.CurLevelIndex.ToString()))
//{
// int varBestTime = LocalRecord.GetIntRecord(levelManager.CurLevelIndex.ToString());
// if (varCurTime < varBestTime)
// {
// LocalRecord.SetIntRecord(levelManager.CurLevelIndex.ToString(), varCurTime);
// }
//}
//else
//{
// LocalRecord.SetIntRecord(levelManager.CurLevelIndex.ToString(), varCurTime);
//}
int
varCurStar
=
levelManager
.
curLevel
.
star
;
if
(
LocalRecord
.
HasKey
(
levelManager
.
CurLevelIndex
.
ToString
()))
{
{
int
varBest
Time
=
LocalRecord
.
GetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
());
int
varBest
Star
=
LocalRecord
.
GetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
());
if
(
varCur
Time
<
varBestTime
)
if
(
varCur
Star
>
varBestStar
)
{
{
LocalRecord
.
SetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
(),
varCur
Time
);
LocalRecord
.
SetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
(),
varCur
Star
);
}
}
}
}
else
else
{
{
LocalRecord
.
SetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
(),
varCur
Time
);
LocalRecord
.
SetIntRecord
(
levelManager
.
CurLevelIndex
.
ToString
(),
varCur
Star
);
}
}
//curLevel.battleView.playerView.OnWin();
//curLevel.battleView.playerView.OnWin();
}
}
...
...
BoomMaster/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
View file @
a27163da
...
@@ -37,6 +37,7 @@ public class BattleUI : MonoBehaviour
...
@@ -37,6 +37,7 @@ public class BattleUI : MonoBehaviour
public
GameObject
m_HideMouseObj
;
//隐藏手指图标obj
public
GameObject
m_HideMouseObj
;
//隐藏手指图标obj
public
GameObject
[]
m_boomUIS
;
//爆炸Ui
public
GameObject
[]
m_boomUIS
;
//爆炸Ui
public
Button
m_boomBtn
;
//炸弹按钮
public
Button
m_boomBtn
;
//炸弹按钮
public
Transform
m_starParent
;
//星级
public
Action
onStartBtn
;
public
Action
onStartBtn
;
public
Action
onPosUpBtn
;
public
Action
onPosUpBtn
;
public
Action
onPosDownBtn
;
public
Action
onPosDownBtn
;
...
@@ -185,8 +186,12 @@ public class BattleUI : MonoBehaviour
...
@@ -185,8 +186,12 @@ public class BattleUI : MonoBehaviour
{
{
m_successObj
.
SetActive
(
true
);
m_successObj
.
SetActive
(
true
);
m_selectLevelObj
.
SetActive
(
false
);
m_selectLevelObj
.
SetActive
(
false
);
int
varCurTime
=
(
int
)
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
bestTime
;
int
varCurStar
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
star
;
m_gameBestTime
.
text
=
string
.
Format
(
"{0:d2}:{1:d2}"
,
varCurTime
/
60
,
varCurTime
%
60
);
for
(
int
i
=
0
;
i
<
m_starParent
.
childCount
;
i
++)
{
m_starParent
.
GetChild
(
i
).
gameObject
.
SetActive
(
i
<
varCurStar
);
}
//m_gameBestTime.text = string.Format("{0:d2}:{1:d2}", varCurTime / 60, varCurTime % 60);
//string varKey = BattleCtrl.instance.levelManager.CurLevelIndex.ToString();
//string varKey = BattleCtrl.instance.levelManager.CurLevelIndex.ToString();
//if (LocalRecord.HasKey(varKey))
//if (LocalRecord.HasKey(varKey))
//{
//{
...
@@ -299,6 +304,7 @@ public class BattleUI : MonoBehaviour
...
@@ -299,6 +304,7 @@ public class BattleUI : MonoBehaviour
m_boomUIS
[
m_bombIndex
].
SetActive
(
false
);
m_boomUIS
[
m_bombIndex
].
SetActive
(
false
);
m_bombIndex
++;
m_bombIndex
++;
Invoke
(
"OnClickBoomBtn"
,
1.5f
);
}
}
//点击爆破按钮
//点击爆破按钮
public
void
OnClickBoomBtn
()
public
void
OnClickBoomBtn
()
...
...
BoomMaster/Assets/#A2_Scripts/Battle/UI/LevelBtnItem.cs
View file @
a27163da
...
@@ -5,19 +5,28 @@ using UnityEngine.UI;
...
@@ -5,19 +5,28 @@ using UnityEngine.UI;
public
class
LevelBtnItem
:
MonoBehaviour
public
class
LevelBtnItem
:
MonoBehaviour
{
{
public
Text
m_gameBestTime
;
//public Text m_gameBestTime;
public
Transform
m_starParent
;
public
int
m_level
;
public
int
m_level
;
private
void
OnEnable
()
private
void
OnEnable
()
{
{
string
varKey
=
m_level
.
ToString
();
string
varKey
=
m_level
.
ToString
();
if
(
LocalRecord
.
HasKey
(
varKey
))
if
(
LocalRecord
.
HasKey
(
varKey
))
{
{
int
varBestTime
=
LocalRecord
.
GetIntRecord
(
varKey
);
int
varBestStar
=
LocalRecord
.
GetIntRecord
(
varKey
);
m_gameBestTime
.
text
=
string
.
Format
(
"{0:d2}:{1:d2}"
,
varBestTime
/
60
,
varBestTime
%
60
);
for
(
int
i
=
0
;
i
<
m_starParent
.
childCount
;
i
++)
{
m_starParent
.
GetChild
(
i
).
gameObject
.
SetActive
(
i
<
varBestStar
);
}
//m_gameBestTime.text = string.Format("{0:d2}:{1:d2}", varBestTime / 60, varBestTime % 60);
}
}
else
else
{
{
m_gameBestTime
.
text
=
string
.
Format
(
"{0:d2}:{1:d2}"
,
99
,
99
);
//m_gameBestTime.text = string.Format("{0:d2}:{1:d2}", 99, 99);
for
(
int
i
=
0
;
i
<
m_starParent
.
childCount
;
i
++)
{
m_starParent
.
GetChild
(
i
).
gameObject
.
SetActive
(
false
);
}
}
}
}
}
public
void
OnClickLevel
(
int
level
)
public
void
OnClickLevel
(
int
level
)
...
...
BoomMaster/Assets/#A2_Scripts/Battle/View/BombView.cs
View file @
a27163da
...
@@ -15,7 +15,7 @@ public class BombView : MonoBehaviour
...
@@ -15,7 +15,7 @@ public class BombView : MonoBehaviour
private
int
m_totalChildNum
=
0
;
//总数
private
int
m_totalChildNum
=
0
;
//总数
private
bool
m_bControlWin
=
true
;
//控制成功
private
bool
m_bControlWin
=
true
;
//控制成功
private
bool
m_bControlFail
=
true
;
//控制失败
private
bool
m_bControlFail
=
true
;
//控制失败
private
float
m_rate
=
0.
2
f
;
//百分比
private
float
m_rate
=
0.
4
f
;
//百分比
private
float
m_rotateSpeed
=
10.0f
;
//旋转速度
private
float
m_rotateSpeed
=
10.0f
;
//旋转速度
private
float
m_curRotateAngle
=
0.0f
;
//当前旋转角度
private
float
m_curRotateAngle
=
0.0f
;
//当前旋转角度
private
float
m_lastRotateAngle
=
0.0f
;
//之前的旋转角度
private
float
m_lastRotateAngle
=
0.0f
;
//之前的旋转角度
...
@@ -26,22 +26,26 @@ public class BombView : MonoBehaviour
...
@@ -26,22 +26,26 @@ public class BombView : MonoBehaviour
private
void
Start
()
private
void
Start
()
{
{
GameServices
.
inputService
.
pad
.
onMoveVec3
+=
OnMove
;
GameServices
.
inputService
.
pad
.
onMoveVec3
+=
OnMove
;
if
(
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
==
LevelEnum
.
levelFourIndex
)
//if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{
//{
m_rate
=
0.3f
;
// m_rate = 0.4f;
}
//}
else
if
(
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
==
LevelEnum
.
levelFiveIndex
)
//else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{
//{
m_rate
=
0.4f
;
// m_rate = 0.5f;
}
//}
else
if
(
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
==
LevelEnum
.
levelSixIndex
)
//else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelSixIndex)
{
//{
m_rate
=
0.65f
;
// m_rate = 0.7f;
}
//}
else
//else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{
//{
m_rate
=
0.2f
;
// m_rate = 0.3f;
}
//}
//else
//{
// m_rate = 0.2f;
//}
}
}
//移动
//移动
void
OnMove
(
Vector3
dir
)
void
OnMove
(
Vector3
dir
)
...
@@ -122,11 +126,34 @@ public class BombView : MonoBehaviour
...
@@ -122,11 +126,34 @@ public class BombView : MonoBehaviour
m_lastRotateAngle
=
m_curRotateAngle
;
m_lastRotateAngle
=
m_curRotateAngle
;
}
}
//Debug.LogError(m_rootTrans.childCount + "................." + m_totalChildNum);
//Debug.LogError(m_rootTrans.childCount + "................." + m_totalChildNum);
if
(
m_
rootTrans
.
childCount
<=
m_totalChildNum
*
m_rate
&&
m_
bControlWin
)
if
(
m_bControlWin
)
{
{
m_bControlWin
=
false
;
if
(
m_rootTrans
.
childCount
<=
m_totalChildNum
*
0.2f
)
BattleCtrl
.
instance
.
OnBattleWin
();
{
m_bControlWin
=
false
;
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
star
=
3
;
BattleCtrl
.
instance
.
OnBattleWin
();
}
else
if
(
m_rootTrans
.
childCount
>
m_totalChildNum
*
0.2f
&&
m_rootTrans
.
childCount
<=
m_totalChildNum
*
0.3f
&&
BattleCtrl
.
instance
.
battleUI
.
IsLeftEmtryBomb
&&
!
BattleCtrl
.
instance
.
battleUI
.
IsBombButtonCanInteractable
)
{
m_bControlWin
=
false
;
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
star
=
2
;
BattleCtrl
.
instance
.
OnBattleWin
();
}
else
if
(
m_rootTrans
.
childCount
>
m_totalChildNum
*
0.3f
&&
m_rootTrans
.
childCount
<=
m_totalChildNum
*
0.4f
&&
BattleCtrl
.
instance
.
battleUI
.
IsLeftEmtryBomb
&&
!
BattleCtrl
.
instance
.
battleUI
.
IsBombButtonCanInteractable
)
{
m_bControlWin
=
false
;
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
star
=
1
;
BattleCtrl
.
instance
.
OnBattleWin
();
}
}
}
//if(m_rootTrans.childCount <= m_totalChildNum* m_rate && m_bControlWin)
//{
// m_bControlWin = false;
// BattleCtrl.instance.OnBattleWin();
//}
if
(
BattleCtrl
.
instance
.
battleUI
.
IsLeftEmtryBomb
&&
!
BattleCtrl
.
instance
.
battleUI
.
IsBombButtonCanInteractable
if
(
BattleCtrl
.
instance
.
battleUI
.
IsLeftEmtryBomb
&&
!
BattleCtrl
.
instance
.
battleUI
.
IsBombButtonCanInteractable
&&
m_rootTrans
.
childCount
>
m_totalChildNum
*
m_rate
&&
m_bControlFail
)
&&
m_rootTrans
.
childCount
>
m_totalChildNum
*
m_rate
&&
m_bControlFail
)
{
{
...
...
BoomMaster/Assets/#A2_Scripts/Level/LevelCtrl.cs
View file @
a27163da
...
@@ -33,6 +33,8 @@ public class LevelCtrl : MonoBehaviour
...
@@ -33,6 +33,8 @@ public class LevelCtrl : MonoBehaviour
private
float
m_bestTime
=
0.0f
;
private
float
m_bestTime
=
0.0f
;
public
float
bestTime
=>
m_bestTime
;
public
float
bestTime
=>
m_bestTime
;
private
int
m_star
=
0
;
public
int
star
{
get
;
set
;
}
//当前关卡星级
...
@@ -80,6 +82,6 @@ public class LevelCtrl : MonoBehaviour
...
@@ -80,6 +82,6 @@ public class LevelCtrl : MonoBehaviour
if
(!
_BattleCtrl
.
inited
||
_BattleCtrl
.
isEndBattle
||
!
_BattleCtrl
.
isStartBattle
)
if
(!
_BattleCtrl
.
inited
||
_BattleCtrl
.
isEndBattle
||
!
_BattleCtrl
.
isStartBattle
)
return
;
return
;
m_bestTime
+=
Time
.
deltaTime
;
//
m_bestTime += Time.deltaTime;
}
}
}
}
\ No newline at end of file
BoomMaster/Assets/#A3_Prefabs/BattleUI.prefab
View file @
a27163da
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