PoolChild AddChild() { GameObject child = Instantiate(childPrefab, transform); PoolChild poolChild = child.GetComponent <PoolChild> (); children.Add(poolChild); return(poolChild); }
// ObjectPool objectPool; void Awake() { child = GetComponent <PoolChild>(); //tag = diceStatus.diceName; sprite = GetComponent <SpriteRenderer>(); name = nameof(Dice); eyes = new List <DiceEye>(); }
void Awake() { child = GetComponent <PoolChild>(); text = GetComponent <TextMeshPro>(); text.text = ""; alpha = text.color; }
void Start() { master = GameObject.Find(BoardType.UserBoard.ToString()).GetComponent <GameMaster>(); child = GetComponent <PoolChild>(); if (!damageIndcatorsKey.Equals("")) { damageIndecator = ObjectPoolManager.GetInstance().Get(damageIndcatorsKey); } }
public void TurnChild(PoolChild child) { child.gameObject.SetActive(false); child.transform.SetParent(objectPools.transform); if (!deActiveObjects.Contains(child.gameObject)) { deActiveObjects.Enqueue(child.gameObject); activeObjects.Remove(child.gameObject); } }
/// <summary> /// 적 스텟 범위 /// </summary> public void Start() { child = GetComponent <PoolChild>(); destinations = new Queue <Vector3>(); destinations.Enqueue(board.SecondVertex()); destinations.Enqueue(board.ThirdVertex()); destinations.Enqueue(board.FourthVertex()); StageManager.GetInstance().Join(this); enemyHp = new Vector2(60, 200); enemySpeed = new Vector2(3f, 5f); enemyCache = EnemyCache.GetInstance(); StartCoroutine(SpwanMonster()); }
private void Instantiates() { // 풀링 개수만큼 생성 for (int i = 0; i < max; i++) { GameObject obj = Instantiate(prefab.gameObject, objectPools.transform); PoolChild poolChild = obj.GetComponent <PoolChild>(); poolChild.SetObjectPool(this); obj.name = prefab.name + i.ToString("00"); obj.SetActive(false); deActiveObjects.Enqueue(obj); } }
public void Start() { poolChild = GetComponent <PoolChild>(); }