Beispiel #1
0
 void setNewProj(BulletAbstract thisBullet)
 {
     thisBullet.MoveSpeed     = SpeedBullet;
     thisBullet.BulletDamage  = Damage;
     thisBullet.BulletRange   = Range;
     thisBullet.Through       = Through;
     thisBullet.WidthRange    = WidthRange;
     thisBullet.SpeedZone     = SpeedZone;
     thisBullet.TimeStay      = TimeDest;
     thisBullet.Projectil     = Projectile;
     thisBullet.canExplose    = Explosion;
     thisBullet.Diameter      = Diameter;
     thisBullet.FarEffect     = FarEffect;
     thisBullet.TimeFarEffect = TimeFarEffect;
 }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == Constants._PlayerBullet && myEtatAgent == AgentEtat.aliveAgent)
        {
            BulletAbstract getBA = other.GetComponent <BulletAbstract>();

            /*if ( !getBA.Through  )
             * {
             *  Destroy(other.gameObject);
             * }*/

            lifeAgent -= getBA.BulletDamage;

            if (lifeAgent <= 0)
            {
                myEtatAgent = AgentEtat.deadAgent;
                transform.GetComponent <Renderer>().material = deadMaterial;
                DeadFonction();
                StartCoroutine(WaitRespawn());
            }
        }
    }