void load_hint_arrows() { this.enabled_hint_arrows = new List <GameObject>(); GameObject arrow = Resources.Load("hint") as GameObject; this.hint_arrows = new CGameObjectPool <GameObject>(10, arrow, (GameObject original) => { GameObject clone = GameObject.Instantiate(original) as GameObject; clone.SetActive(false); return(clone); }); }
// Use this for initialization void Start() { int number = 0; this.monster_pool = new CGameObjectPool <GameObject>(5, () => { ++number; GameObject obj = new GameObject("monster" + number); return(obj); }); this.monsters = new List <GameObject>(); this.remove_list = new List <GameObject>(); }
void Awake() { this.donuts_small_pool = new CGameObjectPool <GameObject>(3, this.donuts_small_ef_prefab, (GameObject original) => { GameObject obj = GameObject.Instantiate(original) as GameObject; obj.SetActive(false); return(obj); }); this.donuts_big_pool = new CGameObjectPool <GameObject>(3, this.donuts_big_ef_prefab, (GameObject original) => { GameObject obj = GameObject.Instantiate(original) as GameObject; obj.SetActive(false); return(obj); }); }
void Awake() { this.live_objects = new List <GameObject>(); this.enemy_pools = new List <CGameObjectPool <GameObject> >(); for (int i = 0; i < this.prefab_enemies.Length; ++i) { CGameObjectPool <GameObject> pool = new CGameObjectPool <GameObject>(10, this.prefab_enemies[i], (GameObject original) => { GameObject inst = GameObject.Instantiate(original); inst.transform.parent = transform; inst.SetActive(false); return(inst); }); this.enemy_pools.Add(pool); } }
void Awake() { GameObject original = Resources.Load <GameObject>("character/enemy_ui"); this.pool_enemy = new CGameObjectPool <GameObject>(5, original, (GameObject obj) => { GameObject clone = GameObject.Instantiate(obj); clone.SetActive(false); return(clone); }); this.live_objects = new List <GameObject>(); this.skill_manager = gameObject.AddComponent <CSkillManager>(); this.success_targets = new Queue <GameObject>(); this.x_positions = new List <float>(); this.x_positions.Add(-180.0f); this.x_positions.Add(-60.0f); this.x_positions.Add(60.0f); this.x_positions.Add(180.0f); }
public void load_all() { GameObject original = Resources.Load <GameObject>("effects/ef_fly"); this.pool_fly = new CGameObjectPool <GameObject>(4, original, (GameObject obj) => { GameObject clone = GameObject.Instantiate(obj); clone.SetActive(false); return(clone); }); original = Resources.Load <GameObject>("effects/ef_destroy"); this.pool_destroy = new CGameObjectPool <GameObject>(3, original, (GameObject obj) => { GameObject clone = GameObject.Instantiate(obj); clone.SetActive(false); return(clone); }); this.ef_heart = GameObject.Instantiate(Resources.Load <GameObject>("effects/ef_heart")) as GameObject; this.ef_heart.SetActive(false); }