Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (this.transform.position.y < -0.5)
     {
         Destroy(this.gameObject);
         shoot_script_obj = Camera.main.GetComponent<ShootScript>();
         shoot_script_obj.RespawnBall();
     }
 }
Exemplo n.º 2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Paper" && enable) {
            Debug.Log("Collided with a recycle bin");
            Destroy(other.gameObject);
            shoot_script_obj = Camera.main.GetComponent<ShootScript>();
            shoot_script_obj.RespawnBall();
            this.gameObject.GetComponentInChildren<ParticleSystem>().Play();
            this.gameObject.GetComponentInChildren<AudioSource>().Play();
            ExecuteEvents.Execute<PointInterface>(
                target: GameObject.Find("GameManager"),
                eventData: null,
                functor: (x,y)=>x.OnSuccess());

            enable = false;
        }
    }