Пример #1
0
    public void BarInit(GameObject inOwnerObject, Enums.TeamOption teamOption, int maxHp, int maxShield)
    {
        hpGauge.sprite     = (teamOption == Enums.TeamOption.BlueTeam) ? blueTeamHpGaugeSprite : redTeamHpGaugeSprite;
        hpPrevGauge.sprite = backHpGaugeSprite;

        oneHpLength     = hpGauge.sprite.rect.width / maxHp;
        oneShieldLength = manaGauge.sprite.rect.width / maxShield;
        ownerObject     = inOwnerObject;
    }
Пример #2
0
 public void AddTeamMember(TeamOption inPlayerTeam, int iAddCount = 1)
 {
     if (inPlayerTeam == TeamOption.RedTeam)
     {
         RedTeamCount += iAddCount;
     }
     else if (inPlayerTeam == TeamOption.BlueTeam)
     {
         BlueTeamCount += iAddCount;
     }
 }
Пример #3
0
    public TeamOption CollocateTeam()
    {
        TeamOption playerTeam = TeamOption.NoneTeam;

        if (BlueTeamCount == RedTeamCount)
        {
            playerTeam = (TeamOption)Random.Range((int)TeamOption.RedTeam, (int)TeamOption.Solo);
        }
        else
        {
            int redCnt  = RedTeamCount;
            int blueCnt = BlueTeamCount;

            playerTeam = (redCnt < blueCnt) ? TeamOption.RedTeam : TeamOption.BlueTeam;
        }

        return(playerTeam);
    }
Пример #4
0
    public override bool BaseCollisionProcess(BasePlayer player)
    {
        if (IsAttackable(PhotonNetwork.LocalPlayer, player.photonView.Owner))
        {
            player.OnDamaged(AttackDamage);
        }
        else
        {
            Enums.TeamOption team   = (Enums.TeamOption)player.photonView.Owner.CustomProperties[Enums.PlayerProperties.TEAM];
            Enums.TeamOption myTeam = (Enums.TeamOption)ownerPlayer.photonView.Owner.CustomProperties[Enums.PlayerProperties.TEAM];

            if (team == myTeam)
            {
                player.OnHeal((int)(AttackDamage * 1.5));
            }
        }

        PhotonNetwork.Destroy(this.gameObject);

        return(true);
    }
Пример #5
0
    public void PlayerInit(Enums.TeamOption team, Vector3 pos)
    {
        transform.position = pos;

        photonView.RPC("RPCTranslatePosition", RpcTarget.Others, transform.position);
    }