void ShootBullet() { //Shoot two bullets if (!altFire) { SmartBullet b = GetBullet(); b.transform.rotation = transform.rotation; b.transform.position = gunA.position; b.gameObject.SetActive(true); b = GetBullet(); b.transform.rotation = transform.rotation; b.transform.position = gunB.position; b.gameObject.SetActive(true); } else { SmartBullet b = GetBullet(); b.transform.rotation = transform.rotation; b.transform.position = gunC.position; b.gameObject.SetActive(true); b = GetBullet(); b.transform.rotation = transform.rotation; b.transform.position = gunD.position; b.gameObject.SetActive(true); } }
protected void Fire(GameObject target) { shellEject.Emit(1); GameObject bulletClone = Instantiate(bullet, transform.position, transform.rotation); SmartBullet bulletCloneScript = bulletClone.GetComponent <SmartBullet>(); bulletCloneScript.damage = damage; bulletCloneScript.penetrate = penetrate; bulletCloneScript.Target = target; }
protected void ApplyBulletProperties(GameObject bullet) { SmartBullet theBullet = bullet.GetComponent <SmartBullet>(); theBullet.SetAnchored(anchoredToBoss); theBullet.SetForwardSpeed(forwardSpeed); theBullet.SetRightSpeed(rightSpeed); theBullet.SetUpSpeed(upSpeed); theBullet.SetAccelDelay(accelDelay); theBullet.SetBulletAccel(accel); theBullet.SetScaleAmount(new Vector3(scaleAmount, scaleAmount, scaleAmount)); theBullet.SetScaleDuration(scaleDuration); theBullet.SetRotationDuration(rotationTime); theBullet.SetRotationAmountX(rotationAmountX); theBullet.SetRotationAmountY(rotationAmountY); theBullet.SetRotationAmountZ(rotationAmountZ); theBullet.SetLifeTime(lifeTime); }