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); }
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]); }
public static MeshSource[] GetMeshSources(this Component current) { return(MeshSource.GetAll(current.gameObject)); }
public static MeshSource[] GetMeshSources(this GameObject current) { return(MeshSource.GetAll(current)); }
public static MeshSource GetMeshSource(this Component current) { return(MeshSource.Get(current.gameObject)); }
public static MeshSource GetMeshSource(this GameObject current) { return(MeshSource.Get(current)); }
public static MeshSource[] GetAll(Component target) { return(MeshSource.GetAll(target.gameObject)); }