void FixedUpdate() { var direction = MathfExtentions.DegreeToVector2(RigidBody.rotation); MoveKinematicRB(_speed, direction); }
private void Start() { _velocityVector = MathfExtentions.DegreeToVector2(Random.Range(0, 360)); _asteroidSize = GetComponent<AsteroidSettingsComponent>().Size; }
void Shoot() { var offsetFromTheShip = 0.5f; var posOffset = _rb.position + ((_boxCollider2D.size.x / 2 + offsetFromTheShip) * MathfExtentions.DegreeToVector2(transform.eulerAngles.z)); Instantiate(GameCore.Instance.GameSettings.PlayerBulletPrefab, posOffset, transform.rotation); }