HunterGamePlayerScoreCounter.cs 628 B

12345678910111213141516
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /* 计分器-pk时分别统计玩家得分-击中动物不同部位得分不同 */
  5. public class HunterGamePlayerScoreCounter
  6. {
  7. public int[] hitScores = {0, 0};
  8. ChallengeGameModeLocalPK gameModeLocalPK;
  9. public HunterGamePlayerScoreCounter(ChallengeGameModeLocalPK gameModeLocalPK) {
  10. this.gameModeLocalPK = gameModeLocalPK;
  11. GameEventCenter.ins.onTargetAnimalHurt += (a, hurtValue) => {
  12. int playerIndex = gameModeLocalPK.GetCurrentPlayIndex();
  13. hitScores[playerIndex] += hurtValue;
  14. };
  15. }
  16. }