Exemple #1
0
        /// <summary>
        /// Sets the rocket's attributes from RocketAttributes.
        /// </summary>
        private void SetAttributes()
        {
            behaviorFlags     = rocketAttributes.rockets[rocketType].behaviorFlags;
            damage            = rocketAttributes.rockets[rocketType].damage;
            speed             = rocketAttributes.rockets[rocketType].speed;
            homingSensitivity = rocketAttributes.rockets[rocketType].homingSensitivity;
            explodeTime       = rocketAttributes.rockets[rocketType].explodeTime;
            explosiveRadius   = rocketAttributes.rockets[rocketType].explosiveRadius;
            randomTime        = rocketAttributes.rockets[rocketType].randomTime;
            randomX           = rocketAttributes.rockets[rocketType].randomX;
            randomY           = rocketAttributes.rockets[rocketType].randomY;
            randomZ           = rocketAttributes.rockets[rocketType].randomZ;
            explosionClip     = rocketAttributes.rockets[rocketType].explosionClip;
            trailClip         = rocketAttributes.rockets[rocketType].trailClip;

            explosionEmitterId = rocketAttributes.RocketExplosionEmitterIds[rocketType];
            rocketEmitterId    = rocketAttributes.RocketEmitterIds[rocketType];
            trailEmitterId     = rocketAttributes.TrailEmitterIds[rocketType];

            if (rocketEmitterId >= 0)
            {
                rocketEmitter =
                    reference.objectPoolManager.Spawn(gameObject, rocketEmitterId,
                                                      transform.position, transform.rotation,
                                                      transform);
            }

            if (trailEmitterId >= 0)
            {
                trailEmitter =
                    reference.objectPoolManager.Spawn(gameObject, trailEmitterId,
                                                      transform.position, transform.rotation,
                                                      transform);
            }
        }
Exemple #2
0
 /// <summary>
 /// Resets the shipController reference and target for the rocket.
 /// </summary>
 protected override void Reset()
 {
     behaviorFlags        = 0;
     shipController       = null;
     target               = null;
     targetPoolableScript = null;
     targetEnemyScript    = null;
     damageMultiplier     = 1;
     rocketEmitter        = null;
     trailEmitter         = null;
 }