Exemplo n.º 1
0
    public override void OnPhotonPlayerDisconnected(PhotonPlayer disconnetedPlayer)
    {
        Debug.Log(disconnetedPlayer.name + " disconnected...");
        CarRaceControl toRemove = null;

        foreach (CarRaceControl rc in carControllers)
        {
            //Debug.Log (rc.photonView.owner);
            if (rc.photonView.owner == null)
            {
                toRemove = rc;
            }
        }
        // remove car controller of disconnected player from the list
        carControllers.Remove(toRemove);

        // reset names, so next frame can include only remaining players
        foreach (Text name in playerNames)
        {
            name.text = "";
        }
    }
Exemplo n.º 2
0
 // register car with manager
 // get and manage waypoints
 void Start()
 {
     carRaceControl = GetComponent <CarRaceControl>();
     carRigidBody   = GetComponentInChildren <VehicleController>().physicsBody.GetComponent <Rigidbody>();
 }
Exemplo n.º 3
0
	// register car with manager
	// get and manage waypoints
	void Start () {
		carRaceControl = GetComponent<CarRaceControl>();
        carRigidBody = GetComponentInChildren<VehicleController>().physicsBody.GetComponent<Rigidbody>();
	}