Example #1
0
        public static MeshSource Get(GameObject target)
        {
            if (target.IsNull())
            {
                return(null);
            }
            if (MeshSource.cache.ContainsKey(target))
            {
                return(MeshSource.cache[target]);
            }
            var result = new MeshSource(target);

            return(result.exists ? result : null);
        }
Example #2
0
        public static MeshSource[] GetAll(GameObject target)
        {
            if (target.IsNull())
            {
                return(null);
            }
            if (MeshSource.cacheAll.ContainsKey(target))
            {
                return(MeshSource.cacheAll[target]);
            }
            var components = new List <Component>(target.GetComponentsInChildren <MeshFilter>());

            components.AddRange(target.GetComponentsInChildren <SkinnedMeshRenderer>());
            MeshSource.cacheAll[target] = components.Select(x => MeshSource.Get(x)).ToArray();
            return(MeshSource.cacheAll[target]);
        }
Example #3
0
 public static MeshSource[] GetMeshSources(this Component current)
 {
     return(MeshSource.GetAll(current.gameObject));
 }
Example #4
0
 public static MeshSource[] GetMeshSources(this GameObject current)
 {
     return(MeshSource.GetAll(current));
 }
Example #5
0
 public static MeshSource GetMeshSource(this Component current)
 {
     return(MeshSource.Get(current.gameObject));
 }
Example #6
0
 public static MeshSource GetMeshSource(this GameObject current)
 {
     return(MeshSource.Get(current));
 }
Example #7
0
 public static MeshSource[] GetAll(Component target)
 {
     return(MeshSource.GetAll(target.gameObject));
 }