Esempio n. 1
0
        /// <summary>
        /// Verifies that the selected projectile is properly configured
        /// to be used in engine as a projectile
        /// </summary>
        /// <returns>true if the specified projectile prefab has been loaded by the GameManager</returns>
        private bool VerifyProjectile()
        {
            if (Manager.ResourceCacheContains(ProjectileAssetName)) // the specified projectile prefab has already been loaded by the game manager
            {
                _Projectile = Manager.GetResourceCacheItemByName(ProjectileAssetName) as Projectile;

                if (_Projectile == null)
                {
                    Debug.LogError("Unable to acquire reference to projectile prefab from GameManager");
                    return(false);
                }
                return(true);
            }
            return(false); // for now. later we might want to trigger the GameManager to load this asset, possible asyncronously.
        }