示例#1
0
    private void Start()
    {
        if (spawn)
        {
            if (horizontalShot)
            {
                ProjectileBase firstSpawn = Instantiate(m_projectile);
                firstSpawn.GetComponent <ThreeWayModifier>().spawn = false;
                firstSpawn.transform.position += new Vector3(-m_distanceApart, 0.0f, 0.0f).normalized;
                firstSpawn.GetComponent <Rigidbody>().velocity = rb.velocity;

                ProjectileBase secondSpawn = Instantiate(m_projectile);
                secondSpawn.GetComponent <ThreeWayModifier>().spawn = false;
                secondSpawn.transform.position += new Vector3(m_distanceApart, 0.0f, 0.0f).normalized;
                secondSpawn.GetComponent <Rigidbody>().velocity = rb.velocity;
            }
            else
            {
                ProjectileBase firstSpawn = Instantiate(m_projectile);
                firstSpawn.GetComponent <ThreeWayModifier>().spawn = false;
                firstSpawn.transform.position += new Vector3(0.0f, -m_distanceApart, 0.0f).normalized;
                firstSpawn.GetComponent <Rigidbody>().velocity = rb.velocity;

                ProjectileBase secondSpawn = Instantiate(m_projectile);
                secondSpawn.GetComponent <ThreeWayModifier>().spawn = false;
                secondSpawn.transform.position += new Vector3(0.0f, m_distanceApart, 0.0f).normalized;
                secondSpawn.GetComponent <Rigidbody>().velocity = rb.velocity;
            }
        }
    }
示例#2
0
 private void ClusterSpawn()
 {
     for (int i = 0; i < m_clusterCount; i++)
     {
         ProjectileBase newSpawn = Instantiate(m_projectile);
         newSpawn.GetComponent <ClusterModifier>().cluster = false;
         newSpawn.transform.position += new Vector3(Random.value, Random.value, Random.value).normalized;
         newSpawn.GetComponent <Rigidbody>().velocity = rb.velocity;
         newSpawn.rb.AddExplosionForce(m_explosionForce, newSpawn.transform.position, 1);
     }
 }
示例#3
0
 protected override void UpdateBulletStatus(ProjectileBase bullet)
 {
     base.UpdateBulletStatus(bullet);
     bullet.GetComponent <Pellet>().rotationOffset = rotationOffset;
 }