예제 #1
0
        protected GameObject FindObj()
        {
            if (Application.isPlaying)
            {
                _init = true;
            }

            if (keys != null && typeControl != null && typeControl.value == StringTypeControl.Name && usePrefab != null && usePrefab.value && prefabName != null && prefabName.value != null)
            {
                if (!keys.value.IsAlmostSpecificCount())
                {
                    keys.value = new string[1];
                }
                keys.value[0] = prefabName.value.name;
            }

            if (typeControl != null && keys != null && includeInactiveRoot != null && isEqualCountTags != null)
            {
                if (useRoot != null && useRoot.value)
                {
                    if ((rootTransform == null || rootTransform.value == null) && typeControlRoot != null && keysRoot != null && isEqualCountTagsRoot != null)
                    {
                        if (useCanvas != null && useCanvas.value && canvasTiplogy != null)
                        {
                            rootTransform = CanvasManager.GetChild(canvasTiplogy.value);
                        }
                        else
                        {
                            rootTransform = GameObjectExtend.Find <Transform>(typeControlRoot.value, keysRoot.value, isEqualCountTagsRoot.value);
                        }
                    }

                    return(GameObjectExtend.FindInHierarchy(typeControl.value, keys.value, rootTransform.value, includeInactiveRoot.value, isEqualCountTags.value));
                }
                else
                {
                    return(GameObjectExtend.Find(typeControl.value, keys.value, isEqualCountTags.value));
                }
            }

            return(null);
        }