Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
3
3D Fruit
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
3D Fruit
Commits
4d5493f7
Commit
4d5493f7
authored
May 17, 2021
by
wanqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改脚本
parent
67cb88cf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
15 deletions
+40
-15
BattleCtrl.cs
3D Fruit/Assets/#A2_Scripts/Battle/BattleCtrl.cs
+9
-1
FruitView.cs
3D Fruit/Assets/#A2_Scripts/Battle/View/FruitView.cs
+12
-2
GlassView.cs
3D Fruit/Assets/#A2_Scripts/Battle/View/GlassView.cs
+8
-1
Level0.prefab
3D Fruit/Assets/Res/Levels/Level0.prefab
+7
-7
Level2.prefab
3D Fruit/Assets/Res/Levels/Level2.prefab
+4
-4
No files found.
3D Fruit/Assets/#A2_Scripts/Battle/BattleCtrl.cs
View file @
4d5493f7
...
@@ -43,6 +43,9 @@ public class BattleCtrl : MonoBehaviour
...
@@ -43,6 +43,9 @@ public class BattleCtrl : MonoBehaviour
bool
_IsWin
;
bool
_IsWin
;
public
bool
isWin
=>
_IsWin
;
public
bool
isWin
=>
_IsWin
;
bool
_IsFirstLevelTop
;
//特殊处理
public
bool
isFirstLevelTop
=>
_IsFirstLevelTop
;
static
BattleCtrl
_Instance
;
static
BattleCtrl
_Instance
;
public
static
BattleCtrl
instance
=>
_Instance
;
public
static
BattleCtrl
instance
=>
_Instance
;
...
@@ -158,7 +161,11 @@ public class BattleCtrl : MonoBehaviour
...
@@ -158,7 +161,11 @@ public class BattleCtrl : MonoBehaviour
//Invoke("DelayChangeToSelectScene", 2.0f);
//Invoke("DelayChangeToSelectScene", 2.0f);
battleUI
.
SetOkBtnState
(
true
);
battleUI
.
SetOkBtnState
(
true
);
}
}
//特殊处理
public
void
OnFirstLevelTop
()
{
_IsFirstLevelTop
=
true
;
}
//延迟切换场景
//延迟切换场景
void
DelayChangeToSelectScene
()
void
DelayChangeToSelectScene
()
{
{
...
@@ -172,6 +179,7 @@ public class BattleCtrl : MonoBehaviour
...
@@ -172,6 +179,7 @@ public class BattleCtrl : MonoBehaviour
//_IsStartBattle = false;
//_IsStartBattle = false;
_IsEndBattle
=
false
;
_IsEndBattle
=
false
;
_IsWin
=
false
;
_IsWin
=
false
;
_IsFirstLevelTop
=
false
;
battleUI
.
OnBeforeLoadLevel
();
battleUI
.
OnBeforeLoadLevel
();
//GameServices.inputService.DisableService();
//GameServices.inputService.DisableService();
}
}
...
...
3D Fruit/Assets/#A2_Scripts/Battle/View/FruitView.cs
View file @
4d5493f7
...
@@ -1206,9 +1206,19 @@ public class FruitView : MonoBehaviour
...
@@ -1206,9 +1206,19 @@ public class FruitView : MonoBehaviour
if
(!
m_selectLst
.
Contains
(
varHitTrans
))
if
(!
m_selectLst
.
Contains
(
varHitTrans
))
{
{
m_bIsTouchUp
=
false
;
m_bIsTouchUp
=
false
;
if
(
BattleCtrl
.
instance
.
isWin
)
if
(
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
==
LevelEnum
.
levelOneIndex
)
{
if
(
BattleCtrl
.
instance
.
isFirstLevelTop
)
{
BattleCtrl
.
instance
.
OnBattleFail
();
}
}
else
if
(
BattleCtrl
.
instance
.
levelManager
.
CurLevelIndex
==
LevelEnum
.
levelTwoIndex
)
{
{
BattleCtrl
.
instance
.
OnBattleFail
();
if
(
BattleCtrl
.
instance
.
isWin
)
{
BattleCtrl
.
instance
.
OnBattleFail
();
}
}
}
GlobalConfig
.
SetFruitRigidState
(
true
);
GlobalConfig
.
SetFruitRigidState
(
true
);
m_highLightEffect
.
enabled
=
false
;
m_highLightEffect
.
enabled
=
false
;
...
...
3D Fruit/Assets/#A2_Scripts/Battle/View/GlassView.cs
View file @
4d5493f7
...
@@ -24,6 +24,7 @@ public class GlassView : MonoBehaviour
...
@@ -24,6 +24,7 @@ public class GlassView : MonoBehaviour
//private float m_orangeMaxNum = 10.0f;
//private float m_orangeMaxNum = 10.0f;
private
bool
m_bControl
=
true
;
private
bool
m_bControl
=
true
;
private
bool
m_bTop
=
true
;
private
float
m_speed
=
2.0f
;
private
float
m_speed
=
2.0f
;
private
string
m_strawberryAni
=
"juice_red"
;
private
string
m_strawberryAni
=
"juice_red"
;
...
@@ -98,7 +99,7 @@ public class GlassView : MonoBehaviour
...
@@ -98,7 +99,7 @@ public class GlassView : MonoBehaviour
}
}
private
void
Update
()
private
void
Update
()
{
{
if
(!
BattleCtrl
.
instance
.
isStartBattle
||
BattleCtrl
.
instance
.
is
Win
)
if
(!
BattleCtrl
.
instance
.
isStartBattle
||
BattleCtrl
.
instance
.
is
FirstLevelTop
)
{
{
return
;
return
;
}
}
...
@@ -242,6 +243,12 @@ public class GlassView : MonoBehaviour
...
@@ -242,6 +243,12 @@ public class GlassView : MonoBehaviour
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
CalculateStar
();
BattleCtrl
.
instance
.
levelManager
.
curLevel
.
CalculateStar
();
BattleCtrl
.
instance
.
OnBattleWin
();
BattleCtrl
.
instance
.
OnBattleWin
();
}
}
if
((
m_strawberryOffest
+
m_lemonOffest
+
m_orangeOffest
)
>=
12.0f
&&
m_bTop
)
{
m_bTop
=
false
;
BattleCtrl
.
instance
.
OnFirstLevelTop
();
}
//if (m_strawberryOffest >= GlobalConfig.ProgressFruitNumNeed && m_bControl)
//if (m_strawberryOffest >= GlobalConfig.ProgressFruitNumNeed && m_bControl)
//{
//{
// m_bControl = false;
// m_bControl = false;
...
...
3D Fruit/Assets/Res/Levels/Level0.prefab
View file @
4d5493f7
...
@@ -10067,8 +10067,8 @@ Transform:
...
@@ -10067,8 +10067,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4516999790671702396
}
m_GameObject
:
{
fileID
:
4516999790671702396
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
-0.107
}
m_LocalPosition
:
{
x
:
0
,
y
:
2.88
,
z
:
-0.107
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
2.4303
,
z
:
1
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
2419814894656923382
}
m_Father
:
{
fileID
:
2419814894656923382
}
m_RootOrder
:
0
m_RootOrder
:
0
...
@@ -10160,8 +10160,8 @@ Transform:
...
@@ -10160,8 +10160,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
4516999792058113711
}
m_GameObject
:
{
fileID
:
4516999792058113711
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
1.32
}
m_LocalPosition
:
{
x
:
0
,
y
:
2.88
,
z
:
1.32
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
2.4303
,
z
:
1
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
2419814894656923382
}
m_Father
:
{
fileID
:
2419814894656923382
}
m_RootOrder
:
1
m_RootOrder
:
1
...
@@ -11170,7 +11170,7 @@ Transform:
...
@@ -11170,7 +11170,7 @@ Transform:
m_GameObject
:
{
fileID
:
6079020160306596385
}
m_GameObject
:
{
fileID
:
6079020160306596385
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalScale
:
{
x
:
0.95
,
y
:
0
,
z
:
0.95
}
m_LocalScale
:
{
x
:
1
,
y
:
0
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
3097028441198796063
}
m_Father
:
{
fileID
:
3097028441198796063
}
m_RootOrder
:
1
m_RootOrder
:
1
...
@@ -16390,7 +16390,7 @@ Transform:
...
@@ -16390,7 +16390,7 @@ Transform:
m_GameObject
:
{
fileID
:
6841784765868801710
}
m_GameObject
:
{
fileID
:
6841784765868801710
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalScale
:
{
x
:
0.95
,
y
:
0
,
z
:
0.95
}
m_LocalScale
:
{
x
:
1
,
y
:
0
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
3097028441198796063
}
m_Father
:
{
fileID
:
3097028441198796063
}
m_RootOrder
:
2
m_RootOrder
:
2
...
@@ -21458,7 +21458,7 @@ Transform:
...
@@ -21458,7 +21458,7 @@ Transform:
m_GameObject
:
{
fileID
:
7655032033422026000
}
m_GameObject
:
{
fileID
:
7655032033422026000
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalPosition
:
{
x
:
0
,
y
:
0.35
,
z
:
-3
}
m_LocalScale
:
{
x
:
0.95
,
y
:
0
,
z
:
0.95
}
m_LocalScale
:
{
x
:
1
,
y
:
0
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
3097028441198796063
}
m_Father
:
{
fileID
:
3097028441198796063
}
m_RootOrder
:
3
m_RootOrder
:
3
...
...
3D Fruit/Assets/Res/Levels/Level2.prefab
View file @
4d5493f7
...
@@ -29042,8 +29042,8 @@ Transform:
...
@@ -29042,8 +29042,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5152933140136112625
}
m_GameObject
:
{
fileID
:
5152933140136112625
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
1.32
}
m_LocalPosition
:
{
x
:
0
,
y
:
2.88
,
z
:
1.32
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
2.4303
,
z
:
1
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
2824403712718261133
}
m_Father
:
{
fileID
:
2824403712718261133
}
m_RootOrder
:
1
m_RootOrder
:
1
...
@@ -29135,8 +29135,8 @@ Transform:
...
@@ -29135,8 +29135,8 @@ Transform:
m_PrefabAsset
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
5152933140863747618
}
m_GameObject
:
{
fileID
:
5152933140863747618
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalRotation
:
{
x
:
0
,
y
:
0
,
z
:
0
,
w
:
1
}
m_LocalPosition
:
{
x
:
0
,
y
:
0
,
z
:
-0.107
}
m_LocalPosition
:
{
x
:
0
,
y
:
2.88
,
z
:
-0.107
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
2.4303
,
z
:
1
}
m_LocalScale
:
{
x
:
2.6873
,
y
:
10
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
2824403712718261133
}
m_Father
:
{
fileID
:
2824403712718261133
}
m_RootOrder
:
0
m_RootOrder
:
0
...
...
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