Beispiel #1
0
        public void ReferenceUpdate()
        {
            referenceObjectList.Clear();

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


            if (ignoreSelfReference)
            {
                foreach (var selection in Selection.gameObjects)
                {
                    referenceObjectList.RemoveAll(item => item.referenceComponent.gameObject == selection);
                }
            }

            referenceObjectList.RemoveAll(item => (item.value is Component || item.value is GameObject) == false);

            referenceObjectList.Sort((x, y) => GetObjectID(x.referenceComponent) - GetObjectID(y.referenceComponent));

            refCompItems.Clear();
            foreach (var referenceObject in referenceObjectList)
            {
                if (!refCompItems.Exists(item => item.componentType == referenceObject.referenceComponent.GetType()))
                {
                    refCompItems.Add(new ReferenceObjectItem()
                    {
                        componentType = referenceObject.referenceComponent.GetType(),
                        isDisplay     = true,
                    });
                }
            }
        }