// 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) {
	//
		controlArma =GameObject.Find ("Animacionwinchester_94_30-30").GetComponent<controlDeArmasJugador> ();
		cartuchos = animator.GetInteger("cartuchos")+1;
		animator.SetInteger ("cartuchos", cartuchos);
		//controlArma.muestraMunicion ();
		controlArma.municionActual++;
		controlArma.dismiNuirParque ();
		//controlArma.muestraMunicion ();
		//controlArma.muestraMunicion ();
	}
Exemplo n.º 2
0
	//private GameObject cartucho1;
	 // 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) {
		//cartuchos = animator.GetInteger("cartuchos")+1;
		controlArma =GameObject.Find ("/JugadorFps/FirstPersonCharacter/armas/animacionColt44-40").GetComponent<controlDeArmasJugador> ();
		cartucho = GameObject.Find ("/JugadorFps/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
		m =cartucho.GetComponent<SkinnedMeshRenderer>();

		cartucho0 = GameObject.Find ("/JugadorFps/FirstPersonCharacter/armas/animacionColt44-40/cartucho_000");
		m0 =cartucho0.GetComponent<SkinnedMeshRenderer>();
		controlArma.municionActual++;
		controlArma.dismiNuirParque ();
		m0.enabled = false;
		m.enabled = true;

		//cartucho.SetActive(false);
	}