Esempio n. 1
0
        public ObjectPool(string[] _fileNames)
        {
            typeList = GenericClassCreator.GetAllTypesFromFileNames(_fileNames);


            foreach (string s in _fileNames)
            {
                System.Type t;
                typeList.TryGetValue(s, out t);

                if (t != null)
                {
                    keys.Add(s);
                    //values.Add(t);
                }
            }
        }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        textureList = new Dictionary <string, Texture>();
        //BulletFactory.Instance.ToString();
        //textureList = BulletFactory.Instance.typeList;
        op = new ObjectPool(GenericClassCreator.GetAllFileNamesInFolder(Application.dataPath + "/Resources/Textures", "png"));


        // BulletFactory.Instance.SpawnObject("Bullet_9mm.prefab");
        //BulletFactory.Instance.SpawnObject("Bullet_9mm");

        BulletFactory.Instance.ToString();

        foreach (KeyValuePair <string, System.Type> kv in op.typeList)
        {
            BulletFactory.Instance.SpawnObject(kv.Key);
        }
        // BulletFactory.Instance.SpawnObject("Bullet_9mm");
        // BulletFactory.Instance.SpawnObject("Bullet_9mm");
        // BulletFactory.Instance.SpawnObject("Bullet_9mm");
        // BulletFactory.Instance.SpawnObject("Bullet_9mm");
        // BulletFactory.Instance.SpawnObject("Bullet_9mm.prefab");
    }
Esempio n. 3
0
 private BulletFactory()
 {
     tlist = GenericClassCreator.GetAllTypesFromFileLocation(Application.dataPath + "/Resources/Textures");
 }