示例#1
0
        private void Start()
        {
            EnemyPool enemyPool = new EnemyPool(5);
            var       enemy     = enemyPool.GetEnemy("Asteroid");

            enemy.transform.position = new Vector3(1, 7, 0);
            enemy.gameObject.SetActive(true);
        }
示例#2
0
        private void Start()
        {
            EnemyPool enemyPool     = new EnemyPool(5);
            var       enemyAsteroid = enemyPool.GetEnemy("Asteroid");

            enemyAsteroid.transform.position = new Vector3(0, 0, 10);
            enemyAsteroid.gameObject.SetActive(true);
            Enemy.CreateEnemyCylinder(new Health(100.0f, 100.0f));
        }
示例#3
0
        private void ExamplePool()
        {
            EnemyPool enemyPool = new EnemyPool(5);
            var       enemy     = enemyPool.GetEnemy("Asteroid");

            enemy.transform.position = Vector3.one;
            enemy.gameObject.SetActive(true);

            System.Threading.ThreadPool.QueueUserWorkItem(state => Debug.Log("Test"));
        }
        private void Start()
        {
            EnemyPool enemyPool = new EnemyPool(5);
            var       enemy     = enemyPool.GetEnemy("Asteroid");

            enemy.transform.position = Vector3.one;
            enemy.gameObject.SetActive(true);
            return;

            Enemy.CreateAsteroidEnemy(new Health(100.0f, 100.0f));

            IEnemyFactory factory = new AsteroidFactory();

            factory.Create(new Health(100.0f, 100.0f));

            Enemy.Factory.Create(new Health(100.0f, 100.0f));


            var platform = new PlatformFactory().Create(Application.platform);

            System.Threading.ThreadPool.QueueUserWorkItem(state => Debug.Log("Test"));
        }