Пример #1
0
    void SpawnBullet()
    {
        time = 0;
        BaseBullet b = Instantiate <BaseBullet>(bullet);

        //if (FoxController.instance.facingRight)
        b.Init(transform.position, transform.rotation.eulerAngles.z, FoxController.Instance.facingRight);
        //else
        //{
        //    Debug.Log(transform.rotation.eulerAngles.z);
        //    b.Init(transform.position, transform.rotation.eulerAngles.z, FoxController.instance.facingRight);
        //}
    }
Пример #2
0
 void InstanceNewBullet()
 {
     for (int i = 0; i < m_CreateCount; i++)
     {
         if (m_CurFireCount < m_FireCount)
         {
             float      newAngle = m_FireDtAngle * m_CurFireCount;
             BaseBullet bullet   = GetBullet();
             bullet.SetLockEnemyObj(m_LockEnemyObj);
             bullet.Init(m_Damage, FirePoint, m_Offset, newAngle);
             m_CurFireCount++;
         }
     }
 }
Пример #3
0
        protected override void Fire()
        {
            Global.gApp.gShakeCompt.StartShake(0, 0.1f, 0.03f);
            base.Fire();
            m_DogPet.PlayFireAnim();
            m_FireEffect1.Play();
            BaseBullet bullet1 = GetBullet();

            bullet1.SetLockEnemyObj(m_LockEnemyObj);
            bullet1.Init(m_Damage, FirePoint1, 0, 0);

            m_FireEffect2.Play();
            BaseBullet bullet2 = GetBullet();

            bullet2.SetLockEnemyObj(m_LockEnemyObj);
            bullet2.Init(m_Damage, FirePoint2, 0, 0);
            //Shining.VibrationSystem.Vibrations.instance.Vibrate1ms();
        }
Пример #4
0
        protected void InstanceNormalBullet(bool synScaleToEffect = false, bool x2Z = false)
        {
            int    bulletCount  = GetBulletCount();
            int    bulletCurves = GetBulletCurves();
            float  dtAngleZ     = -m_DtAngle * (bulletCurves - 1) / 2;;
            int    mIndex       = 0;
            double damage       = GetDamage();

            for (int index = 0; index < bulletCurves; index = index + 1)
            {
                float Offset = -m_Offset * (bulletCount - 1) / 2;;
                for (int pIndex = 0; pIndex < bulletCount; pIndex = pIndex + 1)
                {
                    BaseBullet bullet = GetBullet();
                    bullet.SetLockEnemyObj(m_LockEnemyObj);
                    bullet.Init(damage, FirePoint, dtAngleZ, Offset);
                    Offset = Offset + m_Offset;
                    if (synScaleToEffect && m_FireBullets[mIndex] != null)
                    {
                        if (!x2Z)
                        {
                            m_FireBullets[mIndex].transform.localScale = bullet.transform.localScale * m_Scale;
                        }
                        else
                        {
                            Vector3 localScale = bullet.transform.localScale;
                            float   x          = localScale.x;
                            localScale.x = localScale.z;
                            localScale.z = x;
                            m_FireBullets[mIndex].transform.localScale = localScale * m_Scale;
                        }
                    }
                    mIndex++;
                }
                dtAngleZ = dtAngleZ + m_DtAngle;
            }
        }