void FixedUpdate() { if (ShootFlag) { ShootPoint.LookAt(RandomShooterFunc(RandTarget)); //MakeBullet(); NewMakeBullet(0, ShootPoint.position, ShootPoint.rotation); RemainingBullet--; UpDateUIFunc(); ShootPoint.LookAt(GunTarget.transform); ShootFlag = false; if (AnimCtrl[0]) { AnimCtrl[0].SetTrigger("Shoot"); } } if (ShootFlag2) { EX_SP_ShootFunc(); //MakeBullet(SPBullet, SPShootPoint); NewMakeBullet(1, SPShootPoint.position, SPShootPoint.rotation); UpDateUIFunc(); _parameter.SPECIAL--; //ShootPoint.LookAt(GunTarget.transform); ShootFlag2 = false; } }
//public int health; protected override void Start() { base.Start(); this.health = 1300; ani = GetComponent <Animator> (); sp = GetComponentInChildren <ShootPoint> (); pl = new ParticleSystem.Particle[500]; }
// Use this for initialization protected virtual void Start() { Debug.LogError("Starting"); DontDestroyOnLoad(gameObject); mana = maxmana; uic = FindObjectOfType <UIController> (); health = maxhealth; anim = GetComponent <Animator> (); shootpoint = GetComponentInChildren <ShootPoint> (); portal = GetComponentInChildren <Portal> (); particles = GetComponentInChildren <PotionParticles> (); baseSpeed = speedMulti; baseDamage = damageMulti; uic.DisplayHearts(this.health, this.maxhealth); pl = new ParticleSystem.Particle[200]; source = GetComponent <AudioSource> (); source.volume = SoundManager.instance.GetSFXVolume(); }
public void FireMissile(GameObject missile) { if (OnShoot != null) OnShoot(_shootPointIndex); _shootPoint = _shootPoints[_shootPointIndex]; var direction = _aimAt - _shootPoint.transform.position; if (!MissilesConverge) direction += _shootPoint.transform.position - GetShootPointCentre(); missile.GetComponent<Missile>().FromReference = _shootPoint.transform; missile.GetComponent<Missile>().Shoot(_shootPoint.transform.position, Quaternion.Euler(Random.Range(-0.5f * Spread, 0.5f * Spread), Random.Range(-0.5f * Spread, 0.5f * Spread), 0f) * direction, _velocityReference.Value); _shootPoint.Flash(); var fireSound = ResourcePoolManager.GetAvailable(SoundPrefab, _shootPoint.transform.position, Quaternion.identity).GetComponent<AnonymousSound>(); fireSound.PlayAt(ShootSound, _shootPoint.transform.position, SoundVolume); //FireSound.Play(); if (IsOverheat) { heatValue += HeatPerMissile; isCoolingDown = false; if (heatValue >= OverheatValue) { heatCooldown = OverheatDelay; } else { coolDelayCooldown = CoolDelay; } } _shootPointIndex++; if (_shootPointIndex >= _shootPoints.Count) _shootPointIndex = 0; }