public virtual void RemoveObject(ICarriableTrans obj) { if (this._objs != null) { this._objs.Remove(obj); } }
public virtual void AddObject(ICarriableTrans obj) { if (!object.ReferenceEquals(obj, this)) { if (this.destroying) { Debug.LogWarning("Did not add object because the this carrier is destroying", this); } else { this.TryInit(); this._objs.Add(obj); obj.OnAddedToCarrier(this); } } }
public virtual void AddObject(ICarriableTrans obj) { if (object.ReferenceEquals(obj, this)) { return; } if (!this.destroying) { this.TryInit(); this._objs.Add(obj); obj.OnAddedToCarrier(this); } else { Debug.LogWarning("Did not add object because the this carrier is destroying", this); } }