public Mesh GetSFMesh(string find_name)
        {
            UnityEngine.Object[] objs = SF_Resources.LoadAll(SF_Resources.pMeshes + "sf_meshes.fbx");
            if (objs == null)
            {
                Debug.LogError("sf_meshes.fbx missing");
                return(null);
            }
            if (objs.Length == 0)
            {
                Debug.LogError("sf_meshes.fbx missing sub assets");
                return(null);
            }
            foreach (UnityEngine.Object o in objs)
            {
#if UNITY_2018_2_OR_NEWER
                if (o is GameObject)
                {
                    (o as GameObject).layer = specialLayer;
                }
#endif
                if (o.name == find_name && o.GetType() == typeof(Mesh))
                {
                    return(o as Mesh);
                }
            }
            Debug.LogError("Mesh " + find_name + " could not be found in sf_meshes.fbx");
            return(null);
        }
Example #2
0
 public Mesh GetSFMesh(string find_name)
 {
     UnityEngine.Object[] objs = SF_Resources.LoadAll(SF_Resources.pMeshes + "sf_meshes.fbx");
     if (objs == null)
     {
         Debug.LogError("sf_meshes.fbx missing");
         return(null);
     }
     if (objs.Length == 0)
     {
         Debug.LogError("sf_meshes.fbx missing sub assets");
         return(null);
     }
     foreach (UnityEngine.Object o in objs)
     {
         if (o.name == find_name && o.GetType() == typeof(Mesh))
         {
             return(o as Mesh);
         }
     }
     Debug.LogError("Mesh " + find_name + " could not be found in sf_meshes.fbx");
     return(null);
 }