void OnTriggerEnter2D(Collider2D other) { if (other.tag == "SniperBullet") { bulletScript = other.GetComponent <LineSniperShot>(); DamageJunk(bulletScript.lineSniperShotDamage); } else if (other.tag == "Missile") { homingMissileScript = other.GetComponent <EnemySeekerShot>(); DamageJunk(homingMissileScript.seekerDamage); } else if (other.tag == "Shot") { shotScript = other.GetComponent <ProtoShotPrefab>(); DamageJunk(shotScript.shotDamage); } else if (other.tag == "PhaseBlast") { phaseBlastScript = other.GetComponent <PhaseBlast>(); DamageJunk(phaseBlastScript.phaseBlastDamage); } else if (other.tag == "Plasma") { //damage this plasmaScript = other.GetComponent <Plasma>(); DamageJunk(plasmaScript.plasmaDamage); } else if (other.tag == "ShieldMine") { shieldMineScript = other.GetComponent <ShieldMine>(); DamageJunk(hitPoints); } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Boundary" || other.tag == "MineralPickup" || other.tag == "Capsule" || other.tag == "Edge" || other.tag == "BoostHit") { return; } else if (other.tag == "SniperBullet") { bulletScript = other.GetComponent <LineSniperShot>(); if (bulletScript.teamCount != teamCount) { //Damage the bug DamageThis(bulletScript.lineSniperShotDamage); } } else if (other.tag == "Shot") { shotScript = other.GetComponent <ProtoShotPrefab>(); if (shotScript.teamCount != teamCount) { //Damage this bug DamageThis(shotScript.shotDamage); } } else if (other.tag == "ShieldMine") { mineScript = other.GetComponent <ShieldMine>(); if (mineScript.teamCount != teamCount) { DestroyThis(); } } else if (other.tag == "Missile") { seekerShotScript = other.GetComponent <EnemySeekerShot>(); if (seekerShotScript.teamCount != teamCount) { //Damage DamageThis(seekerShotScript.seekerDamage); } } else if (other.tag == "PhaseBlast") { phaseBlastScript = other.GetComponent <PhaseBlast>(); if (phaseBlastScript.teamCount != teamCount) { DamageThis(phaseBlastScript.phaseBlastDamage); } } else if (other.tag == "Plasma") { plasmaScript = other.GetComponent <Plasma>(); if (plasmaScript.teamCount != teamCount) { DamageThis(plasmaScript.plasmaDamage); } } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "SniperBullet") { bulletScript = other.GetComponent <LineSniperShot>(); if (bulletScript.teamCount != teamCount) { //Damage BlowUp(); } } else if (other.tag == "Shot") { shotScript = other.GetComponent <ProtoShotPrefab>(); if (shotScript.teamCount != teamCount) { //Damage BlowUp(); } } else if (other.tag == "ShieldMine") { mineScript = other.GetComponent <ShieldMine>(); if (mineScript.teamCount != teamCount) { BlowUp(); } } else if (other.tag == "Missile") { seekerShotScript = other.GetComponent <EnemySeekerShot>(); if (seekerShotScript.teamCount != teamCount) { //Damage BlowUp(); } } else if (other.tag == "PhaseBlast") { phaseBlastScript = other.GetComponent <PhaseBlast>(); if (phaseBlastScript.teamCount != teamCount) { //Damage BlowUp(); } } else if (other.tag == "Plasma") { plasmaScript = other.GetComponent <Plasma>(); if (plasmaScript.teamCount != teamCount) { //Damage BlowUp(); } } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Boundary" || other.tag == "MineralPickup" || other.tag == "Capsule" || other.tag == "Edge" || other.tag == "BoostHit" || other.tag == "AutoTurret") { return; } else if (other.tag == "Player1(Black)" || other.tag == "Player2(White)" || other.tag == "Player3" || other.tag == "Player4") { enemyHealthScript = other.GetComponent <PlayerHealth>(); if (enemyHealthScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "PlayerPhysicsCollider") { enemyHealthScript = other.GetComponentInParent <PlayerHealth>(); if (enemyHealthScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "RocketAmmo") { rocketScript = other.GetComponent <RemoteLauncherShot>(); if (rocketScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "SniperBullet") { bulletScript = other.GetComponent <LineSniperShot>(); if (bulletScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "Shot") { shotScript = other.GetComponent <ProtoShotPrefab>(); if (shotScript.teamCount != teamCount) { rapidShotHitCount++; if (rapidShotHitCount > totalShotHit) { BlowUp(); DestroyThis(); } else { return; } } } else if (other.tag == "ShieldMine") { mineScript = other.GetComponent <ShieldMine>(); if (mineScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "Plasma") { /* * plasmaScript = other.GetComponent<Plasma>(); * if (plasmaScript.teamCount != teamCount) * { * plasmaHitCount++; * if (plasmaHitCount > totalPlasmaHit) * { * BlowUp(); * DestroyThis(); * } * else * { * return; * } * } */ } else if (other.tag == "PhaseBlast") { phaseBlastScript = other.GetComponent <PhaseBlast>(); if (phaseBlastScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "Grenade") { grenadeScript = other.GetComponent <Grenade>(); if (grenadeScript.teamCount != teamCount) { BlowUp(); DestroyThis(); } } else if (other.tag == "Asteroid") { BlowUp(); DestroyThis(); } else { BlowUp(); DestroyThis(); } /* * myShotScript.newRemoteLauncherCoolDown = myShotScript.newRemoteLauncherCoolDownTime; * myShotScript.rocketFired = false; */ }