void SetSpawnedPooledObject(PooledObject entity)
    {
        if (entity)
        {
            AnimatedProjectile pulledEntity = entity.GetComponent <AnimatedProjectile>();
            pulledEntity.transform.position = transform.position;
            pulledEntity.transform.rotation = transform.rotation;
            pulledEntity.Reset(transform);

            if (alternatingFire)
            {
                pulledEntity.Alternate(currentAltFireState);

                if (currentAltFireState)
                {
                    currentAltFireState = false;
                }
                else
                {
                    currentAltFireState = true;
                }
            }
        }
        else
        {
            Debug.Log("no projectile??");
        }
    }
    /// <summary>
    /// Create special as an animating game object
    /// </summary>
    /// <param name="user">The entity casting the SetSpecial</param>
    /// <param name="target">The target of the SetSpecial</param>
    public void StartAnimation(Entity user, Entity target, bool hit)
    {
        //Create multiple projectiles for multiple targets
        if (hitAll)
        {
            List <Entity> party = target.GetParty().GetParty();
            bool          first = true;

            foreach (Entity e in party)
            {
                AnimatedProjectile p = Instantiate(projectile, user.transform.position, Quaternion.identity);

                p.StartAnimation(this, user, e, animationTime, hit);
                if (!first)
                {
                    p.duplicate = true;         //Prevent effect from being added multiple times per target
                }
                first = false;
            }
        }

        else
        {
            AnimatedProjectile p = Instantiate(projectile, user.transform.position, Quaternion.identity);
            p.StartAnimation(this, user, target, animationTime, hit);
        }
    }
Example #3
0
    /// <summary>
    /// Create special as an animating game object
    /// </summary>
    /// <param name="user">The entity casting the SetSpecial</param>
    /// <param name="target">The target of the SetSpecial</param>
    public void StartAnimation(Entity user, Entity target, bool hit)
    {
        AnimatedProjectile p = Instantiate(projectile, user.transform.position, Quaternion.identity);

        p.StartAnimation(this, user, target, animationTime, hit);
    }
	protected static void SetAnimatedProjectileSettings(AnimatedProjectile projectile, XmlNode node)
	{
		SetProjectileSettings(projectile as ProjectileEntity, node);	
	}