Beispiel #1
0
        void OnCollisionEnter(Collision collision)
        {
            pon = collision.gameObject.GetComponent<IAPon>();

            if(pon != null)
                pon.Damage(damage);
        }
Beispiel #2
0
        void OnCollisionEnter(Collision collision)
        {
            pon = collision.gameObject.GetComponent <IAPon>();

            if (pon != null)
            {
                pon.Damage(damage);
            }
        }
Beispiel #3
0
        void OnCollisionEnter(Collision collision)
        {
            IAPon pon = collision.gameObject.GetComponent <IAPon>();

            if (pon != null)
            {
                Damage(pon.GetDamage());
                Destroy(pon.gameObject);
            }
        }
Beispiel #4
0
        void OnCollisionEnter(Collision collision)
        {
            pon = collision.gameObject.GetComponent<IAPon>();

            if(pon != null)
                pon.Damage(damage);
            if(type == "minigun")
                Destroy(gameObject);

            if(type == "plasma")
            {
                FX = Instantiate(Resources.Load("Prefab/PlasmaFX")) as GameObject;
                FX.transform.position = transform.position;
                FX.transform.parent = GameObject.FindGameObjectWithTag("GameController").transform;
                Destroy(FX, 0.25f);
                Destroy(gameObject);
            }
        }
Beispiel #5
0
        public void genereTower(int i)
        {
            foreach (GameObject po in Niveau.pons)
            {
                UnityEngine.Object.Destroy(po);
            }
            Tower tow = this.indiv [i].transform.GetChild(0).GetComponent <Tower> ();

            this.indiv[i].transform.GetChild(0).tag = "Tower";
            this.indiv[i].transform.GetChild(0).GetComponent <MeshRenderer> ().enabled            = true;
            this.indiv[i].transform.GetChild(0).gameObject.GetComponent <MeshCollider> ().enabled = true;
            tow.enabled = true;

            Niveau.generate = true;
            tow.generation();
            GameObject.Find("GameController").GetComponent <Timer>().time = 0;
            IAPon.Initialize();
        }
Beispiel #6
0
        void OnCollisionEnter(Collision collision)
        {
            pon = collision.gameObject.GetComponent <IAPon>();

            if (pon != null)
            {
                pon.Damage(damage);
            }
            if (type == "minigun")
            {
                Destroy(gameObject);
            }

            if (type == "plasma")
            {
                FX = Instantiate(Resources.Load("Prefab/PlasmaFX")) as GameObject;
                FX.transform.position = transform.position;
                FX.transform.parent   = GameObject.FindGameObjectWithTag("GameController").transform;
                Destroy(FX, 0.25f);
                Destroy(gameObject);
            }
        }