Beispiel #1
0
        private void DrawGroup(Rect r, string label, int childCount)
        {
            // GUI.Label(r, label + " (" + childCount + ")", EditorStyles.boldLabel);
            FR2_Asset asset = dicIndex[label][0].asset;

            Texture tex  = AssetDatabase.GetCachedIcon(asset.assetPath);
            Rect    rect = r;

            if (tex != null)
            {
                rect.width = 16f;
                GUI.DrawTexture(rect, tex);
            }

            rect       = r;
            rect.xMin += 16f;
            GUI.Label(rect, asset.assetName, EditorStyles.boldLabel);

            rect       = r;
            rect.xMin += rect.width - 50f;
            GUI.Label(rect, FR2_Helper.GetfileSizeString(asset.fileSize), EditorStyles.miniLabel);

            rect       = r;
            rect.xMin += rect.width - 70f;
            GUI.Label(rect, childCount.ToString(), EditorStyles.miniLabel);

            rect       = r;
            rect.xMin += rect.width - 70f;
        }
Beispiel #2
0
        public static IEnumerable <Object> GetAllRefObjects(GameObject obj)
        {
            Component[] components = obj.GetComponents <Component>();
            foreach (Component com in components)
            {
                if (com == null)
                {
                    continue;
                }

                foreach (var anyObject in FR2_Helper.GetFromPlayableGraph(com))
                {
                    yield return(anyObject);
                }

                var serialized        = new SerializedObject(com);
                SerializedProperty it = serialized.GetIterator().Copy();
                while (it.NextVisible(true))
                {
                    if (it.propertyType != SerializedPropertyType.ObjectReference)
                    {
                        continue;
                    }

                    if (it.objectReferenceValue == null)
                    {
                        continue;
                    }

                    yield return(it.objectReferenceValue);
                }
            }
        }