Exemplo n.º 1
0
    public static void SendTargetChoiceInfo(ShipTargetResolution tr)
    {
        int shipID = tr.attacker.Id;
        int teamID = (int)tr.attacker.team.TeamFaction;

        int[] targetIds     = new int[tr.targets.Count];
        int[] targetTeamIDs = new int[tr.targets.Count];
        for (int i = 0; i < tr.targets.Count; i++)
        {
            targetIds[i]     = tr.targets[i].Id;
            targetTeamIDs[i] = (int)tr.targets[i].team.TeamFaction;
        }
        PhotonView.Get(GameManager.main).RPC("SendTargetInfo", RpcTarget.Others, shipID, teamID, targetIds, targetTeamIDs);
    }
Exemplo n.º 2
0
    public void SendTargetInfo(int shipID, int teamID, int[] targetIDs, int[] targetTeamIDs)
    {
        if (teamID != (int)playerTeam.TeamFaction)
        {
            Debug.Log("Player's team does NOT own this multi target choice");
            return;
        }

        Debug.Log("Player's team DOES own this multi target choice");

        Ship        attacker = GetShip(shipID, teamID);
        List <Ship> targets  = new List <Ship>();

        for (int i = 0; i < targetIDs.Length; i++)
        {
            targets.Add(GetShip(targetIDs[i], targetTeamIDs[i]));
        }

        ShipTargetResolution targetChoice = new ShipTargetResolution(attacker, targets);

        StartCoroutine(targetChoice.resolve());
    }