private IEnumerator StartDisappearAfter(float fTime) { SkillAttackPool poolObject = null; yield return(new WaitForSeconds(fTime)); poolObject = StageController.m_thisInstance.GetSkillPool((int)PlayerAttack.E_SKILL_TYPE.E_SKILL_02 - 1); poolObject.ReleaseObject(gameObject); }
private void Awake() { m_thisInstance = this; m_arrSkillPool = new SkillAttackPool[(int)PlayerAttack.E_SKILL_TYPE.E_MAX]; SlimePool.Create("Prefab/Slime", "SlimePool", 50); DamageTextPool.Create("Prefab/DamageText", "DamageTextPool", 50); m_arrSkillPool[0] = SkillAttackPool.Create("Prefab/SkillAttack1", "SkillAttack1Pool", 50); m_arrSkillPool[1] = SkillAttackPool.Create("Prefab/SkillAttack2", "SkillAttack2Pool", 50); m_arrSkillPool[0].gameObject.layer = 2; m_arrSkillPool[1].gameObject.layer = 1; }
private void DamageEffect(PlayerAttack.E_SKILL_TYPE eType) { if (eType == PlayerAttack.E_SKILL_TYPE.E_SKILL_NONE) { return; } GameObject objEffect = null; SkillAttackPool poolObject = null; poolObject = StageController.m_thisInstance.GetSkillPool((int)eType - 1); objEffect = poolObject.EnableObject(); objEffect.transform.position = transform.position + new Vector3(0.0f, 0.5f, -0.5f); }
public static SkillAttackPool Create ( string strPrefabName, // "해당 'Pool'에서 관리 할 프리팹의 이름" string strObjectName, // "'PoolObject'의 이름" int nPoolItemMaxCount // "'Pool'에서 관리 할 오브젝트의 최고 개수" ) { GameObject objContainer = null; SkillAttackPool refResult = null; objContainer = new GameObject(); refResult = objContainer.AddComponent(typeof(SkillAttackPool)) as SkillAttackPool; refResult.m_strPrefabName = strPrefabName; refResult.m_nObjectMaxCount = nPoolItemMaxCount; refResult.gameObject.name = strObjectName; refResult.PreloadObject(); return(refResult); }