Exemple #1
0
    public void CopyCampaignFleet(CampaignFleet campaignFleet, Vector3 position, Vector3 direction)
    {
        this.factionID = campaignFleet.OwnerID;

        deploymentZoneCenter = position;
        deploymentZoneSize = new Vector3(400, 10, 400);

        deploymentZoneObject = (GameObject)Instantiate(deplomentZonePrefab);
        deploymentZoneObject.transform.position = deploymentZoneCenter;
        deploymentZoneObject.transform.localScale = deploymentZoneSize * 2;

        int x = 0;
        foreach (CampaignSquadron campaignSquadron in campaignFleet.squadrons)
        {
            Vector3 squadronPosition = new Vector3(0, 0, x * 1000) + position;

            GameObject sqrObject = (GameObject)Instantiate(squadronObject, squadronPosition, Quaternion.identity);
            sqrObject.transform.parent = this.transform;

            Squadron squadron = sqrObject.GetComponent<Squadron>();
            squadron.factionID = this.factionID;
            squadron.name = campaignSquadron.Name;
            squadron.CopyFromCampaignSquadron(campaignSquadron, squadronPosition, direction);
            AddSquadron(squadron);
            foreach (Ship ship in squadron.ships)
            {
                ships.Add(ship);
            }
            x++;
        }

        this.transform.Rotate(direction);
    }
Exemple #2
0
    public override void CheckFleetRequirements(CampaignFleet fleet)
    {
        if (fleet.ContainsSquadron("Colony Ship"))
        {
            canColonize = true;
        }

        canColonize = true;
    }
Exemple #3
0
    public void AddFleet(CampaignFleet fleet)
    {
        fleet.Battle += Battle;
        fleet.NewFleet += AddFleet;
        fleet.RemoveFleet += RemoveFleet;

        fleet.OwnerID = this.factionID;
        fleet.fleetColor = this.factionColor;
        fleets.Add(fleet);

        fleet.gameObject.transform.parent = this.transform.parent;
    }
Exemple #4
0
    public void AddFleet(CampaignFleet arrivingFleet)
    {
        fleets.Add(arrivingFleet);
        UpdateFleetIcons();
        UpdateCanColonize();

        foreach (CampaignFleet fleet in fleets)
        {
            if (fleet.OwnerID != arrivingFleet.OwnerID)
            {
                BattleManager battleManager = GameObject.Find("BattleManager").GetComponent<BattleManager>();
                battleManager.SetFleets(arrivingFleet, fleet);
                break;
            }
        }
    }
Exemple #5
0
 public void RemoveFleet(CampaignFleet fleet)
 {
     if (fleet.currentPlanet != null)
     {
         fleet.currentPlanet.RemoveFleet(fleet);
     }
     fleets.Remove(fleet);
     GameObject.Destroy(fleet);
 }
Exemple #6
0
 public void AddFleet(CampaignFleet fleet)
 {
     fleets.Add(fleet);
     UpdateSolarSystemInfoFleets();
 }
Exemple #7
0
 public void RemoveFleet(CampaignFleet fleet)
 {
     fleets.Remove(fleet);
     UpdateSolarSystemInfoFleets();
 }
Exemple #8
0
 public void SelectFleet(CampaignFleet fleet)
 {
     selectedFleet = fleet;
 }
Exemple #9
0
 public void DeselectFleet()
 {
     selectedFleet = null;
 }
Exemple #10
0
 public void RemoveFleet(CampaignFleet fleet)
 {
     fleets.Remove(fleet);
     UpdateFleetIcons();
     UpdateCanColonize();
 }
Exemple #11
0
 public virtual void CheckFleetRequirements(CampaignFleet fleet)
 {
 }
Exemple #12
0
 void Close()
 {
     campaignFleetAttackingFleet = null;
     campaignFleetDefendingFleet = null;
     _isActive = false;
 }
Exemple #13
0
 /// <summary>
 /// Set the fleets participating in the battle
 /// </summary>
 /// <param name="campaignAttackingFleet">The Attacking Fleet</param>
 /// <param name="campaignDefendingFleet">The Defending Fleet</param>
 public void SetFleets(CampaignFleet campaignAttackingFleet, CampaignFleet campaignDefendingFleet)
 {
     campaignFleetAttackingFleet = campaignAttackingFleet;
     campaignFleetDefendingFleet = campaignDefendingFleet;
     Open();
 }
 public AIObjectiveExplore(CampaignFleet fleet)
 {
 }
 public AIObjectiveBuildFleet(CampaignFleet fleet)
 {
 }