Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Storage
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
Storage
Commits
40ed08b0
Commit
40ed08b0
authored
Mar 17, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
ec68a3f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
26 deletions
+46
-26
BattleUI.cs
Storage/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
+16
-1
StorageView.cs
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
+29
-24
Level1.prefab
Storage/Assets/Res/Levels/Level1.prefab
+1
-1
No files found.
Storage/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
View file @
40ed08b0
...
...
@@ -51,6 +51,7 @@ public class BattleUI : MonoBehaviour
private
int
m_mouseIndex
=
0
;
//点击次数
private
bool
m_bIsShowMouse
=
true
;
//是否显示手指图标
private
int
m_bombIndex
=
0
;
//炸弹计数
private
bool
m_bResult
=
false
;
//结果
public
bool
IsLeftEmtryBomb
{
get
{
return
m_bombIndex
>=
3
;
}
}
//是否不剩炸弹了
public
bool
IsBombButtonCanInteractable
{
get
{
return
m_boomBtn
.
interactable
;
}
}
void
Awake
()
...
...
@@ -257,6 +258,8 @@ public class BattleUI : MonoBehaviour
{
m_clawMoveSpeed
.
text
=
string
.
Format
(
"系数越小,越快\n{0:f3}"
,
GameServices
.
configService
.
playerConfig
.
ClawMoveSpeed
);
});
SetTakeBtnState
(
false
);
m_bResult
=
false
;
}
//设置战斗UI状态
public
void
SetBattleObjState
(
bool
bool_
)
...
...
@@ -321,11 +324,23 @@ public class BattleUI : MonoBehaviour
//take按钮
public
void
OnClickTakeBtn
()
{
if
(
m_bResult
)
{
BattleCtrl
.
instance
.
OnBattleWin
();
}
else
{
BattleCtrl
.
instance
.
OnBattleFail
();
}
}
//设置take按钮状态
public
void
SetTakeBtnState
(
bool
value
)
{
m_takeBtnObj
.
SetActive
(
value
);
}
//结果状态
public
void
SetResultState
(
bool
value
)
{
m_bResult
=
value
;
}
}
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
View file @
40ed08b0
...
...
@@ -71,9 +71,9 @@ public class StorageView : MonoBehaviour
}
private
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
m_curTargetTrans
&&
m_bControlCollisionBox
)
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
m_curTargetTrans
/*&& m_bControlCollisionBox*/
)
{
m_bControlCollisionBox
=
false
;
//
m_bControlCollisionBox = false;
//if (m_dicInsideBox.ContainsKey(m_curTargetTrans) && m_dicInsideBox[m_curTargetTrans])
//{
// m_curTargetTrans.transform.Rotate(transform.up, 90.0f);
...
...
@@ -97,27 +97,27 @@ public class StorageView : MonoBehaviour
}
private
void
OnTriggerExit
(
Collider
other
)
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
m_curTargetTrans
&&
!
m_bControlCollisionBox
)
{
m_bControlCollisionBox
=
true
;
m_hitBoxPoint
=
other
.
ClosestPoint
(
other
.
transform
.
position
);
//if (m_dicInsideBox.ContainsKey(m_curTargetTrans) && m_dicInsideBox[m_curTargetTrans])
//{
// MeshCollider varBox = other.gameObject.GetComponent<MeshCollider>();
// if (m_dicInsideCollisonBox.ContainsKey(varBox))
// {
// m_dicInsideCollisonBox[varBox] = false;
// }
//}
//else
{
//MeshCollider varBox = other.gameObject.GetComponent<MeshCollider>();
//if (m_dicBox.ContainsKey(varBox))
//{
// m_dicBox[varBox] = false;
//}
}
}
//
if (other.gameObject.CompareTag("Target") && m_curTargetTrans && !m_bControlCollisionBox)
//
{
//
m_bControlCollisionBox = true;
//
m_hitBoxPoint = other.ClosestPoint(other.transform.position);
//
//if (m_dicInsideBox.ContainsKey(m_curTargetTrans) && m_dicInsideBox[m_curTargetTrans])
//
//{
//
// MeshCollider varBox = other.gameObject.GetComponent<MeshCollider>();
//
// if (m_dicInsideCollisonBox.ContainsKey(varBox))
//
// {
//
// m_dicInsideCollisonBox[varBox] = false;
//
// }
//
//}
//
//else
//
{
//
//MeshCollider varBox = other.gameObject.GetComponent<MeshCollider>();
//
//if (m_dicBox.ContainsKey(varBox))
//
//{
//
// m_dicBox[varBox] = false;
//
//}
//
}
//
}
}
//放入箱子里面
public
void
InsideBox
(
Collider
other
)
...
...
@@ -246,7 +246,7 @@ public class StorageView : MonoBehaviour
}
m_targetTrans
[
i
].
transform
.
position
=
varPos
;
}
UpdateExitBox
();
//
UpdateExitBox();
}
// 抬起回调
void
OnTouchUp
()
...
...
@@ -277,6 +277,7 @@ public class StorageView : MonoBehaviour
//延时判断是否需要变化材质球
void
DelayMatChangeHandle
()
{
bool
varBool_
=
true
;
for
(
int
i
=
0
;
i
<
m_targetTrans
.
Length
;
i
++)
{
if
(
string
.
Equals
(
m_targetTrans
[
i
].
name
,
m_modelTorchStr
))
...
...
@@ -284,6 +285,7 @@ public class StorageView : MonoBehaviour
if
(
m_targetTrans
[
i
].
transform
.
position
.
y
>=
m_modelTorchOverPosY
)
{
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_redMat
;
varBool_
=
false
;
}
else
{
...
...
@@ -295,6 +297,7 @@ public class StorageView : MonoBehaviour
if
(
m_targetTrans
[
i
].
transform
.
position
.
y
>=
m_modelBinocularOverPosY
)
{
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_redMat
;
varBool_
=
false
;
}
else
{
...
...
@@ -306,6 +309,7 @@ public class StorageView : MonoBehaviour
if
(
m_targetTrans
[
i
].
transform
.
position
.
y
>=
m_modelCompassOverPosY
)
{
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_redMat
;
varBool_
=
false
;
}
else
{
...
...
@@ -313,6 +317,7 @@ public class StorageView : MonoBehaviour
}
}
}
BattleCtrl
.
instance
.
battleUI
.
SetResultState
(
varBool_
);
}
//碰到其他目标
public
void
SetTargetCollison
(
Transform
trans
,
bool
bool_
)
...
...
Storage/Assets/Res/Levels/Level1.prefab
View file @
40ed08b0
...
...
@@ -1161,7 +1161,7 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
6421492585296530445
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
-0.092
,
z
:
0.08
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.88
,
z
:
0.08
}
m_LocalScale
:
{
x
:
3
,
y
:
2
,
z
:
3
}
m_Children
:
[]
m_Father
:
{
fileID
:
7609197319393572573
}
...
...
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