private void SetPosition(Vector3 newPos) { if (!calculated) { UpdateSelf(); } if (AdaptToParent) { pMax += (Vector2)(newPos - transform.position); pMin += (Vector2)(newPos - transform.position); transform.position = (anchorMaxPoint + pMax + anchorMinPoint + pMin) / 2; } CustomCollider customCollider = GetComponent <CustomCollider>(); if (customCollider != null) { customCollider.OnMoving(); } }