Commit 7eaf4c59 authored by wanqing's avatar wanqing

镜头调整

parent e049895b
This diff is collapsed.
...@@ -67,6 +67,9 @@ public class BattleUI : MonoBehaviour ...@@ -67,6 +67,9 @@ public class BattleUI : MonoBehaviour
public GameObject m_playerRawImageObj; public GameObject m_playerRawImageObj;
public GameObject m_fruitIconObj; public GameObject m_fruitIconObj;
public GameObject m_sportIconObj; public GameObject m_sportIconObj;
public GameObject m_threeIconObj;
public GameObject m_fourIconObj;
public GameObject m_fiveIconObj;
public Text m_needIconNum;//需要多少数量 public Text m_needIconNum;//需要多少数量
public GameObject m_needIconSymbol;//数量✔ public GameObject m_needIconSymbol;//数量✔
public GameObject[] m_starArrayObj;//星级 public GameObject[] m_starArrayObj;//星级
...@@ -337,7 +340,7 @@ public class BattleUI : MonoBehaviour ...@@ -337,7 +340,7 @@ public class BattleUI : MonoBehaviour
//胜利延迟 //胜利延迟
void DelayWin() void DelayWin()
{ {
//BattleCtrl.instance.levelManager.selectLevel.CameraMoveDown(); BattleCtrl.instance.levelManager.selectLevel.CameraMoveDown();
m_nextLevelBtn.gameObject.SetActive(false); m_nextLevelBtn.gameObject.SetActive(false);
m_successObj.SetActive(true); m_successObj.SetActive(true);
m_selectLevelObj.SetActive(false); m_selectLevelObj.SetActive(false);
...@@ -359,7 +362,7 @@ public class BattleUI : MonoBehaviour ...@@ -359,7 +362,7 @@ public class BattleUI : MonoBehaviour
float varNoOtherAmount = varNoOtherPro == 0 ? 1 : 0; float varNoOtherAmount = varNoOtherPro == 0 ? 1 : 0;
RectTransform varRT = m_successResultObj.GetComponent<RectTransform>(); RectTransform varRT = m_successResultObj.GetComponent<RectTransform>();
Vector2 varVec2 = varRT.anchoredPosition; Vector2 varVec2 = varRT.anchoredPosition;
varVec2.y = 21.0f; varVec2.y = 23.0f;
varRT.DOAnchorPos(varVec2, 1.0f).onComplete = delegate () varRT.DOAnchorPos(varVec2, 1.0f).onComplete = delegate ()
{ {
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
...@@ -465,22 +468,32 @@ public class BattleUI : MonoBehaviour ...@@ -465,22 +468,32 @@ public class BattleUI : MonoBehaviour
//水果位置 //水果位置
GlobalConfig.SetFruitRandomNum(); GlobalConfig.SetFruitRandomNum();
Vector2 varPos = m_fruitGroupRT.anchoredPosition; HideAllFruitIcon();
if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex) //Vector2 varPos = m_fruitGroupRT.anchoredPosition;
if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex)
{ {
varPos.y = -400.0f; //varPos.y = -400.0f;
m_fruitSecondLineObj.SetActive(false); m_fruitSecondLineObj.SetActive(false);
m_fruitIconObj.SetActive(true); m_fruitIconObj.SetActive(true);
m_sportIconObj.SetActive(false);
} }
else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex)
|| BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{ {
varPos.y = -286.0f; //varPos.y = -286.0f;
m_fruitSecondLineObj.SetActive(true); m_fruitSecondLineObj.SetActive(true);
m_fruitIconObj.SetActive(false);
m_sportIconObj.SetActive(true); m_sportIconObj.SetActive(true);
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{
m_threeIconObj.SetActive(true);
}
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{
m_fourIconObj.SetActive(true);
}
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{
m_fiveIconObj.SetActive(true);
}
//m_fruitGroupRT.anchoredPosition = varPos; //m_fruitGroupRT.anchoredPosition = varPos;
m_moveNumText.text = string.Format("{0:d}", GlobalConfig.FruitMoveTotalNum); m_moveNumText.text = string.Format("{0:d}", GlobalConfig.FruitMoveTotalNum);
...@@ -491,10 +504,19 @@ public class BattleUI : MonoBehaviour ...@@ -491,10 +504,19 @@ public class BattleUI : MonoBehaviour
SetLemonNum(0); SetLemonNum(0);
SetOrangeNum(0); SetOrangeNum(0);
SetNeedIconState(false); SetNeedIconState(false);
SetNeedIconNum(0); //SetNeedIconNum(0);
ResetResult(); ResetResult();
m_bLoadSceneFinish = true; m_bLoadSceneFinish = true;
} }
//隐藏所有icon
void HideAllFruitIcon()
{
m_fruitIconObj.SetActive(false);
m_sportIconObj.SetActive(false);
m_threeIconObj.SetActive(false);
m_fourIconObj.SetActive(false);
m_fiveIconObj.SetActive(false);
}
//设置移动次数 //设置移动次数
public void SetMoveNum(int num) public void SetMoveNum(int num)
{ {
...@@ -962,7 +984,7 @@ public class BattleUI : MonoBehaviour ...@@ -962,7 +984,7 @@ public class BattleUI : MonoBehaviour
GlobalConfig.SetFruitRigidState(false); GlobalConfig.SetFruitRigidState(false);
//选择场景镜头 //选择场景镜头
BattleCtrl.instance.levelManager.curLevel.fruitView.SetCupWaterPos(); BattleCtrl.instance.levelManager.curLevel.fruitView.SetCupWaterPos();
BattleCtrl.instance.levelManager.selectLevel.SetCameraPosAndRotation(); //BattleCtrl.instance.levelManager.selectLevel.SetCameraPosAndRotation();
} }
} }
else else
...@@ -972,7 +994,7 @@ public class BattleUI : MonoBehaviour ...@@ -972,7 +994,7 @@ public class BattleUI : MonoBehaviour
{ {
m_fadeAlpha = 0.0f; m_fadeAlpha = 0.0f;
m_bMainToSelect = false; m_bMainToSelect = false;
//OnBattleWin(); OnBattleWin();
} }
} }
} }
......
...@@ -31,11 +31,13 @@ public class DecorateUI : MonoBehaviour ...@@ -31,11 +31,13 @@ public class DecorateUI : MonoBehaviour
//阶段1 //阶段1
private float m_curStage1Progress = 0.0f; private float m_curStage1Progress = 0.0f;
private RectTransform m_image1RT;
public Action m_StopStage1Action; public Action m_StopStage1Action;
public Action<float> m_StartStage1Action; public Action<float> m_StartStage1Action;
public Action m_FinishStage1; public Action m_FinishStage1;
//阶段2 //阶段2
private float m_curStage2Progress = 0.0f; private float m_curStage2Progress = 0.0f;
private RectTransform m_image2RT;
public Action m_StopStage2Action; public Action m_StopStage2Action;
public Action<float> m_StartStage2Action; public Action<float> m_StartStage2Action;
public Action m_FinishStage2; public Action m_FinishStage2;
...@@ -43,6 +45,9 @@ public class DecorateUI : MonoBehaviour ...@@ -43,6 +45,9 @@ public class DecorateUI : MonoBehaviour
public Action m_prop1Action; public Action m_prop1Action;
public Action m_prop2Action; public Action m_prop2Action;
public Action m_prop3Action; public Action m_prop3Action;
private float m_imageStartPosX = 0.0f;//开始x位置
private float m_progressDis = 410.0f;//长度
// Start is called before the first frame update // Start is called before the first frame update
void Awake() void Awake()
{ {
...@@ -51,6 +56,15 @@ public class DecorateUI : MonoBehaviour ...@@ -51,6 +56,15 @@ public class DecorateUI : MonoBehaviour
m_button3.onClick.AddListener(OnButton3); m_button3.onClick.AddListener(OnButton3);
m_buttonStage1.onClick.AddListener(OnButtonStage1); m_buttonStage1.onClick.AddListener(OnButtonStage1);
m_buttonStage2.onClick.AddListener(OnButtonStage2); m_buttonStage2.onClick.AddListener(OnButtonStage2);
if(m_progressStage1Image)
{
m_image1RT = m_progressStage1Image.GetComponent<RectTransform>();
m_imageStartPosX = m_image1RT.anchoredPosition.x;
}
if(m_progressStage2Image)
{
m_image2RT = m_progressStage2Image.GetComponent<RectTransform>();
}
} }
void OnButton1() void OnButton1()
{ {
...@@ -110,11 +124,21 @@ public class DecorateUI : MonoBehaviour ...@@ -110,11 +124,21 @@ public class DecorateUI : MonoBehaviour
public void ResetState() public void ResetState()
{ {
m_curStage1Progress = 0; m_curStage1Progress = 0;
m_progressStage1Image.fillAmount = 0; if(m_image1RT)
{
Vector2 varVec1 = m_image1RT.anchoredPosition;
varVec1.x = m_imageStartPosX;
m_image1RT.anchoredPosition = varVec1;
}
m_buttonStage1.gameObject.SetActive(false); m_buttonStage1.gameObject.SetActive(false);
m_curStage2Progress = 0; m_curStage2Progress = 0;
m_progressStage2Image.fillAmount = 0; if(m_image2RT)
{
Vector2 varVec2 = m_image2RT.anchoredPosition;
varVec2.x = m_imageStartPosX;
m_image2RT.anchoredPosition = varVec2;
}
m_buttonStage2.gameObject.SetActive(false); m_buttonStage2.gameObject.SetActive(false);
m_curProgress = 0; m_curProgress = 0;
...@@ -150,7 +174,10 @@ public class DecorateUI : MonoBehaviour ...@@ -150,7 +174,10 @@ public class DecorateUI : MonoBehaviour
{ {
m_StartStage1Action?.Invoke(m_curStage1Progress); m_StartStage1Action?.Invoke(m_curStage1Progress);
} }
m_progressStage1Image.fillAmount = m_curStage1Progress; Vector2 varVec = m_image1RT.anchoredPosition;
varVec.x = m_imageStartPosX + m_progressDis * m_curStage1Progress;
m_image1RT.anchoredPosition = varVec;
//m_progressStage1Image.fillAmount = m_curStage1Progress;
} }
if (m_curStage1Progress >= 0.5f) if (m_curStage1Progress >= 0.5f)
{ {
...@@ -178,7 +205,10 @@ public class DecorateUI : MonoBehaviour ...@@ -178,7 +205,10 @@ public class DecorateUI : MonoBehaviour
{ {
m_StartStage2Action?.Invoke(m_curStage2Progress); m_StartStage2Action?.Invoke(m_curStage2Progress);
} }
m_progressStage2Image.fillAmount = m_curStage2Progress; Vector2 varVec = m_image2RT.anchoredPosition;
varVec.x = m_imageStartPosX + m_progressDis * m_curStage2Progress;
m_image2RT.anchoredPosition = varVec;
//m_progressStage2Image.fillAmount = m_curStage2Progress;
} }
if (m_curStage2Progress >= 0.5f) if (m_curStage2Progress >= 0.5f)
{ {
......
...@@ -70,8 +70,10 @@ public class FruitView : MonoBehaviour ...@@ -70,8 +70,10 @@ public class FruitView : MonoBehaviour
//小球处理 //小球处理
private List<GameObject> m_smallBallLst = new List<GameObject>(); private List<GameObject> m_smallBallLst = new List<GameObject>();
private List<Vector3> m_smallBallPosLst = new List<Vector3>(); //private List<Vector3> m_smallBallPosLst = new List<Vector3>();
private List<Vector3> m_smallBallSizeLst = new List<Vector3>(); //private List<Vector3> m_smallBallSizeLst = new List<Vector3>();
private Dictionary<int, List<Vector3>> m_smallBallPosDic = new Dictionary<int, List<Vector3>>();
private Dictionary<int, List<Vector3>> m_smallBallSizeDic = new Dictionary<int, List<Vector3>>();
//水特效处理 //水特效处理
private int m_starwberryOneNum; private int m_starwberryOneNum;
private int m_starwberryTwoNum; private int m_starwberryTwoNum;
...@@ -96,7 +98,7 @@ public class FruitView : MonoBehaviour ...@@ -96,7 +98,7 @@ public class FruitView : MonoBehaviour
private Sequence m_sq; private Sequence m_sq;
//装饰完回到选择场景 //装饰完回到选择场景
private Vector3 m_backToSelectPos = new Vector3(-0.488f, 0.849f, -0.219f); private Vector3 m_backToSelectPos = new Vector3(-0.488f, 0.96f, -0.219f);
private Vector3 m_backToSelectSize = Vector3.one * 0.2f; private Vector3 m_backToSelectSize = Vector3.one * 0.2f;
//绑定右手节点 //绑定右手节点
...@@ -197,6 +199,8 @@ public class FruitView : MonoBehaviour ...@@ -197,6 +199,8 @@ public class FruitView : MonoBehaviour
//小球处理 //小球处理
void CreateSmallBall(FruitItemView view) void CreateSmallBall(FruitItemView view)
{ {
List<Vector3> varPosLst = new List<Vector3>();
List<Vector3> varSizeLst = new List<Vector3>();
if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex) if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{ {
GameObject varGo = null; GameObject varGo = null;
...@@ -221,9 +225,11 @@ public class FruitView : MonoBehaviour ...@@ -221,9 +225,11 @@ public class FruitView : MonoBehaviour
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>(); Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>();
for (int i = 0; i < varRigid.Length; i++) for (int i = 0; i < varRigid.Length; i++)
{ {
m_smallBallPosLst.Add(varRigid[i].transform.localPosition); varPosLst.Add(varRigid[i].transform.localPosition);
m_smallBallSizeLst.Add(varRigid[i].transform.localScale); varSizeLst.Add(varRigid[i].transform.localScale);
} }
m_smallBallPosDic.Add(varGo.GetInstanceID(), varPosLst);
m_smallBallSizeDic.Add(varGo.GetInstanceID(), varSizeLst);
varGo.transform.position = view.transform.position; varGo.transform.position = view.transform.position;
varGo.transform.rotation = Quaternion.identity; varGo.transform.rotation = Quaternion.identity;
m_smallBallLst.Add(varGo); m_smallBallLst.Add(varGo);
...@@ -249,9 +255,11 @@ public class FruitView : MonoBehaviour ...@@ -249,9 +255,11 @@ public class FruitView : MonoBehaviour
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>(); Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>();
for (int i = 0; i < varRigid.Length; i++) for (int i = 0; i < varRigid.Length; i++)
{ {
m_smallBallPosLst.Add(varRigid[i].transform.localPosition); varPosLst.Add(varRigid[i].transform.localPosition);
m_smallBallSizeLst.Add(varRigid[i].transform.localScale); varSizeLst.Add(varRigid[i].transform.localScale);
} }
m_smallBallPosDic.Add(varGo.GetInstanceID(), varPosLst);
m_smallBallSizeDic.Add(varGo.GetInstanceID(), varSizeLst);
varGo.transform.position = view.transform.position; varGo.transform.position = view.transform.position;
varGo.transform.rotation = Quaternion.identity; varGo.transform.rotation = Quaternion.identity;
m_smallBallLst.Add(varGo); m_smallBallLst.Add(varGo);
...@@ -273,17 +281,25 @@ public class FruitView : MonoBehaviour ...@@ -273,17 +281,25 @@ public class FruitView : MonoBehaviour
m_smallBallLst[i].transform.localRotation = Quaternion.identity; m_smallBallLst[i].transform.localRotation = Quaternion.identity;
m_smallBallLst[i].transform.localScale = Vector3.one; m_smallBallLst[i].transform.localScale = Vector3.one;
//位置 //位置
List<Vector3> varPosLst;
List<Vector3> varSizeLst;
if (m_smallBallPosDic.TryGetValue(m_smallBallLst[i].GetInstanceID(), out varPosLst) &&
m_smallBallSizeDic.TryGetValue(m_smallBallLst[i].GetInstanceID(), out varSizeLst))
{
Rigidbody[] varRigid = m_smallBallLst[i].GetComponentsInChildren<Rigidbody>(); Rigidbody[] varRigid = m_smallBallLst[i].GetComponentsInChildren<Rigidbody>();
for (int m = 0; m < varRigid.Length; m++) for (int m = 0; m < varRigid.Length; m++)
{ {
varRigid[m].transform.localPosition = m_smallBallPosLst[m]; varRigid[m].transform.localPosition = varPosLst[m];
varRigid[m].transform.localRotation = Quaternion.identity; varRigid[m].transform.localRotation = Quaternion.identity;
varRigid[m].transform.localScale = m_smallBallSizeLst[m]; varRigid[m].transform.localScale = varSizeLst[m];
varRigid[m].velocity = Vector3.zero; varRigid[m].velocity = Vector3.zero;
varRigid[m].angularVelocity = Vector3.zero; varRigid[m].angularVelocity = Vector3.zero;
} }
} }
}
m_smallBallLst.Clear(); m_smallBallLst.Clear();
m_smallBallPosDic.Clear();
m_smallBallSizeDic.Clear();
} }
} }
// 抬起回调 // 抬起回调
...@@ -943,7 +959,7 @@ public class FruitView : MonoBehaviour ...@@ -943,7 +959,7 @@ public class FruitView : MonoBehaviour
////m_lemonEffect.SetActive(varLemonNum > 0); ////m_lemonEffect.SetActive(varLemonNum > 0);
//m_orangeEffect.SetActive(false); //m_orangeEffect.SetActive(false);
//m_orangeEffect.SetActive(varStrawberryNum > 0 || varLemonNum > 0 || varOrangeNum > 0); //m_orangeEffect.SetActive(varStrawberryNum > 0 || varLemonNum > 0 || varOrangeNum > 0);
BattleCtrl.instance.battleUI.SetNeedIconNum(m_firstTotalNum); //BattleCtrl.instance.battleUI.SetNeedIconNum(m_firstTotalNum);
int varBadNum = varFishNum + varEggNum; int varBadNum = varFishNum + varEggNum;
int varGoodNum = varStrawberryNum + varOrangeNum; int varGoodNum = varStrawberryNum + varOrangeNum;
...@@ -958,7 +974,7 @@ public class FruitView : MonoBehaviour ...@@ -958,7 +974,7 @@ public class FruitView : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex)
{ {
BattleCtrl.instance.battleUI.SetNeedIconNum(m_secondTotalNum); //BattleCtrl.instance.battleUI.SetNeedIconNum(m_secondTotalNum);
int varBadNum = varStrawberryNum + varOrangeNum; int varBadNum = varStrawberryNum + varOrangeNum;
int varGoodNum = varPepperNum + varTomatoNum; int varGoodNum = varPepperNum + varTomatoNum;
...@@ -973,7 +989,7 @@ public class FruitView : MonoBehaviour ...@@ -973,7 +989,7 @@ public class FruitView : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{ {
BattleCtrl.instance.battleUI.SetNeedIconNum(m_thirdTotalNum); //BattleCtrl.instance.battleUI.SetNeedIconNum(m_thirdTotalNum);
int varGoodNum = varFootBallNum + varBasketBallNum + varVolleyBallNum; int varGoodNum = varFootBallNum + varBasketBallNum + varVolleyBallNum;
if (varGlobeNum > 0) if (varGlobeNum > 0)
...@@ -987,7 +1003,7 @@ public class FruitView : MonoBehaviour ...@@ -987,7 +1003,7 @@ public class FruitView : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{ {
BattleCtrl.instance.battleUI.SetNeedIconNum(m_fourthTotalNum); //BattleCtrl.instance.battleUI.SetNeedIconNum(m_fourthTotalNum);
int varBadNum = varCabbageNum + varTomatoNum; int varBadNum = varCabbageNum + varTomatoNum;
int varGoodNum = varBurgerNum + varCokeNum + varFrenchFriesNum; int varGoodNum = varBurgerNum + varCokeNum + varFrenchFriesNum;
...@@ -1002,7 +1018,7 @@ public class FruitView : MonoBehaviour ...@@ -1002,7 +1018,7 @@ public class FruitView : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
BattleCtrl.instance.battleUI.SetNeedIconNum(m_fifthTotalNum); //BattleCtrl.instance.battleUI.SetNeedIconNum(m_fifthTotalNum);
int varBadNum = varFootBallNum + varBasketBallNum; int varBadNum = varFootBallNum + varBasketBallNum;
if (varBadNum > 0) if (varBadNum > 0)
......
...@@ -63,6 +63,11 @@ public class NpcFaceView : MonoBehaviour ...@@ -63,6 +63,11 @@ public class NpcFaceView : MonoBehaviour
//释放动画 //释放动画
public void OnKill() public void OnKill()
{ {
for (int i = 0; i < m_meshRender.Length; i++)
{
m_meshRender[i].sharedMaterial = m_normalMat;
m_meshRender[i].transform.localScale = Vector3.one;
}
m_sq.Kill(); m_sq.Kill();
} }
} }
...@@ -61,7 +61,7 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -61,7 +61,7 @@ public class SelectLevelCtrl : MonoBehaviour
//镜头切换 //镜头切换
private Vector3 m_StartCameraPos = new Vector3(0,0.82f,-0.66f); private Vector3 m_StartCameraPos = new Vector3(0,0.82f,-0.66f);
private Vector3 m_FinalCameraPos = new Vector3(0, 1.64f, -1.56f); private Vector3 m_FinalCameraPos = new Vector3(0, 1.64f, -1.56f);
private Quaternion m_StartCameraRotation = Quaternion.Euler(45, 0, 0); private Quaternion m_StartCameraRotation = Quaternion.Euler(0, 0, 0);
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
...@@ -172,9 +172,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -172,9 +172,9 @@ public class SelectLevelCtrl : MonoBehaviour
{ {
if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex) if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex)
{ {
m_boyTrans.gameObject.SetActive(true);
PlayBoyAnim(GlobalConfig.Ani_Walk); PlayBoyAnim(GlobalConfig.Ani_Walk);
PlayGirlAnim(GlobalConfig.Ani_Walk); PlayGirlAnim(GlobalConfig.Ani_Walk);
m_boyTrans.gameObject.SetActive(true);
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
m_sq.Append(m_girlTrans.DOLocalMoveX(1.0f, 2.0f)); m_sq.Append(m_girlTrans.DOLocalMoveX(1.0f, 2.0f));
m_sq.Join(m_boyTrans.DOLocalMove(new Vector3(0,0,0.172f), 2.0f)); m_sq.Join(m_boyTrans.DOLocalMove(new Vector3(0,0,0.172f), 2.0f));
...@@ -182,9 +182,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -182,9 +182,9 @@ public class SelectLevelCtrl : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex)
{ {
m_threeTrans.gameObject.SetActive(true);
PlayBoyAnim(GlobalConfig.Ani_Walk); PlayBoyAnim(GlobalConfig.Ani_Walk);
PlayThreeAnim(GlobalConfig.Ani_Walk); PlayThreeAnim(GlobalConfig.Ani_Walk);
m_threeTrans.gameObject.SetActive(true);
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
m_sq.Append(m_boyTrans.DOLocalMoveX(1.0f, 2.0f)); m_sq.Append(m_boyTrans.DOLocalMoveX(1.0f, 2.0f));
m_sq.Join(m_threeTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f)); m_sq.Join(m_threeTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f));
...@@ -192,9 +192,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -192,9 +192,9 @@ public class SelectLevelCtrl : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{ {
m_fourTrans.gameObject.SetActive(true);
PlayThreeAnim(GlobalConfig.Ani_Walk); PlayThreeAnim(GlobalConfig.Ani_Walk);
PlayFourAnim(GlobalConfig.Ani_Walk); PlayFourAnim(GlobalConfig.Ani_Walk);
m_fourTrans.gameObject.SetActive(true);
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
m_sq.Append(m_threeTrans.DOLocalMoveX(1.0f, 2.0f)); m_sq.Append(m_threeTrans.DOLocalMoveX(1.0f, 2.0f));
m_sq.Join(m_fourTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f)); m_sq.Join(m_fourTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f));
...@@ -202,9 +202,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -202,9 +202,9 @@ public class SelectLevelCtrl : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{ {
m_fiveTrans.gameObject.SetActive(true);
PlayFourAnim(GlobalConfig.Ani_Walk); PlayFourAnim(GlobalConfig.Ani_Walk);
PlayFiveAnim(GlobalConfig.Ani_Walk); PlayFiveAnim(GlobalConfig.Ani_Walk);
m_fiveTrans.gameObject.SetActive(true);
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
m_sq.Append(m_fourTrans.DOLocalMoveX(1.0f, 2.0f)); m_sq.Append(m_fourTrans.DOLocalMoveX(1.0f, 2.0f));
m_sq.Join(m_fiveTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f)); m_sq.Join(m_fiveTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f));
...@@ -212,9 +212,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -212,9 +212,9 @@ public class SelectLevelCtrl : MonoBehaviour
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
m_girlTrans.gameObject.SetActive(true);
PlayFiveAnim(GlobalConfig.Ani_Walk); PlayFiveAnim(GlobalConfig.Ani_Walk);
PlayGirlAnim(GlobalConfig.Ani_Walk); PlayGirlAnim(GlobalConfig.Ani_Walk);
m_girlTrans.gameObject.SetActive(true);
m_sq = DOTween.Sequence(); m_sq = DOTween.Sequence();
m_sq.Append(m_fiveTrans.DOLocalMoveX(1.0f, 2.0f)); m_sq.Append(m_fiveTrans.DOLocalMoveX(1.0f, 2.0f));
m_sq.Join(m_girlTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f)); m_sq.Join(m_girlTrans.DOLocalMove(new Vector3(0, 0, 0.172f), 2.0f));
...@@ -248,7 +248,7 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -248,7 +248,7 @@ public class SelectLevelCtrl : MonoBehaviour
PlayFiveAnim(GlobalConfig.Ani_Idle3); PlayFiveAnim(GlobalConfig.Ani_Idle3);
m_fourNpcFace.OnKill(); m_fourNpcFace.OnKill();
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
m_fruitEffectObj.SetActive(true); m_fruitEffectObj.SetActive(true);
PlayGirlAnim(GlobalConfig.Ani_Idle3); PlayGirlAnim(GlobalConfig.Ani_Idle3);
...@@ -309,9 +309,9 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -309,9 +309,9 @@ public class SelectLevelCtrl : MonoBehaviour
public void CameraMoveDown() public void CameraMoveDown()
{ {
Vector3 varPos = m_camera.position; Vector3 varPos = m_camera.position;
varPos.y = 0.3f; varPos.y = 0.51f;
m_camera.DOMove(varPos, 1.0f).onComplete = delegate () { m_camera.DOMove(varPos, 1.0f).onComplete = delegate () {
DelayPlayCameraAni();
}; };
} }
//镜头向上移动 //镜头向上移动
...@@ -423,40 +423,45 @@ public class SelectLevelCtrl : MonoBehaviour ...@@ -423,40 +423,45 @@ public class SelectLevelCtrl : MonoBehaviour
void DelayPlayCameraAni() void DelayPlayCameraAni()
{ {
HideAllRole(); HideAllRole();
m_camera.DOLocalMove(m_FinalCameraPos, 0.5f).onComplete = delegate () //m_camera.DOLocalMove(m_FinalCameraPos, 0.5f).onComplete = delegate ()
{ //{
if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex) if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex)
{ {
m_girlTrans.gameObject.SetActive(true); m_girlTrans.gameObject.SetActive(true);
m_boyTrans.gameObject.SetActive(true);
m_girlNpcFace.SetFace(); m_girlNpcFace.SetFace();
m_girlTrans.DOLocalMove(m_girlStartPos, 1.0f); //m_girlTrans.DOLocalMove(m_girlStartPos, 1.0f);
} }
else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex) else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex)
{ {
m_boyTrans.gameObject.SetActive(true); m_boyTrans.gameObject.SetActive(true);
m_threeTrans.gameObject.SetActive(true);
m_boyNpcFace.SetFace(); m_boyNpcFace.SetFace();
m_boyTrans.DOLocalMove(m_girlStartPos, 1.0f); //m_boyTrans.DOLocalMove(m_girlStartPos, 1.0f);
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex)
{ {
m_threeTrans.gameObject.SetActive(true); m_threeTrans.gameObject.SetActive(true);
m_fourTrans.gameObject.SetActive(true);
m_threeNpcFace.SetFace(); m_threeNpcFace.SetFace();
m_threeTrans.DOLocalMove(m_girlStartPos, 1.0f); //m_threeTrans.DOLocalMove(m_girlStartPos, 1.0f);
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{ {
m_fourTrans.gameObject.SetActive(true); m_fourTrans.gameObject.SetActive(true);
m_fiveTrans.gameObject.SetActive(true);
m_fourNpcFace.SetFace(); m_fourNpcFace.SetFace();
m_fourTrans.DOLocalMove(m_girlStartPos, 1.0f); //m_fourTrans.DOLocalMove(m_girlStartPos, 1.0f);
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
m_fiveTrans.gameObject.SetActive(true); m_fiveTrans.gameObject.SetActive(true);
m_girlTrans.gameObject.SetActive(true);
m_fiveNpcFace.SetFace(); m_fiveNpcFace.SetFace();
m_fiveTrans.DOLocalMove(m_girlStartPos, 1.0f); //m_fiveTrans.DOLocalMove(m_girlStartPos, 1.0f);
} }
BattleCtrl.instance.battleUI.OnBattleWin(); //BattleCtrl.instance.battleUI.OnBattleWin();
}; //};
} }
//隐藏所有角色 //隐藏所有角色
void HideAllRole() void HideAllRole()
......
...@@ -63,11 +63,14 @@ public class GlobalConfig ...@@ -63,11 +63,14 @@ public class GlobalConfig
StrawberryRandomNum = Random.Range(5, 16); StrawberryRandomNum = Random.Range(5, 16);
LemonRandomNum = Random.Range(5, 16); LemonRandomNum = Random.Range(5, 16);
OrangeRandomNum = Random.Range(5, 16); OrangeRandomNum = Random.Range(5, 16);
if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex) if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelOneIndex ||
BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex ||
BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
{ {
ProgressFruitNumNeed = 10; ProgressFruitNumNeed = 10;
} }
else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelTwoIndex) else if(BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex ||
BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
ProgressFruitNumNeed = 20; ProgressFruitNumNeed = 20;
} }
...@@ -338,7 +341,7 @@ public class GlobalConfig ...@@ -338,7 +341,7 @@ public class GlobalConfig
} }
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
GameObject varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.VolleyBallObj); GameObject varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.FootBallObj);
varObj.transform.localPosition = new Vector3(-0.5f + 0.5f * i + varX, 4.5f + varY, 0.0f + varZ); varObj.transform.localPosition = new Vector3(-0.5f + 0.5f * i + varX, 4.5f + varY, 0.0f + varZ);
varObj.transform.localEulerAngles = Vector3.zero; varObj.transform.localEulerAngles = Vector3.zero;
} }
...@@ -503,7 +506,7 @@ public class GlobalConfig ...@@ -503,7 +506,7 @@ public class GlobalConfig
float varZ = parent.localPosition.z; float varZ = parent.localPosition.z;
for (int i = 0; i < num; i++) for (int i = 0; i < num; i++)
{ {
int varRand = Random.Range(0, 8); int varRand = Random.Range(0, 6);
GameObject varObj = null; GameObject varObj = null;
if (varRand >= 0 && varRand < 2) if (varRand >= 0 && varRand < 2)
{ {
...@@ -513,10 +516,10 @@ public class GlobalConfig ...@@ -513,10 +516,10 @@ public class GlobalConfig
{ {
varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.BasketBallObj); varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.BasketBallObj);
} }
else if (varRand >= 4 && varRand < 6) //else if (varRand >= 4 && varRand < 6)
{ //{
varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.VolleyBallObj); // varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.VolleyBallObj);
} //}
else else
{ {
varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.GlobeObj); varObj = PoolManager.Instance.GetObjectFromPool(CacheManager.Instance.GlobeObj);
...@@ -832,15 +835,15 @@ public class GlobalConfig ...@@ -832,15 +835,15 @@ public class GlobalConfig
varBody[i].isKinematic = value; varBody[i].isKinematic = value;
} }
} }
Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj); //Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj);
if (varVolleyBall) //if (varVolleyBall)
{ //{
Rigidbody[] varBody = varVolleyBall.GetComponentsInChildren<Rigidbody>(true); // Rigidbody[] varBody = varVolleyBall.GetComponentsInChildren<Rigidbody>(true);
for (int i = 0; i < varBody.Length; i++) // for (int i = 0; i < varBody.Length; i++)
{ // {
varBody[i].isKinematic = value; // varBody[i].isKinematic = value;
} // }
} //}
Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj); Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj);
if (varStone) if (varStone)
{ {
...@@ -899,7 +902,7 @@ public class GlobalConfig ...@@ -899,7 +902,7 @@ public class GlobalConfig
} }
} }
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{ {
Transform varFootBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.CubeObj); Transform varFootBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.CubeObj);
if (varFootBall) if (varFootBall)
...@@ -1051,16 +1054,16 @@ public class GlobalConfig ...@@ -1051,16 +1054,16 @@ public class GlobalConfig
} }
varBasketBall.localPosition = Vector3.zero; varBasketBall.localPosition = Vector3.zero;
} }
Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj); //Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj);
if (varVolleyBall) //if (varVolleyBall)
{ //{
Rigidbody[] varBody = varVolleyBall.GetComponentsInChildren<Rigidbody>(); // Rigidbody[] varBody = varVolleyBall.GetComponentsInChildren<Rigidbody>();
for (int i = 0; i < varBody.Length; i++) // for (int i = 0; i < varBody.Length; i++)
{ // {
PoolManager.Instance.ReturnObjectToPool(varBody[i].gameObject); // PoolManager.Instance.ReturnObjectToPool(varBody[i].gameObject);
} // }
varVolleyBall.localPosition = Vector3.zero; // varVolleyBall.localPosition = Vector3.zero;
} //}
Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj); Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj);
if (varStone) if (varStone)
{ {
...@@ -1148,17 +1151,7 @@ public class GlobalConfig ...@@ -1148,17 +1151,7 @@ public class GlobalConfig
} }
varBasketBall.localPosition = Vector3.zero; varBasketBall.localPosition = Vector3.zero;
} }
Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj); Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.CubeObj);
if (varVolleyBall)
{
Rigidbody[] varBody = varVolleyBall.GetComponentsInChildren<Rigidbody>();
for (int i = 0; i < varBody.Length; i++)
{
PoolManager.Instance.ReturnObjectToPool(varBody[i].gameObject);
}
varVolleyBall.localPosition = Vector3.zero;
}
Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.StoneObj);
if (varStone) if (varStone)
{ {
Rigidbody[] varBody = varStone.GetComponentsInChildren<Rigidbody>(); Rigidbody[] varBody = varStone.GetComponentsInChildren<Rigidbody>();
...@@ -1192,7 +1185,7 @@ public class GlobalConfig ...@@ -1192,7 +1185,7 @@ public class GlobalConfig
{ {
PoolManager.Instance.SetActiveRootState(CacheManager.Instance.FootBallObj, value); PoolManager.Instance.SetActiveRootState(CacheManager.Instance.FootBallObj, value);
PoolManager.Instance.SetActiveRootState(CacheManager.Instance.BasketBallObj, value); PoolManager.Instance.SetActiveRootState(CacheManager.Instance.BasketBallObj, value);
PoolManager.Instance.SetActiveRootState(CacheManager.Instance.VolleyBallObj, value); //PoolManager.Instance.SetActiveRootState(CacheManager.Instance.VolleyBallObj, value);
PoolManager.Instance.SetActiveRootState(CacheManager.Instance.GlobeObj, value); PoolManager.Instance.SetActiveRootState(CacheManager.Instance.GlobeObj, value);
} }
else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex) else if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFourIndex)
...@@ -1271,11 +1264,11 @@ public class GlobalConfig ...@@ -1271,11 +1264,11 @@ public class GlobalConfig
{ {
varBasketBall.SetParent(parent); varBasketBall.SetParent(parent);
} }
Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj); //Transform varVolleyBall = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.VolleyBallObj);
if (varVolleyBall) //if (varVolleyBall)
{ //{
varVolleyBall.SetParent(parent); // varVolleyBall.SetParent(parent);
} //}
Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj); Transform varStone = PoolManager.Instance.GetObjectRoot(CacheManager.Instance.GlobeObj);
if (varStone) if (varStone)
{ {
......
This diff is collapsed.
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