Пример #1
0
 /// <summary>
 /// 收集碰撞依赖
 /// </summary>
 /// <param name="colliders"></param>
 /// <param name="list"></param>
 public static void CollectColliderDependencies(List <MeshCollider> colliders, List <ResDepBase> list)
 {
     // 碰撞
     {
         var dep = ResDepColliderMesh.CollectDependencies(colliders);
         if (null != dep)
         {
             list.Add(dep);
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 收集依赖
        /// </summary>
        public static ResDepColliderMesh CollectDependencies(List <MeshCollider> colliders)
        {
            ResDepColliderMesh dep = null;

            for (int i = 0, ci = colliders.Count; i < ci; ++i)
            {
                var c = colliders[i];
                if (null == c.sharedMesh)
                {
                    continue;
                }
                if (null == dep)
                {
                    dep = new ResDepColliderMesh();
                }
                dep._colliders.Add(c);
            }

            return(dep);
        }