Beispiel #1
0
 public PlayerScoreInfo(PlayerCharacterSettingsScript pl, int kill, int assist, int death)
 {
     player = pl;
     kills = kill;
     assists = assist;
     deaths = death;
 }
 public void RegisterPlayerData(PlayerCharacterSettingsScript characterBuild)
 {
     build = characterBuild.character;
 }
    bool allowUpdates = false; //can this PlayerCharacterSettingsScript save changes to the user's preferences

    #endregion Fields

    #region Constructors

    static PlayerCharacterSettingsScript()
    {
        currentBuild = new PlayerCharacterSettingsScript();
    }
    void ApplyBuild(NetworkViewID p, NetworkMessageInfo info)
    {
        build = playerData.GetPlayerData(p);		//grab our Player's build from PlayerData
        build.character = this;						//mark this CharacterBuildScript in the PlayerData, under the appropriate player

        //for our overhead name display, mark our build
        nameDisplay.RegisterPlayerData(build);

        //Set the player's color based on the team they have selected
        transform.Find("CharacterModel").renderer.material.SetColor("_Color", build.team.color);

        //Always add the two movement abilities first, jump, then dash
        AbilityDatabase.GetMoveAbility(0).AddToPlayer(this);	//jump
        AbilityDatabase.GetMoveAbility(1).AddToPlayer(this);	//dash

        //add the role abilities
        AbilityDatabase.GetRoleAbility(0).AddToPlayer(this);	//push
        AbilityDatabase.GetRoleAbility(1).AddToPlayer(this);	//box drop
        AbilityDatabase.GetRoleAbility(2).AddToPlayer(this);	//area push
        AbilityDatabase.GetRoleAbility(4).AddToPlayer(this);	//toggle gravity

        //if this is our player, register the build with the HUD
        if(networkView.isMine)
            hud.RegisterCharacterBuild(this);

        //start the cooldowns for this player
        RestartAbilities();
    }