public void DisableDrone(Vector3 position) { GameObject electricParticle = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.ElectricParticleEffect); electricParticle.gameObject.SetActive(true); electricParticle.gameObject.transform.position = position; }
protected virtual void getExplosionParticleEffect() { //.getBasicFireExplosionParticle(); GameObject explosion = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.FireEXplosionParticle); explosion.SetActive(true); explosion.transform.position = this.transform.position; }
public override void destroyCharacter() { m_ragdoll.EnableRagdoll(); m_ragdollEnabled = true; GameObject explosion = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.ElectricParticleEffect); explosion.SetActive(true); explosion.transform.position = m_headTransform.position; }
public void ExplosionEffect(Vector3 position) { //.getBasicDroneExplosion() BasicExplosion droneExplosion = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.DroneExplosion).GetComponent <BasicExplosion>(); droneExplosion.gameObject.SetActive(true); droneExplosion.gameObject.transform.position = position; droneExplosion.GetComponent <BasicExplosion>().exploade(); }
private void hitOnWall(Collider wall) { speed = 0; GameObject basicHitParticle = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.HitBasicParticle); basicHitParticle.SetActive(true); basicHitParticle.transform.position = this.transform.position; basicHitParticle.transform.LookAt(Vector3.up); this.gameObject.SetActive(false); }
public virtual void reloadWeapon() { setReloading(true); GameObject obj = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.RifleAmmo); obj.transform.position = this.transform.position + magazinePositionOffset; obj.transform.parent = null; obj.SetActive(true); obj.transform.rotation = Quaternion.Euler(Random.insideUnitSphere * 90); magazineObjProp.SetActive(false); }
public void emitSmoke() { GameObject explosion = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.ElectricParticleEffect); explosion.SetActive(true); explosion.transform.position = m_headTransform.position; GameObject smoke = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.SmokeEffect); if (smoke != null) { smoke.SetActive(true); smoke.transform.position = m_headTransform.position; } }
private void hitOnEnemy(Collider other) { AgentController agentController = other.transform.GetComponentInParent <AgentController>(); if (agentController != null && !m_hit) { ICyberAgent cyberAgent = agentController.getICyberAgent(); if (cyberAgent != null && !m_fireFrom.Equals(cyberAgent.getFaction())) { m_hit = true; cyberAgent.reactOnHit(other, (this.transform.forward) * 3f, other.transform.position); cyberAgent.damageAgent(1); speed = 0; this.gameObject.SetActive(false); GameObject basicHitParticle = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.HitBasicParticle); basicHitParticle.SetActive(true); basicHitParticle.transform.position = this.transform.position; basicHitParticle.transform.LookAt(Vector3.up); if (!cyberAgent.IsFunctional()) { MovingAgent movingAgent = cyberAgent as MovingAgent; if (movingAgent != null) { Rigidbody rb = other.transform.GetComponent <Rigidbody>(); if (rb != null) { rb.isKinematic = false; rb.AddForce((this.transform.forward) * 150, ForceMode.Impulse); } Rigidbody hitRb = movingAgent.getChestTransfrom().GetComponent <Rigidbody>(); if (hitRb) { hitRb.AddForce((this.transform.forward) * 2 + Random.insideUnitSphere * 2, ForceMode.Impulse); } } } } } }
public void weaponFireForAI() { //.getBasicProjectie(); GameObject Tempprojectile = ProjectilePool.getInstance().getPoolObject(ProjectilePool.POOL_OBJECT_TYPE.BasicProjectile); Tempprojectile.transform.position = m_droneRigitBody.transform.position; Tempprojectile.transform.rotation = m_droneRigitBody.transform.rotation; Tempprojectile.SetActive(true); Tempprojectile.transform.localScale = new Vector3(0.05f, 0.05f, 0.05f); Tempprojectile.transform.forward = (m_target.transform.position - this.transform.position).normalized; ProjectileBasic tempProjectile = Tempprojectile.GetComponent <ProjectileBasic>(); tempProjectile.speed = 1f; tempProjectile.setFiredFrom(m_faction); tempProjectile.resetToMicroBeam(); m_audioSource.Play(); }