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

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

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

            if (pon != null)
            {
                Damage(pon.GetDamage());
                Destroy(pon.gameObject);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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();
        }
Esempio n. 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);
            }
        }