Commit 873b9c3c authored by wanqing's avatar wanqing

修改脚本

parent c86dec3e
......@@ -222,7 +222,7 @@ public class FruitView : MonoBehaviour
}
if(varGo)
{
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>();
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>(true);
for (int i = 0; i < varRigid.Length; i++)
{
varPosLst.Add(varRigid[i].transform.localPosition);
......@@ -252,7 +252,7 @@ public class FruitView : MonoBehaviour
}
if (varGo)
{
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>();
Rigidbody[] varRigid = varGo.GetComponentsInChildren<Rigidbody>(true);
for (int i = 0; i < varRigid.Length; i++)
{
varPosLst.Add(varRigid[i].transform.localPosition);
......@@ -286,9 +286,10 @@ public class FruitView : MonoBehaviour
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>(true);
for (int m = 0; m < varRigid.Length; m++)
{
varRigid[m].gameObject.SetActive(true);
varRigid[m].transform.localPosition = varPosLst[m];
varRigid[m].transform.localRotation = Quaternion.identity;
varRigid[m].transform.localScale = varSizeLst[m];
......@@ -1334,6 +1335,22 @@ public class FruitView : MonoBehaviour
//装饰阶段3停止
void OnStopAction()
{
//掉落的不显示
if (BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelThreeIndex ||
BattleCtrl.instance.levelManager.CurLevelIndex == LevelEnum.levelFiveIndex)
{
for (int i = 0; i < m_smallBallLst.Count; i++)
{
Rigidbody[] varRigid = m_smallBallLst[i].GetComponentsInChildren<Rigidbody>(true);
for (int m = 0; m < varRigid.Length; m++)
{
if (varRigid[m].velocity.y < -10.0f)
{
varRigid[m].gameObject.SetActive(false);
}
}
}
}
if (m_cheeseView)
{
m_cheeseView.StopStage3();
......@@ -1385,7 +1402,8 @@ public class FruitView : MonoBehaviour
if(m_cheeseView)
{
m_cheeseView.transform.SetParent(parent);
m_cheeseView.transform.DOLocalMove(m_rightNodePos, 0.02f);
//m_cheeseView.transform.DOLocalMove(m_rightNodePos, 0.02f);
m_cheeseView.transform.localPosition = m_rightNodePos;
}
}
//删除装饰品
......
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