コード例 #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);
        }
コード例 #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]);
        }
コード例 #3
0
 public static MeshSource[] GetMeshSources(this Component current)
 {
     return(MeshSource.GetAll(current.gameObject));
 }
コード例 #4
0
 public static MeshSource[] GetMeshSources(this GameObject current)
 {
     return(MeshSource.GetAll(current));
 }
コード例 #5
0
 public static MeshSource GetMeshSource(this Component current)
 {
     return(MeshSource.Get(current.gameObject));
 }
コード例 #6
0
 public static MeshSource GetMeshSource(this GameObject current)
 {
     return(MeshSource.Get(current));
 }
コード例 #7
0
 public static MeshSource[] GetAll(Component target)
 {
     return(MeshSource.GetAll(target.gameObject));
 }