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);
        }
Exemple #2
0
 public Projectile(IProjectileConfiguration config)
 {
     //set the parts in the projectile
     SetPartSelections(config);
 }
Exemple #3
0
 public void Copy(IProjectileConfiguration configToCopy)
 {
     this.Parts = configToCopy.Parts;
 }
Exemple #4
0
 void SetPartSelections(IProjectileConfiguration config)
 {
     this.m_partSelections = config;
 }