public EngineRoom(ShipItem ship, Rigidbody shipRigidbody) { _ship = ship; _shipData = ship.Data; _shipTransform = ship.transform; _shipRigidbody = shipRigidbody; _gameMgr = GameManager.Instance; _gameTime = GameTime.Instance; _jobMgr = JobManager.Instance; _driftCorrector = new DriftCorrector(ship.transform, shipRigidbody, DebugName); Subscribe(); }
public override void Launch(IElementAttackable target, AWeapon weapon, Topography topography) { base.Launch(target, weapon, topography); _positionLastRangeCheck = Position; _rigidbody.velocity = ElementVelocityAtLaunch; _courseUpdatePeriod = new GameTimeDuration(1F / CourseUpdateFrequency); SteeringInaccuracy = CalcSteeringInaccuracy(); target.deathOneShot += TargetDeathEventHandler; _driftCorrector = new DriftCorrector(FullName, transform, _rigidbody); enabled = true; }
protected override void Awake() { base.Awake(); _driftCorrector = new DriftCorrector(transform, _rigidbody); }