public virtual void RemovePart(ShellPart part) { if (part.GetComponent <Ability>()) { part.GetComponent <Ability>().SetDestroyed(true); } entityBody.mass -= part.partMass; weight -= part.partMass * weightMultiplier; if (this as Craft) { (this as Craft).CalculatePhysicsConstants(); } Domino(part); part.Detach(); parts.Remove(part); }
public bool IsAdjacent(ShellPart part) { return(part.GetComponent <SpriteRenderer>().bounds.Intersects(GetComponent <SpriteRenderer>().bounds)); }