public void creat() { airwallCollider = AirWallColliderPool.Instance.OutPool(); airwallCollider.SetPosition(Pos); airwallCollider.SetName(ID); AirWallManager.Instance.Add(this); }
public void destroy() { if (airwallCollider != null) { AirWallColliderPool.Instance.InPool(airwallCollider); airwallCollider = null; } AirWallManager.Instance.Remove(this); }
public AirWallCollider OutPool() { AirWallCollider item = null; if (list.Count == 0) { item = new AirWallCollider(); } else { item = list[0]; item.SetActive(true); list.RemoveAt(0); } return(item); }
public void InPool(AirWallCollider wall) { wall.SetActive(false); list.Add(wall); }