Commit 4d5493f7 authored by wanqing's avatar wanqing

修改脚本

parent 67cb88cf
......@@ -43,6 +43,9 @@ public class BattleCtrl : MonoBehaviour
bool _IsWin;
public bool isWin => _IsWin;
bool _IsFirstLevelTop;//特殊处理
public bool isFirstLevelTop => _IsFirstLevelTop;
static BattleCtrl _Instance;
public static BattleCtrl instance => _Instance;
......@@ -158,7 +161,11 @@ public class BattleCtrl : MonoBehaviour
//Invoke("DelayChangeToSelectScene", 2.0f);
battleUI.SetOkBtnState(true);
}
//特殊处理
public void OnFirstLevelTop()
{
_IsFirstLevelTop = true;
}
//延迟切换场景
void DelayChangeToSelectScene()
{
......@@ -172,6 +179,7 @@ public class BattleCtrl : MonoBehaviour
//_IsStartBattle = false;
_IsEndBattle = false;
_IsWin = false;
_IsFirstLevelTop = false;
battleUI.OnBeforeLoadLevel();
//GameServices.inputService.DisableService();
}
......
......@@ -1206,9 +1206,19 @@ public class FruitView : MonoBehaviour
if (!m_selectLst.Contains(varHitTrans))
{
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);
m_highLightEffect.enabled = false;
......
......@@ -24,6 +24,7 @@ public class GlassView : MonoBehaviour
//private float m_orangeMaxNum = 10.0f;
private bool m_bControl = true;
private bool m_bTop = true;
private float m_speed = 2.0f;
private string m_strawberryAni = "juice_red";
......@@ -98,7 +99,7 @@ public class GlassView : MonoBehaviour
}
private void Update()
{
if (!BattleCtrl.instance.isStartBattle || BattleCtrl.instance.isWin)
if (!BattleCtrl.instance.isStartBattle || BattleCtrl.instance.isFirstLevelTop)
{
return;
}
......@@ -242,6 +243,12 @@ public class GlassView : MonoBehaviour
BattleCtrl.instance.levelManager.curLevel.CalculateStar();
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)
//{
// m_bControl = false;
......
......@@ -10067,8 +10067,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4516999790671702396}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.107}
m_LocalScale: {x: 2.6873, y: 2.4303, z: 1}
m_LocalPosition: {x: 0, y: 2.88, z: -0.107}
m_LocalScale: {x: 2.6873, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 2419814894656923382}
m_RootOrder: 0
......@@ -10160,8 +10160,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4516999792058113711}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.32}
m_LocalScale: {x: 2.6873, y: 2.4303, z: 1}
m_LocalPosition: {x: 0, y: 2.88, z: 1.32}
m_LocalScale: {x: 2.6873, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 2419814894656923382}
m_RootOrder: 1
......@@ -11170,7 +11170,7 @@ Transform:
m_GameObject: {fileID: 6079020160306596385}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
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_Father: {fileID: 3097028441198796063}
m_RootOrder: 1
......@@ -16390,7 +16390,7 @@ Transform:
m_GameObject: {fileID: 6841784765868801710}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
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_Father: {fileID: 3097028441198796063}
m_RootOrder: 2
......@@ -21458,7 +21458,7 @@ Transform:
m_GameObject: {fileID: 7655032033422026000}
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
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_Father: {fileID: 3097028441198796063}
m_RootOrder: 3
......
......@@ -29042,8 +29042,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5152933140136112625}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.32}
m_LocalScale: {x: 2.6873, y: 2.4303, z: 1}
m_LocalPosition: {x: 0, y: 2.88, z: 1.32}
m_LocalScale: {x: 2.6873, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 2824403712718261133}
m_RootOrder: 1
......@@ -29135,8 +29135,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5152933140863747618}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.107}
m_LocalScale: {x: 2.6873, y: 2.4303, z: 1}
m_LocalPosition: {x: 0, y: 2.88, z: -0.107}
m_LocalScale: {x: 2.6873, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 2824403712718261133}
m_RootOrder: 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment