Ejemplo n.º 1
0
   }//update

     //We can use trigger or Collision
    void OnTriggerEnter(Collider col)
    {
        //col.GetComponent<Collider>().enabled = false;
        if (col.gameObject.tag == "net" && !this.caught){
            print("Caught rabbit w net");
            //fpc.canMove = false;
            //indText.Caught();
            caught = true;
            UnityStandardAssets.Characters.FirstPerson.FirstPersonController fpc = (UnityStandardAssets.Characters.FirstPerson.FirstPersonController) this.gameObject.GetComponent(typeof(UnityStandardAssets.Characters.FirstPerson.FirstPersonController));
            forceDrop();
            fpc.Cmd_setCanMove();
            CountRabbit cr = (CountRabbit) textMeshP.GetComponent<CountRabbit>();
            cr.KillRabbit();
            StartCoroutine(ExecuteAfterTime(2));
            //SteamVR_Controller.Input(0).TriggerHapticPulse(500);
            //this.gameObject.SendMessage("setCanMove");
        }
        //col.GetComponent<Collider>().enabled = true;
    }