Ejemplo n.º 1
0
        //path,资源路径
        public GameColliderItem GetColliderItem(string path)
        {
            GameColliderItem colliderItem = null;

            if (m_cGameColliderSet != null)
            {
                path         = m_sRootDir + path;
                colliderItem = m_cGameColliderSet.GetColliderItem(path);
            }
            return(colliderItem);
        }
Ejemplo n.º 2
0
        public void Init(string path)
        {
            m_cColliderItem = GameColliderCfgSys.Instance.GetColliderItem(path);
            m_lstColliders.Clear();


            if (m_cColliderItem != null && m_cColliderItem.mLstData.Count > 0)
            {
                for (int i = 0; i < m_cColliderItem.mLstData.Count; i++)
                {
                    var c = Create2DCollider(m_cColliderItem.mLstData[i]);
                    m_lstColliders.Add(c);
                }
            }
            Reculate();
        }
Ejemplo n.º 3
0
 public void Reset()
 {
     m_cColliderItem = null;
     for (int i = 0; i < m_lstColliders.Count; i++)
     {
         var collider = m_lstColliders[i];
         if (collider is C2D_Rect)
         {
             ObjectPool <C2D_Rect> .Instance.SaveObject((C2D_Rect)collider);
         }
         else if (collider is C2D_Circle)
         {
             ObjectPool <C2D_Circle> .Instance.SaveObject((C2D_Circle)collider);
         }
     }
     m_lstColliders.Clear();
 }