private void Awake() { sn = gameObject.GetComponent <ShipNavigation>(); rb = transform.GetComponent <Rigidbody>(); trustStart = Time.time; onOrbit = false; strbc = rb.constraints; orbitSpeed = shipSpeed; }
public void Puzzle_12B() { var nav = new ShipNavigation(); foreach (var order in PuzzleInputs.Puzzle12) { nav.Move(order); } Assert.Equal(28591, nav.ManhattanDistance); }
public void Should_move_waypoint_in_specified_directions( string order, int expectedX, int expectedY) { var nav = new ShipNavigation(); nav.Move(order); Assert.Equal(expectedX, nav.Waypoint.Position.X); Assert.Equal(expectedY, nav.Waypoint.Position.Y); }
public void Should_move_forward_according_to_current_waypoint_direction( string[] orders, int expectedX, int expectedY) { var nav = new ShipNavigation(); foreach (var order in orders) { nav.Move(order); } Assert.Equal(expectedX, nav.Position.X); Assert.Equal(expectedY, nav.Position.Y); }
public void Example_2() { var orders = new[] { "F10", "N3", "F7", "R90", "F11" }; var nav = new ShipNavigation(); foreach (var order in orders) { nav.Move(order); } Assert.Equal(286, nav.ManhattanDistance); }
void Awake() { instance = this; coreSystems = new ShipSystem[5]; shipPower = new ShipPower(); coreSystems[0] = shipPower; shipPropulsion = new ShipPropulsion(); coreSystems[1] = shipPropulsion; shipCargo = new ShipCargoHolds(GetComponent <InventoryUI>()); coreSystems[2] = shipCargo; shipWeapons = new ShipWeapons(); coreSystems[3] = shipWeapons; shipNavigation = new ShipNavigation(); coreSystems[4] = shipNavigation; Debug.Log("Systems initalized!"); shipMode = ShipMode.OFF; }
public void Initialize() { ship = new ShipNavigation(); waypoint = new WaypointNavigation(ship); }
void Awake() { shipMovement = GetComponent <ShipMovement>(); shipNavigation = GetComponent <ShipNavigation>(); rockCradle = GetComponentInChildren <RockCradle>(); }