private void OnRightMouseButtonPressed() { if (gameMap.HoveredTile != null && !wallManager.RemoveWall(gameMap.HoveredTile) && !defenceManager.RemoveDefence(gameMap.HoveredTile)) { trapManager.RemoveTrap(gameMap.HoveredTile); } }
private void OnTriggerEnter(Collider other) { Snooper trapedSnooper = other.GetComponent <Snooper>(); if (trapedSnooper == null) { return; } if (trapedSnooper.isJumping) { return; } m_audioSource.PlayOneShot(m_triggerSound); m_particuleOnTrigger.gameObject.SetActive(true); m_particuleOnTrigger.Play(); if (NetworkServer.active) { TrapManager.RemoveTrap(this); if (trapedSnooper.isHuman) { Team.humanTeam.IncreaseTrapsTakenCount(); } else { Team.robotTeam.IncreaseTrapsTakenCount(); } } if (!trapedSnooper.hasAuthority) { return; } OnTrapTriggered(other, trapedSnooper); }