void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Instantiate(explosion, transform.position, transform.rotation); Destroy(gameObject); if (isMultiplier) { assignedGameController.gamecontroller.IncreaseMultiplier(); } if (isUpgrade) { shotSpawnLocation.x = PlayerObject.transform.position.x - 0.66f; shotSpawnLocation.y = 0.0f; shotSpawnLocation.z = PlayerObject.transform.position.z - 0.2f; GameObject go = Instantiate(doubleShotControl1, shotSpawnLocation, Quaternion.identity) as GameObject; go.transform.parent = PlayerObject.transform; doubleShotControl1Component = go.GetComponent <ShotControl> (); doubleShotControl1Component.SwitchSpawn(true); shotSpawnLocation.x = PlayerObject.transform.position.x + 0.66f; shotSpawnLocation.y = 0.0f; shotSpawnLocation.z = PlayerObject.transform.position.z - 0.2f; go = Instantiate(doubleShotControl2, shotSpawnLocation, Quaternion.identity) as GameObject; go.transform.parent = PlayerObject.transform; doubleShotControl1Component = go.GetComponent <ShotControl> (); doubleShotControl1Component.SwitchSpawn(true); } assignedGameController.gamecontroller.addScore(scoreValue); } }
void Start() { timer = 3.0f; collider = GetComponent <Collider2D>(); shotCtrl = GetComponent <ShotControl>(); rigidBody = GetComponent <Rigidbody2D>(); }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); camSpeed = camSpeedDefault; nextRotationChange = Time.time; nextXCheck = 0; angle = 0f; }
void Awake() { shotControl = GetComponent <ShotControl>(); vision = GetComponent <Vision>(); camSpeed = camSpeedDefault; nextRotationChange = Time.time; nextXCheck = 0; angle = 0f; }
void Awake() { shotControl = GetComponent <ShotControl>(); vision = GetComponent <Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; }
/// <summary> /// Стрельба по кораблям /// </summary> /// <param name="ship"></param> private void Shoot(SpaceShip ship) { var shot = new Shot(ship, MapCenter); var newShotObject = new ShotControl(shot); Panel.SetZIndex(newShotObject, 20); Map.Children.Add(newShotObject); Canvas.SetTop(newShotObject, -1000); Canvas.SetLeft(newShotObject, -1000); _shotObjects[shot] = newShotObject; }
void Awake() { shotControl = GetComponent <ShotControl>(); vision = GetComponent <Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; nextTargetMemory = new Dictionary <Position, Position>(); previousTarget = null; currentTarget = null; }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; nextTargetMemory = new Dictionary<Position, Position>(); previousTarget = null; currentTarget = null; }
void Start() { s = GetComponent<ShotControl>(); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
private void Awake() { shotControlInspec = shotControlObject.GetComponent <ShotControl>(); gameController = GameObject.FindWithTag("gameCon").GetComponent <GameController>(); }
void Start() { s = GetComponent <ShotControl>(); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; }
void Awake() { clientObject = GameObject.FindWithTag("Server"); shotControlInspec = shotControl.GetComponent <ShotControl>(); client = clientObject.GetComponent <TCPServer>(); }