Fix GameObject.Find resolving the wrong point2 object (womanPointArray/point2 instead of touchArray/point2)
This commit is contained in:
@@ -428,11 +428,15 @@ public class PageController : MonoBehaviour
|
|||||||
foreach(var t in allTransforms) { if (t.parent == null && t.name == "Shose") { shose = t.gameObject; break; } }
|
foreach(var t in allTransforms) { if (t.parent == null && t.name == "Shose") { shose = t.gameObject; break; } }
|
||||||
}
|
}
|
||||||
|
|
||||||
var point2 = GameObject.Find("point2");
|
var point2 = GameObject.Find("touchArray/point2");
|
||||||
if (point2 == null)
|
if (point2 == null)
|
||||||
{
|
{
|
||||||
var allTransforms = Resources.FindObjectsOfTypeAll<Transform>();
|
var touchArray = GameObject.Find("touchArray");
|
||||||
foreach(var t in allTransforms) { if (t.name == "point2") { point2 = t.gameObject; break; } }
|
if (touchArray != null)
|
||||||
|
{
|
||||||
|
var p2 = touchArray.transform.Find("point2");
|
||||||
|
if (p2 != null) point2 = p2.gameObject;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shose != null)
|
if (shose != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user