static void Postfix(ShipMover __instance) { if (CheesesAITweaks.settings.rockShips) { //__instance.gameObject.AddComponent<CheeseShipRocker>(); } }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Invader") { col.gameObject.SetActive(false); Destroy(gameObject); ContainerMover containerScript = GameObject.Find("Invaders").GetComponent <ContainerMover>(); containerScript.m_invaderCount--; playerScript = GameObject.Find("Player").GetComponent <PlayerController>(); playerScript.score += 100; playerScript.invaderKilledSound.Play(); } if (col.gameObject.tag == "Ship") { Destroy(gameObject); ShipMover shipScript = GameObject.Find("Ship").GetComponent <ShipMover>(); shipScript.collided = true; playerScript = GameObject.Find("Player").GetComponent <PlayerController>(); playerScript.score += 500; playerScript.invaderKilledSound.Play(); } }
void Start() { shipMover = GetComponent <ShipMover>(); if (isLocalPlayer) { Debug.Log("IS LOCAL"); } }
private void Awake() { lastMessage = new Message_ShipUpdate(new Vector3D(), new Quaternion(), new Vector3D(), networkUID); Networker.ShipUpdate += ShipUpdate; ship = GetComponent <ShipMover>(); ship.enabled = false; shipTraverse = Traverse.Create(ship); }
public void Then_the_ship_moves_west() { const int distance = 5; var shipMover = new ShipMover(); shipMover.InitialisePosition(new Point(0, 0)); shipMover.MoveWest(distance); Assert.That(shipMover.GetPosition(), Is.EqualTo(new Point(-1 * distance, 0))); }
public void Then_the_ship_moves_forward() { //the ship starts facing east const int distance = 5; var shipMover = new ShipMover(); shipMover.InitialisePosition(new Point(0, 0)); shipMover.MoveForward(distance); Assert.That(shipMover.GetPosition(), Is.EqualTo(new Point(distance, 0))); }
private void Awake() { lastMessage = new Message_ShipUpdate(new Vector3D(), new Quaternion(), new Vector3D(), networkUID); Networker.ShipUpdate += ShipUpdate; waypoint = new Waypoint(); GameObject wptTransform = new GameObject(); waypoint.SetTransform(wptTransform.transform); ship = GetComponent <ShipMover>(); ship.enabled = false; }
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player") { playerScript.lives--; Destroy(gameObject); playerScript.restart(); } if (col.gameObject.tag == "Ship") { Destroy(gameObject); ShipMover shipScript = GameObject.Find("Ship").GetComponent <ShipMover>(); shipScript.collided = true; } }
private void Awake() { lastMessage = new Message_ShipUpdate(new Vector3D(), new Quaternion(), new Vector3D(), networkUID); ship = GetComponent <ShipMover>(); }
private void Awake() { _shipMover = GetComponent <ShipMover>(); _shipCannon = GetComponent <Cannon>(); }