private void AddSupportCollider(ShowSupportingStructureAnchor.SupportInfo info, Collider c) { if (!info._colliders.Contains(c)) { info._colliders.Add(c); } }
private void ShowSupportAnchor(IStructureSupport support, Collider c) { ShowSupportingStructureAnchor.SupportInfo supportInfo = (this._pool.Count <= 0) ? new ShowSupportingStructureAnchor.SupportInfo() : this._pool.Dequeue(); supportInfo._support = support; supportInfo._icon = PoolManager.Pools["misc"].Spawn(this._anchorPrefab, support.SupportCenter + (support as MonoBehaviour).transform.TransformDirection(this._iconOffset), Quaternion.identity); if (supportInfo._colliders == null) { supportInfo._colliders = new List <Collider>(); } supportInfo._colliders.Add(c); this._currentSupportsInfo.Add(supportInfo); }
private void RemoveSupportCollider(ShowSupportingStructureAnchor.SupportInfo info, Collider c) { if (info._colliders.Contains(c)) { info._colliders.Remove(c); if (info._colliders.Count == 0) { PoolManager.Pools["misc"].Despawn(info._icon); this._currentSupportsInfo.Remove(info); info._support = null; info._icon = null; this._pool.Enqueue(info); } } }