Exemplo n.º 1
0
	//	private AnotherScript anotherScript;
	//private GameObject otherScript;
	//OtherScript = GetComponent(OtherScript);
	//public GameObject objectToAccess;
	// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
	override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
		//Instantiate(flash,);
//		casquillos = animator.GetInteger ("casquillos");
		anim = GameObject.Find ("Animacionwinchester_94_30-30").GetComponent<Animator> ();
		controlArma=GameObject.Find ("Animacionwinchester_94_30-30").GetComponent<controlDeArmasJugador> ();
		disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
		//GameObject Object1 = GameObject.Find ("armas");
		//Component anotherScript = Object1.GetComponent<disparosDelJugador> ();
		disparo.disparo(controlArma.danio);
		controlArma.disparar ();
		objetin = GameObject.FindGameObjectsWithTag ("canionWinchester");

		posicionHueso = objetin [0].transform;
		Instantiate (esfera, posicionHueso.position,posicionHueso.rotation);
		//		Script1.disparo ();
		
		
	}
Exemplo n.º 2
0
//	private camaraMira funcionesDeCamara;
//	private AnotherScript anotherScript;
	//private GameObject otherScript;
	//OtherScript = GetComponent(OtherScript);
	//public GameObject objectToAccess;
	 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
	override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
		//funcionesDeCamara = Camera.main.transform.root.GetComponent<camaraMira>();
		controlArma=GameObject.Find ("/JugadorFps/FirstPersonCharacter/armas/animacionColt44-40").GetComponent<controlDeArmasJugador> ();
		cartucho = GameObject.Find ("/JugadorFps/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
		disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
		anim = GameObject.Find ("animacionColt44-40").GetComponent<Animator> ();
		m =cartucho.GetComponent<SkinnedMeshRenderer>();
		objetin = GameObject.FindGameObjectsWithTag ("canionColt");
		m.enabled = false;
	
		posicionHueso = objetin [0].transform;
		//Instantiate(flash,);
		casquillos = animator.GetInteger ("casquillos");

		//GameObject Object1 = GameObject.Find ("armas");
		//Component anotherScript = Object1.GetComponent<disparosDelJugador> ();

		disparo.disparo (3);
		controlArma.disparar ();



		//Transform bone = GetComponent<Animator>().avatar.GetBone(BoneType.LeftShoulder);


//		Debug.Log("Posicion del hgueso -----------------"+posicionHueso.position+"----------------------");
		//funcionesDeCamara.miraMovedizaCamara ();
		Instantiate (esfera, posicionHueso.position,posicionHueso.rotation);

//		Script1.disparo ();
		/*abtenemos posicion del 
		posicion = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/marco").GetComponent<Transform>();
		Debug.Log ("+++++++++++ la poscion del flash es:   " + posicion.position + "+++++++++++++++++++");canion*/

		/*obtenemos un hueso*/


	}