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
9a1b1417
Commit
9a1b1417
authored
Mar 18, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
1b1e0114
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
29 deletions
+36
-29
SecondLevelTrigger.cs
...e/Assets/#A2_Scripts/Battle/Trigger/SecondLevelTrigger.cs
+13
-6
BattleUI.cs
Storage/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
+17
-17
StorageView.cs
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
+6
-6
No files found.
Storage/Assets/#A2_Scripts/Battle/Trigger/SecondLevelTrigger.cs
View file @
9a1b1417
...
@@ -5,27 +5,34 @@ using UnityEngine;
...
@@ -5,27 +5,34 @@ using UnityEngine;
public
class
SecondLevelTrigger
:
MonoBehaviour
public
class
SecondLevelTrigger
:
MonoBehaviour
{
{
private
bool
m_bControl
=
true
;
private
bool
m_bControl
=
true
;
private
List
<
Collider
>
m_lst
=
new
List
<
Collider
>();
private
void
OnTriggerEnter
(
Collider
other
)
private
void
OnTriggerEnter
(
Collider
other
)
{
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
m_bControl
)
if
(
other
.
gameObject
.
CompareTag
(
"Target"
))
{
{
m_bControl
=
false
;
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
if
(
varView
)
if
(
varView
)
{
if
(!
m_lst
.
Contains
(
other
))
{
{
varView
.
EnterTopBox
(
other
.
name
);
varView
.
EnterTopBox
(
other
.
name
);
m_lst
.
Add
(
other
);
}
}
}
}
}
}
}
private
void
OnTriggerExit
(
Collider
other
)
private
void
OnTriggerExit
(
Collider
other
)
{
{
if
(
other
.
gameObject
.
CompareTag
(
"Target"
)
&&
!
m_bControl
)
if
(
other
.
gameObject
.
CompareTag
(
"Target"
))
{
{
m_bControl
=
true
;
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
if
(
varView
)
if
(
varView
)
{
if
(
m_lst
.
Contains
(
other
))
{
{
varView
.
ExitTopBox
(
other
.
name
);
varView
.
ExitTopBox
(
other
.
name
);
m_lst
.
Remove
(
other
);
}
}
}
}
}
}
}
...
...
Storage/Assets/#A2_Scripts/Battle/UI/BattleUI.cs
View file @
9a1b1417
...
@@ -324,26 +324,26 @@ public class BattleUI : MonoBehaviour
...
@@ -324,26 +324,26 @@ public class BattleUI : MonoBehaviour
//take按钮
//take按钮
public
void
OnClickTakeBtn
()
public
void
OnClickTakeBtn
()
{
{
if
(
m_bResult
)
//if (m_bResult)
{
BattleCtrl
.
instance
.
OnBattleWin
();
}
else
{
BattleCtrl
.
instance
.
OnBattleFail
();
}
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
if
(
varView
)
{
//if(varView.hitTopBoxNum > 0)
//{
//{
// BattleCtrl.instance.OnBattleFail
();
// BattleCtrl.instance.OnBattleWin
();
//}
//}
//else
//else
//{
//{
// BattleCtrl.instance.OnBattleWin
();
// BattleCtrl.instance.OnBattleFail
();
//}
//}
varView
.
SetResultAnimator
(
m_bResult
);
StorageView
varView
=
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
storageView
;
if
(
varView
)
{
if
(
varView
.
hitTopBoxNum
>
0
)
{
BattleCtrl
.
instance
.
OnBattleFail
();
}
else
{
BattleCtrl
.
instance
.
OnBattleWin
();
}
varView
.
SetResultAnimator
(
varView
.
hitTopBoxNum
<=
0
);
}
}
}
}
//设置take按钮状态
//设置take按钮状态
...
...
Storage/Assets/#A2_Scripts/Battle/View/StorageView.cs
View file @
9a1b1417
...
@@ -156,7 +156,7 @@ public class StorageView : MonoBehaviour
...
@@ -156,7 +156,7 @@ public class StorageView : MonoBehaviour
if
(
string
.
Equals
(
m_targetTrans
[
i
].
name
,
name
))
if
(
string
.
Equals
(
m_targetTrans
[
i
].
name
,
name
))
{
{
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_redMat
;
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_redMat
;
//
m_hitTopBoxNum++;
m_hitTopBoxNum
++;
break
;
break
;
}
}
}
}
...
@@ -169,7 +169,7 @@ public class StorageView : MonoBehaviour
...
@@ -169,7 +169,7 @@ public class StorageView : MonoBehaviour
if
(
string
.
Equals
(
m_targetTrans
[
i
].
name
,
name
))
if
(
string
.
Equals
(
m_targetTrans
[
i
].
name
,
name
))
{
{
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_dicMat
[
m_targetTrans
[
i
]];
;
m_targetTrans
[
i
].
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_dicMat
[
m_targetTrans
[
i
]];
;
//
m_hitTopBoxNum--;
m_hitTopBoxNum
--;
break
;
break
;
}
}
}
}
...
@@ -350,8 +350,8 @@ public class StorageView : MonoBehaviour
...
@@ -350,8 +350,8 @@ public class StorageView : MonoBehaviour
m_collisonTargetTrans
=
null
;
m_collisonTargetTrans
=
null
;
m_bIsCollisonTarget
=
false
;
m_bIsCollisonTarget
=
false
;
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
0
,
0
);
BattleCtrl
.
instance
.
battleUI
.
SetSymbolPos
(
0
,
0
);
CancelDelayMatChangeHandle
();
//
CancelDelayMatChangeHandle();
Invoke
(
"DelayMatChangeHandle"
,
0.5f
);
//
Invoke("DelayMatChangeHandle", 0.5f);
CancelRotateInvoke
();
CancelRotateInvoke
();
}
}
void
CancelDelayMatChangeHandle
()
void
CancelDelayMatChangeHandle
()
...
@@ -457,7 +457,7 @@ public class StorageView : MonoBehaviour
...
@@ -457,7 +457,7 @@ public class StorageView : MonoBehaviour
m_triggerTopBox
.
gameObject
.
SetActive
(
true
);
m_triggerTopBox
.
gameObject
.
SetActive
(
true
);
//m_curTargetPosY = m_curTargetTrans.transform.position.y;
//m_curTargetPosY = m_curTargetTrans.transform.position.y;
Invoke
(
"DelayInvokeRigidBody"
,
0.1f
);
Invoke
(
"DelayInvokeRigidBody"
,
0.1f
);
CancelDelayMatChangeHandle
();
//
CancelDelayMatChangeHandle();
if
(
m_dicMat
.
ContainsKey
(
m_curTargetTrans
))
if
(
m_dicMat
.
ContainsKey
(
m_curTargetTrans
))
{
{
m_curTargetTrans
.
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_dicMat
[
m_curTargetTrans
];
m_curTargetTrans
.
GetComponent
<
MeshRenderer
>().
sharedMaterial
=
m_dicMat
[
m_curTargetTrans
];
...
@@ -494,7 +494,7 @@ public class StorageView : MonoBehaviour
...
@@ -494,7 +494,7 @@ public class StorageView : MonoBehaviour
{
{
GameServices
.
inputService
.
pad
.
onTouchUp
-=
OnTouchUp
;
GameServices
.
inputService
.
pad
.
onTouchUp
-=
OnTouchUp
;
}
}
CancelDelayMatChangeHandle
();
//
CancelDelayMatChangeHandle();
CancelRotateInvoke
();
CancelRotateInvoke
();
}
}
}
}
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