public Projectile GetProjectile(Ballistics.IProjectileConfiguration configuration) { Projectile projectile = null; Debug.Log("Creating a projectile from inventory resources for " + configuration); //TRY and get the selected selections from the inventory, and instantiate a projectile IProjectileConfiguration selections = this.GetSelections(configuration); projectile = new Projectile(selections); if (projectile == null || !projectile.CanLaunch()) { Debug.LogWarning("Putting back projectile parts for " + configuration + " due to the projectile not spawning correctly."); foreach (PartSelectionBehavior nextSelection in selections.Parts) { //place each of the selections back in the inventory, as we cannot use them after all this.Insert(nextSelection); } } else { //WE SHOULD SETUP THE COLLISION IGNORANCE HERE //projectile.ignoreCollisionsWith(this.collider); } return(projectile); }
public Projectile(IProjectileConfiguration config) { //set the parts in the projectile SetPartSelections(config); }
public void Copy(IProjectileConfiguration configToCopy) { this.Parts = configToCopy.Parts; }
void SetPartSelections(IProjectileConfiguration config) { this.m_partSelections = config; }