PlayerPresence.ReceiveScorePoints C# (CSharp) Method

ReceiveScorePoints() public method

public ReceiveScorePoints ( int points ) : void
points int
return void
    public void ReceiveScorePoints(int points)
    {
        if (networkView.isMine)
        {
            OwnerReceiveScorePoints(points);
        }
        else
        {
            networkView.RPC("RemoteReceiveScorePoints", networkView.owner, points);
        }
    }

Usage Example

 private void ReceivePlayerDied(PlayerScript deadPlayerScript, PlayerPresence instigator)
 {
     if (instigator != null)
     {
         if (deadPlayerScript.Possessor == instigator)
         {
             Server.BroadcastMessageFromServer(deadPlayerScript.Possessor.Name + " committed suicide");
             instigator.ReceiveScorePoints(-1);
         }
         else
         {
             Server.BroadcastMessageFromServer(deadPlayerScript.Possessor.Name + " was destroyed by " + instigator.Name);
             instigator.ReceiveScorePoints(1);
             if (!AnnouncedFirstKill)
             {
                 Server.BroadcastMessageFromServer(instigator.Name + " draws first blood", Server.BannerMessageWithSoundType);
                 AnnouncedFirstKill = true;
             }
         }
     }
     else
     {
         Server.BroadcastMessageFromServer(deadPlayerScript.Possessor.Name + " was destroyed");
     }
     deadPlayerScript.PerformDestroy();
 }
All Usage Examples Of PlayerPresence::ReceiveScorePoints