public void TransformIntoProjecticle(Vector3 PositionOther) { _rigid.freezeRotation = false; _rigid.constraints = RigidbodyConstraints.None; Vector3 direction = _trans.position - PositionOther; _rigid.AddForceAtPosition((direction + Vector3.up).normalized * 1000, direction / 2f + _trans.position); _col.enabled = false; _poolComponent.BackToPool(5f); }
public void SelfDestroy(bool DestroyBody) { if (DestroyBody && CurrentBody) { CurrentBody.SelfDestroy(); } DestroyLinkToBody(); if (_poolComponent != null) { _poolComponent.BackToPool(); } else { GameplayManager.Instance.RemoveBehaviourEntity(ApplyBehaviour); Destroy(gameObject); } }