示例#1
0
    public override void Whacked(PlayerController player)
    {
        if (player.photonView.isMine)
        {
            //send player ui an message to increase their score
            PlayerUI.LocalPlayerUi.IncreaseScore(scorePerHit);

            anim.SetTrigger("W");
            HitStop.PlayHitStop();
            if (!PhotonNetwork.offlineMode)
            {
                photonView.RPC("RPCSetAnimWhacked", PhotonTargets.OthersBuffered);
            }
        }
    }
    private void Explode()
    {
        isExploding = true;

        HitStop.PlayHitStop();

        SpawnParticle(explosionParticlePrefab);

        //Iterate through everything
        Collider[] col = Physics.OverlapSphere(transform.position, explosionRadius);
        for (int i = 0; i < col.Length; i++)
        {
            if (col[i].GetComponent <PlayerBase>())
            {
                col[i].GetComponent <PlayerBase>().PController.Whacked();
            }
        }

        transform.position = spawnPos;
        anim.SetBool("Retract", true);
    }