예제 #1
0
    public override void SceneLoadLocalDone(string scene)
    {
        // aquí ponemos lo que pasa localmente cada vez que se carga una nueva escena

        if (scene != "Menu")
        {
            //CamaraJugador.Instantiate();
            CamaraJugador.Instantiate();
            Jugador.Instantiate();
        }
    }
예제 #2
0
	// Use this for initialization
	public override void OnStartLocalPlayer ()
	{
		if (isLocalPlayer) {
			GameObject.Find ("Scene Camera").SetActive (false);
			//GetComponent<CharacterController>().enabled = true;
			//GetComponent<UnityStandardAssets.Characters.FirstPerson.FirstPersonController>().enabled = true;
			CharacterControllerLogic ccl = GetComponent<CharacterControllerLogic> ();
			ccl.enabled = true;

			GetComponentInChildren<Camera> ().enabled = true;

			Player_CameraManager PCM = GetComponentInChildren<Player_CameraManager>();
			PCM.enabled = true;

			CamaraJugador cg = GetComponentInChildren<CamaraJugador> ();
			cg.enabled = true;
			CameraInstance = cg;

			ccl.gamecam = cg;

			AudioListener AL = GetComponentInChildren<AudioListener> ();
			AL.enabled = true;




			//FPSCharacterCam.enabled = true;
			//audioListener.enabled = true;

			/*GameObject Pref = Instantiate (Prefab, transform.position - (transform.forward * 10f), transform.rotation) as GameObject;
		CamaraJugador cJ = Prefab.GetComponent<CamaraJugador> ();
		cJ.CameraTarget = myTrans;
		*/
			//GetComponent<CharacterControllerLogic> ().gamecam = cJ;


			/*Renderer[] rens = GetComponentsInChildren<Renderer>();
		foreach(Renderer ren in rens)
		{
			ren.enabled = false;
		}*/
		}
		GetComponent<NetworkAnimator> ().SetParameterAutoSend (0, true);
	}