예제 #1
0
 // Use this for initialization
 void Start()
 {
     //オブジェクトプール
     pool_Manager = ObjectPoolManager.Instance;
     pool_Manager.Create_New_Pool(scales_Bullet, 10);
     pool_Manager.Create_New_Pool(green_Rice_Bullet, 40);
     pool_Manager.Create_New_Pool(red_Bullet, 2);
     //取得
     player      = GameObject.FindWithTag("PlayerTag");
     _shoot      = GetComponent <ShootFunction>();
     _bullet_Acc = GetComponent <BulletAccelerator>();
 }
예제 #2
0
    private IEnumerator Shoot_Cor()
    {
        ShootFunction _shoot = GetComponent <ShootFunction>();
        ObjectPool    pool   = ObjectPoolManager.Instance.Get_Pool(bullet);

        _shoot.Set_Bullet_Pool(pool, null);
        while (true)
        {
            yield return(new WaitForSeconds(1.5f));

            if (GetComponent <Renderer>().isVisible)
            {
                UsualSoundManager.Instance.Play_Shoot_Sound();
                _shoot.Diffusion_Bullet(8, 60f, 0, 10f);
                _shoot.Diffusion_Bullet(8, 55f, 4f, 10f);
                _shoot.Diffusion_Bullet(8, 55f, -4f, 10f);
            }

            yield return(new WaitForSeconds(2.7f));
        }
    }
예제 #3
0
        //private void GameStarted()
        //{
        //    this.EquipWeaponDirect(WeaponDatabase.instance.GenerateWeapon());
        //}

        public void EquipWeaponByName(string name)
        {
            currentWeapon = WeaponDatabase.instance.GetWeaponByName(name);
            WeaponStruct.Type wepType = currentWeapon.wepType;

            switch (wepType)
            {
            case WeaponStruct.Type.Pistol:
                shootFunction = new ShootFunction(StandardGun);
                break;

            case WeaponStruct.Type.Rifle:
                shootFunction = new ShootFunction(Rifle);
                break;

            case WeaponStruct.Type.ShotGun:
                shootFunction = new ShootFunction(ShotGun);
                break;

            case WeaponStruct.Type.MachineGun:
                shootFunction = new ShootFunction(MachineGun);
                break;
            }
        }
예제 #4
0
        public void EquipWeaponDirect(WeaponStruct wep)
        {
            currentWeapon = wep;
            WeaponStruct.Type wepType = currentWeapon.wepType;

            if (wepType != WeaponStruct.Type.Pistol)
            {
                if (wepType != WeaponStruct.Type.ShotGun)
                {
                    if (wepType == WeaponStruct.Type.Rifle)
                    {
                        shootFunction = new ShootFunction(Rifle);
                    }
                }
                else
                {
                    shootFunction = new ShootFunction(ShotGun);
                }
            }
            else
            {
                shootFunction = new ShootFunction(MachineGun);
            }
        }
 private void Awake()
 {
     //取得
     _gravitate_Player = GetComponent <GravitatePlayer>();
     _shoot            = GetComponent <ShootFunction>();
 }