|
@@ -53,7 +53,7 @@ namespace GFGGame
|
|
|
foreach (Transform t in parent)
|
|
|
{
|
|
|
string[] strs = t.name.Split('_');
|
|
|
- if (strs.Length > 1 && strs[1] == "eff") continue;//不计算特效大小
|
|
|
+ if (strs.Length > 1 && strs[1].IndexOf("e") >= 0) continue;//不计算特效大小
|
|
|
BoxCollider2D render = t.GetComponent<BoxCollider2D>();
|
|
|
if (render)
|
|
|
{
|
|
@@ -61,12 +61,12 @@ namespace GFGGame
|
|
|
center += render.bounds.center;
|
|
|
}
|
|
|
}
|
|
|
- center /= index;
|
|
|
+ if (index > 0) center /= index;
|
|
|
Bounds bounds = new Bounds(center, Vector3.zero);
|
|
|
foreach (Transform t in parent)
|
|
|
{
|
|
|
string[] strs = t.name.Split('_');
|
|
|
- if (strs.Length > 1 && strs[1] == "eff") continue;
|
|
|
+ if (strs.Length > 1 && strs[1].IndexOf("e") >= 0) continue;
|
|
|
BoxCollider2D render = t.GetComponent<BoxCollider2D>();
|
|
|
if (render) bounds.Encapsulate(render.bounds);
|
|
|
}
|
|
@@ -78,7 +78,7 @@ namespace GFGGame
|
|
|
foreach (Transform t in parent)
|
|
|
{
|
|
|
string[] strs = t.parent.name.Split('_');
|
|
|
- if (strs.Length > 1 && strs[1] == "eff") continue;
|
|
|
+ if (strs.Length > 1 && strs[1].IndexOf("e") >= 0) continue;
|
|
|
t.position = t.position - bounds.center;
|
|
|
}
|
|
|
|
|
@@ -120,6 +120,7 @@ namespace GFGGame
|
|
|
if (state != "refresh")
|
|
|
{
|
|
|
int index = itemGameObjs.IndexOf(hitGameObj);
|
|
|
+ if (index == itemGameObjs.Count - 1 && state == "top") return;
|
|
|
if (state != "top")
|
|
|
{
|
|
|
if (index < 0)
|
|
@@ -208,7 +209,7 @@ namespace GFGGame
|
|
|
{
|
|
|
Transform tf = parentObj.transform.GetChild(i);
|
|
|
string[] strs = tf.name.Split('_');
|
|
|
- if (strs.Length > 1 && strs[1] == "eff")//子物体是特效
|
|
|
+ if (strs.Length > 1 && strs[1].IndexOf("e") >= 0)//子物体是特效
|
|
|
{
|
|
|
DressUpUtil.SetRenderersOrder(tf.gameObject, changeLayer, true);
|
|
|
}
|