예제 #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
    public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        cartucho = GameObject.Find ("/FPSController/FirstPersonCharacter/armas/animacionColt44-40/cartucho_006");
        m =cartucho.GetComponent<SkinnedMeshRenderer>();

        m.enabled = false;
        //Instantiate(flash,);
        casquillos = animator.GetInteger ("casquillos");

        //GameObject Object1 = GameObject.Find ("armas");
        //Component anotherScript = Object1.GetComponent<disparosDelJugador> ();
        disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
        disparo.disparo (3);
        anim = GameObject.Find ("animacionColt44-40").GetComponent<Animator> ();

        anim.SetInteger ("cartuchos",anim.GetInteger("cartuchos")-1);
        //Transform bone = GetComponent<Animator>().avatar.GetBone(BoneType.LeftShoulder);

        objetin = GameObject.FindGameObjectsWithTag ("canionColt");
        posicionHueso = objetin [0].transform;
        Debug.Log("Posicion del hgueso -----------------"+posicionHueso.position+"----------------------");

        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*/
    }
예제 #2
0
	// Use this for initialization
	void Start(){
		anim = GetComponent<Animator> ();
		dispParoDelJugador = GetComponentInParent<disparosDelJugador> ();
		anim.SetInteger ("cartuchos", municionActual);
		anim.SetInteger ("reservas", municionReservas);

		muestraMunicion ();
	}
예제 #3
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
    public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        //Instantiate(flash,);
        //		casquillos = animator.GetInteger ("casquillos");

        //GameObject Object1 = GameObject.Find ("armas");
        //Component anotherScript = Object1.GetComponent<disparosDelJugador> ();
        disparo = GameObject.Find ("armas").GetComponent<disparosDelJugador> ();
        disparo.disparo (.34f);
        anim = GameObject.Find ("Animacionwinchester_94_30-30").GetComponent<Animator> ();

        anim.SetInteger ("cartuchos",anim.GetInteger("cartuchos")-1);

        //		Script1.disparo ();
    }
예제 #4
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 ();
		
		
	}