コード例 #1
0
 private void OnRightMouseButtonPressed()
 {
     if (gameMap.HoveredTile != null &&
         !wallManager.RemoveWall(gameMap.HoveredTile) &&
         !defenceManager.RemoveDefence(gameMap.HoveredTile))
     {
         trapManager.RemoveTrap(gameMap.HoveredTile);
     }
 }
コード例 #2
0
ファイル: Trap.cs プロジェクト: Zelgunn/Super-Galaxy-Contest
    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);
    }