public void spawnNewPlayer() { Transform spawn = respawns[Random.Range(0, this.respawns.Length)].transform; this.movingLeft = false; this.movingRight = false; this.movingFront = false; this.movingBack = false; this.barrelLeft = false; this.barrelRight = false; this.ship = Network.Instantiate(shipPrefab, spawn.position, spawn.rotation, 0) as GameObject; //this.ship.rigidbody.interpolation = RigidbodyInterpolation.Interpolate; // use this if add velocity in Update and not in Fixed update this.camScript.setTarget(this.ship.transform); this.camScriptCrossHair.setTarget(this.ship.transform); this.shipMovementsScript = ship.GetComponent <ShipMovements>(); this.shipWeaponsScript = ship.GetComponent <ShipWeapons>(); this.shipCrosshairScript = ship.GetComponent <ShipCrosshair>(); this.camScript.resetZoom(); this.camScriptCrossHair.resetZoom(); this.scriptUI.setScriptLife(ship.GetComponent <shipLife>()); this.scriptUI.setScriptWeapons(ship.GetComponent <ShipWeapons>()); this.scriptUI.setScriptMovements(this.shipMovementsScript); }
void OnCrosshairCreated() { m_Crosshair = transform.Find("Crosshair").GetComponent <ShipCrosshair>(); }
void OnCrosshairCreated() { m_Crosshair = transform.Find( "Crosshair" ).GetComponent<ShipCrosshair>(); }