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; } }
|
||||
}
|
||||
|
||||
var point2 = GameObject.Find("point2");
|
||||
var point2 = GameObject.Find("touchArray/point2");
|
||||
if (point2 == null)
|
||||
{
|
||||
var allTransforms = Resources.FindObjectsOfTypeAll<Transform>();
|
||||
foreach(var t in allTransforms) { if (t.name == "point2") { point2 = t.gameObject; break; } }
|
||||
var touchArray = GameObject.Find("touchArray");
|
||||
if (touchArray != null)
|
||||
{
|
||||
var p2 = touchArray.transform.Find("point2");
|
||||
if (p2 != null) point2 = p2.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
if (shose != null)
|
||||
|
||||
Reference in New Issue
Block a user