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
ad75ebc1
Commit
ad75ebc1
authored
Feb 07, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
0269731f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
101 deletions
+168
-101
PropSelectUI.cs
BoomMaster/Assets/#A2_Scripts/Battle/UI/PropSelectUI.cs
+28
-4
BombStateView.cs
BoomMaster/Assets/#A2_Scripts/Battle/View/BombStateView.cs
+4
-0
BombView.cs
BoomMaster/Assets/#A2_Scripts/Battle/View/BombView.cs
+53
-17
BattleUI.prefab
BoomMaster/Assets/#A3_Prefabs/BattleUI.prefab
+3
-0
Level5.prefab
BoomMaster/Assets/Res/Prefabs/Levels/Level5.prefab
+80
-80
No files found.
BoomMaster/Assets/#A2_Scripts/Battle/UI/PropSelectUI.cs
View file @
ad75ebc1
...
...
@@ -7,9 +7,18 @@ public class PropSelectUI : MonoBehaviour
public
GameObject
m_strengthObj
;
public
GameObject
m_doubleObj
;
public
GameObject
m_coinObj
;
public
GameObject
m_strengthSymbolObj
;
public
GameObject
m_doubleSymbolObj
;
public
GameObject
m_coinSymbolObj
;
private
void
OnEnable
()
{
SetOpenState
();
int
varCoin
=
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
CoinReCordKey
);
m_strengthObj
.
SetActive
(
varCoin
>=
10
);
m_doubleObj
.
SetActive
(
varCoin
>=
20
);
m_coinObj
.
SetActive
(
varCoin
>=
10
);
m_strengthSymbolObj
.
SetActive
(
false
);
m_doubleSymbolObj
.
SetActive
(
false
);
m_coinSymbolObj
.
SetActive
(
false
);
}
//点击加强
public
void
OnClickStrength
()
...
...
@@ -17,6 +26,8 @@ public class PropSelectUI : MonoBehaviour
BattleCtrl
.
instance
.
battleUI
.
SetBombStrength
();
BattleCtrl
.
instance
.
battleUI
.
SetCoin
(-
10
);
SetOpenState
();
m_strengthObj
.
SetActive
(
false
);
m_strengthSymbolObj
.
SetActive
(
true
);
}
//点击double
public
void
OnClickDouble
()
...
...
@@ -24,6 +35,8 @@ public class PropSelectUI : MonoBehaviour
BattleCtrl
.
instance
.
battleUI
.
SetBombDouble
();
BattleCtrl
.
instance
.
battleUI
.
SetCoin
(-
20
);
SetOpenState
();
m_doubleObj
.
SetActive
(
false
);
m_doubleSymbolObj
.
SetActive
(
true
);
}
//点击金币
public
void
OnClickCoin
()
...
...
@@ -31,6 +44,8 @@ public class PropSelectUI : MonoBehaviour
BattleCtrl
.
instance
.
battleUI
.
SetCoinDouble
();
BattleCtrl
.
instance
.
battleUI
.
SetCoin
(-
10
);
SetOpenState
();
m_coinObj
.
SetActive
(
false
);
m_coinSymbolObj
.
SetActive
(
true
);
}
//开始
public
void
OnClickStart
()
...
...
@@ -46,8 +61,17 @@ public class PropSelectUI : MonoBehaviour
void
SetOpenState
()
{
int
varCoin
=
LocalRecord
.
GetIntRecord
(
GlobalConfig
.
CoinReCordKey
);
m_strengthObj
.
SetActive
(
varCoin
>=
10
);
m_doubleObj
.
SetActive
(
varCoin
>=
20
);
m_coinObj
.
SetActive
(
varCoin
>=
10
);
if
(
m_strengthObj
.
activeSelf
)
{
m_strengthObj
.
SetActive
(
varCoin
>=
10
);
}
if
(
m_doubleObj
.
activeSelf
)
{
m_doubleObj
.
SetActive
(
varCoin
>=
20
);
}
if
(
m_coinObj
.
activeSelf
)
{
m_coinObj
.
SetActive
(
varCoin
>=
10
);
}
}
}
BoomMaster/Assets/#A2_Scripts/Battle/View/BombStateView.cs
View file @
ad75ebc1
...
...
@@ -136,6 +136,10 @@ public class BombStateView : MonoBehaviour
m_unrealBombState1Obj
.
SetActive
(
true
);
m_curMat
=
m_unrealBombState2MeshRender
.
material
;
}
}
//shader开始变化
public
void
StartShaderChange
()
{
InvokeRepeating
(
"SetShaderChange"
,
1.0f
,
Time
.
deltaTime
);
}
//shader参数变化
...
...
BoomMaster/Assets/#A2_Scripts/Battle/View/BombView.cs
View file @
ad75ebc1
...
...
@@ -29,6 +29,8 @@ public class BombView : MonoBehaviour
private
Vector2
m_lastInputPos
=
Vector2
.
zero
;
private
Vector3
m_firstBombPos
;
//第一个炸弹位置
private
Vector3
m_secondBombPos
;
//第二个炸弹位置
private
bool
m_bControlDoubleBomb
=
false
;
//控制第二个炸弹的位置
private
Vector3
m_recordSecondBombPos
;
//位置记录
private
void
Awake
()
{
m_totalChildNum
=
m_rootTrans
.
childCount
-
1
;
...
...
@@ -171,6 +173,10 @@ public class BombView : MonoBehaviour
{
CancelInvoke
(
"DrawLine"
);
}
if
(
IsInvoking
(
"TimeLimitStartBomb"
))
{
CancelInvoke
(
"TimeLimitStartBomb"
);
}
m_lstDamage
.
Clear
();
m_lstDamage
=
null
;
}
...
...
@@ -256,23 +262,44 @@ public class BombView : MonoBehaviour
{
if
(
hit
.
collider
.
tag
==
"Target"
&&
m_bCanBePlace
)
{
GameObject
go
=
PoolManager
.
Instance
.
GetObjectFromPool
(
CacheManager
.
Instance
.
rayfireBombObj
);
//go.transform.position = hit.point;
SetBomb
(
go
);
m_bombStateView
.
SetBombModelPos
(
hit
.
point
);
BattleCtrl
.
instance
.
battleUI
.
SetBomb
();
m_lastInputPos
=
Input
.
mousePosition
;
Vector3
varVec3
=
hit
.
point
;
varVec3
.
x
+=
0.1f
;
m_firstBombPos
=
varVec3
;
//是否生成double
if
(
BattleCtrl
.
instance
.
battleUI
.
IsBombDouble
)
if
(!
m_bControlDoubleBomb
)
{
RandomCreateAnotherBomb
();
GameObject
go
=
PoolManager
.
Instance
.
GetObjectFromPool
(
CacheManager
.
Instance
.
rayfireBombObj
);
//go.transform.position = hit.point;
SetBomb
(
go
);
m_bombStateView
.
SetBombModelPos
(
hit
.
point
);
m_lastInputPos
=
Input
.
mousePosition
;
Vector3
varVec3
=
hit
.
point
;
varVec3
.
x
+=
0.1f
;
m_firstBombPos
=
varVec3
;
//是否生成double
if
(
BattleCtrl
.
instance
.
battleUI
.
IsBombDouble
)
{
RandomCreateAnotherBomb
();
m_bControlDoubleBomb
=
true
;
}
else
{
m_bCanBePlace
=
false
;
BattleCtrl
.
instance
.
battleUI
.
SetBomb
();
}
}
else
{
m_bControlDoubleBomb
=
false
;
m_bCanBePlace
=
false
;
BattleCtrl
.
instance
.
battleUI
.
SetBomb
();
//指定位置后开始炸
m_bombStateView
.
SetUnrealBombModelPos
(
hit
.
point
);
m_bombStateView
.
StartShaderChange
();
InvokeRepeating
(
"DrawLine"
,
0.1f
,
0.3f
);
Vector3
varPoint
=
hit
.
point
;
varPoint
.
x
+=
0.1f
;
m_secondBombPos
=
varPoint
;
//指定后要取消判定
if
(
IsInvoking
(
"TimeLimitStartBomb"
))
{
CancelInvoke
(
"TimeLimitStartBomb"
);
}
}
}
}
...
...
@@ -295,13 +322,10 @@ public class BombView : MonoBehaviour
{
if
(
hit
.
collider
.
tag
==
"Target"
&&
m_bCanBePlace
)
{
m_bCanBePlace
=
false
;
m_bombStateView
.
SetUnrealBombModelPos
(
hit
.
point
);
m_bombStateView
.
SetUnrealBombModel
();
InvokeRepeating
(
"DrawLine"
,
0.1f
,
0.3f
);
Vector3
varPoint
=
hit
.
point
;
varPoint
.
x
+=
0.1f
;
m_secondBombPos
=
varPoint
;
m_recordSecondBombPos
=
hit
.
point
;
Invoke
(
"TimeLimitStartBomb"
,
5.0f
);
}
}
else
...
...
@@ -309,4 +333,16 @@ public class BombView : MonoBehaviour
RandomCreateAnotherBomb
();
}
}
//过5秒自己开始炸,如果玩家没有指定位置
void
TimeLimitStartBomb
()
{
m_bControlDoubleBomb
=
false
;
m_bCanBePlace
=
false
;
BattleCtrl
.
instance
.
battleUI
.
SetBomb
();
//指定位置后开始炸
m_bombStateView
.
StartShaderChange
();
InvokeRepeating
(
"DrawLine"
,
0.1f
,
0.3f
);
Vector3
varPoint
=
m_recordSecondBombPos
;
varPoint
.
x
+=
0.1f
;
m_secondBombPos
=
varPoint
;
}
}
BoomMaster/Assets/#A3_Prefabs/BattleUI.prefab
View file @
ad75ebc1
...
...
@@ -16690,6 +16690,9 @@ MonoBehaviour:
m_strengthObj
:
{
fileID
:
935220169814444094
}
m_doubleObj
:
{
fileID
:
7970116045404573728
}
m_coinObj
:
{
fileID
:
8702548051435287562
}
m_strengthSymbolObj
:
{
fileID
:
2810314833097530004
}
m_doubleSymbolObj
:
{
fileID
:
5021344926088393427
}
m_coinSymbolObj
:
{
fileID
:
859530928958322986
}
---
!u!1
&7863706443067258471
GameObject
:
m_ObjectHideFlags
:
0
...
...
BoomMaster/Assets/Res/Prefabs/Levels/Level5.prefab
View file @
ad75ebc1
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