public MonsterBulletCharacter FactoryMethod() { MonsterBulletCharacter monsterBulletCharacter = Instantiate (monsterBulletTemplate, firePoint.position, Quaternion.identity); monsterBulletCharacter.isMove = false; monsterBulletCharacter.enabled = false; monsterBulletCharacter.gameObject.SetActive(false); return(monsterBulletCharacter); }
// public MonsterBulletCharacter CreatBullet(Vector3 dir,Vector3 creatPoint) // { // MonsterBulletCharacter monsterBulletCharacter = Instantiate(monsterBulletTemplate, creatPoint, Quaternion.identity); // monsterBulletCharacter.gameObject.SetActive(true); // monsterBulletCharacter.dir = dir; // tempBullets.Add(monsterBulletCharacter); // return monsterBulletCharacter; // } public MonsterBulletCharacter AllocateBullet(Vector3 dir, Vector3 creatPoint) { MonsterBulletCharacter temp = _bulletPool.Allocate(); temp.transform.position = creatPoint; temp.gameObject.SetActive(true); temp.enabled = true; temp.isMove = true; temp.speed = bulletSpeed; temp.FireMode = this; temp.dir = dir; return(temp); }
public void ResetMethod(MonsterBulletCharacter monsterBulletCharacter) { monsterBulletCharacter.isMove = false; monsterBulletCharacter.enabled = false; monsterBulletCharacter.gameObject.SetActive(false); }
public void RecycleBullet(MonsterBulletCharacter monsterBulletCharacter) { _bulletPool.Recycle(monsterBulletCharacter); }