Beispiel #1
0
        public MonsterBulletCharacter FactoryMethod()
        {
            MonsterBulletCharacter monsterBulletCharacter = Instantiate
                                                                (monsterBulletTemplate, firePoint.position, Quaternion.identity);

            monsterBulletCharacter.isMove  = false;
            monsterBulletCharacter.enabled = false;
            monsterBulletCharacter.gameObject.SetActive(false);
            return(monsterBulletCharacter);
        }
Beispiel #2
0
//        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);
        }
Beispiel #3
0
 public void ResetMethod(MonsterBulletCharacter monsterBulletCharacter)
 {
     monsterBulletCharacter.isMove  = false;
     monsterBulletCharacter.enabled = false;
     monsterBulletCharacter.gameObject.SetActive(false);
 }
Beispiel #4
0
 public void RecycleBullet(MonsterBulletCharacter monsterBulletCharacter)
 {
     _bulletPool.Recycle(monsterBulletCharacter);
 }