void UpdateAllObject()
        {
            allObject = SceneObjectUtility.GetAllObjectsInScene(false);
            allObject.Sort((x, y) => {
                return(System.String.Compare(x.name, y.name));
            });

            if (SceneObjectUtility.SceneReferenceObjects.Length == 0)
            {
                SceneObjectUtility.UpdateReferenceList();
            }
        }
 public void OnFocus()
 {
     SceneObjectUtility.UpdateReferenceList();
     UpdateCalledObjectList();
 }
Example #3
0
        public void OnSelectionChange()
        {
            referenceObjectList.Clear();
            perhapsReferenceObjectList.Clear();

            SceneObjectUtility.UpdateReferenceList();

            foreach (var selection in Selection.gameObjects)
            {
                SceneObjectUtility.GetReferenceObject(selection, referenceObjectList);

                if (findWillAccessComponent)
                {
                    foreach (var component in selection.GetComponents <MonoBehaviour>())
                    {
                        UpdatePerahpsReferenceObjectList(component, perhapsReferenceObjectList);
                    }
                }
            }


            if (ignoreSelfReference)
            {
                foreach (var selection in Selection.gameObjects)
                {
                    referenceObjectList.RemoveAll(item => SceneObjectUtility.GetGameObject(item.value) == selection);
                }
            }

            refCompItems.Clear();

            if (findWillAccessComponent)
            {
                foreach (var selection in Selection.gameObjects)
                {
                    foreach (var component in selection.GetComponents <MonoBehaviour>())
                    {
                        if (!refCompItems.Exists(item => item.componentType == component.GetType()))
                        {
                            refCompItems.Add(new ReferenceObjectItem()
                            {
                                componentType = component.GetType(),
                                isDisplay     = true,
                            });
                        }
                    }
                }

                foreach (var obj in referenceObjectList)
                {
                    perhapsReferenceObjectList.RemoveAll(item => item.referenceMonobehaviourName == obj.value.GetType().Name);
                }
            }
            else
            {
                foreach (var referenceObject in referenceObjectList)
                {
                    if (!refCompItems.Exists(item => item.componentType == referenceObject.referenceComponent.GetType()))
                    {
                        refCompItems.Add(new ReferenceObjectItem()
                        {
                            componentType = referenceObject.referenceComponent.GetType(),
                            isDisplay     = true,
                        });
                    }
                }
            }
        }