|
@@ -236,8 +236,11 @@ namespace GFGGame
|
|
PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer);
|
|
PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer);
|
|
if (setLayer)
|
|
if (setLayer)
|
|
{
|
|
{
|
|
- parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition;
|
|
|
|
- pos = parentGameObj3.transform.localPosition;
|
|
|
|
|
|
+ if(parentGameObj3.transform.childCount > 0)
|
|
|
|
+ {
|
|
|
|
+ parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition;
|
|
|
|
+ pos = parentGameObj3.transform.localPosition;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer2))
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer2))
|
|
@@ -246,8 +249,11 @@ namespace GFGGame
|
|
PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer);
|
|
PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer);
|
|
if (setLayer)
|
|
if (setLayer)
|
|
{
|
|
{
|
|
- parentGameObj2.transform.localPosition = pos == Vector3.zero ? -parentGameObj2.transform.GetChild(0).localPosition : pos;
|
|
|
|
- pos = parentGameObj2.transform.localPosition;
|
|
|
|
|
|
+ if (parentGameObj2.transform.childCount > 0)
|
|
|
|
+ {
|
|
|
|
+ parentGameObj2.transform.localPosition = pos == Vector3.zero ? -parentGameObj2.transform.GetChild(0).localPosition : pos;
|
|
|
|
+ pos = parentGameObj2.transform.localPosition;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer1))
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer1))
|
|
@@ -258,8 +264,12 @@ namespace GFGGame
|
|
|
|
|
|
if (setLayer)
|
|
if (setLayer)
|
|
{
|
|
{
|
|
- parentGameObj1.transform.localPosition = pos == Vector3.zero ? -parentGameObj1.transform.GetChild(0).localPosition : pos;
|
|
|
|
- pos = parentGameObj1.transform.localPosition;
|
|
|
|
|
|
+ if (parentGameObj1.transform.childCount > 0)
|
|
|
|
+ {
|
|
|
|
+ parentGameObj1.transform.localPosition = pos == Vector3.zero ? -parentGameObj1.transform.GetChild(0).localPosition : pos;
|
|
|
|
+ pos = parentGameObj1.transform.localPosition;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|