示例#1
0
 /// <summary>
 /// Generates a single projectile and initializes it with a heading and speed
 /// </summary>
 /// <param name="projectileId">Index of object in projectileQueue</param>
 /// <param name="normalizedHeading">Direction in which the projectile will move</param>
 protected void SingleShot(int projectileId, Vector3 normalizedHeading, Vector3 mousePosition)
 {
     if (projectileQueue.Length > 0)
     {
         BaseProjectile outgoing = Instantiate(projectileQueue[projectileId], transform.position, transform.rotation).GetComponent <BaseProjectile>();
         outgoing.StraightShot(normalizedHeading, mousePosition);
     }
     else
     {
         print("No projectile set in projectileQueue");
     }
 }