Example #1
0
    private void Start()
    {
        theCastle = GameObject.Find("The Castle").GetComponent <EncounterSite>();
        rosta     = GameObject.Find("PlayerData" + "(Clone)").GetComponent <RostaInfo>();
        if (rosta == null)
        {
            Debug.LogError("Encounter could not find the player data");
        }

        if (RostaInfo.currentEncounter != null)
        {
            if (RostaInfo.currentEncounter.completionState == Encounter.CompletionState.VICTORY)
            {
                MapUIManager.RequestAlert(RostaInfo.currentEncounter.victoryMapText, "Return");
                RostaInfo.currentEncounter.selectedCompany.targetEncounter = null;
                RostaInfo.currentEncounter.site.encounter = null;
                RostaInfo.encounters.Remove(RostaInfo.currentEncounter);
            }
            else if (RostaInfo.currentEncounter.completionState == Encounter.CompletionState.DEFEAT)
            {
                MapUIManager.RequestAlert(RostaInfo.currentEncounter.defeatMapText, "Return");
                RostaInfo.currentEncounter.selectedCompany.targetEncounter = null;
                RostaInfo.currentEncounter.selectedCompany = null;
                RostaInfo.currentEncounter.completionState = Encounter.CompletionState.UNASSIGNED;
            }
        }

        foreach (Encounter e in RostaInfo.encounters)
        {
            e.GetReferences();
            e.runCompanySelectSetUp = false;
            e.site           = GameObject.Find(e.site.SiteName).GetComponent <EncounterSite>();
            e.site.encounter = e;
            e.site.ShowEncounter();
        }

        for (int i = RostaInfo.companies.Count - 1; i >= 0; i--)
        {
            if (RostaInfo.companies[i].units.Count == 0)
            {
                RostaInfo.companies.RemoveAt(i);
            }
            else
            {
                RostaInfo.companies[i].CreateCompany();
            }
        }

        date.text = ("Day " + RostaInfo.date);
        CheckForAvailableEncounters();
    }
Example #2
0
 public override void Selected()
 {
     if (selectedCompany == null)
     {
         if (rosta.castle.Count == 0)
         {
             MapUIManager.RequestAlert("You have no available troops.", "Return");
             return;
         }
         MapUIManager.RequestConfirmation(RallyConfirmationQuestionText, RallyConfirmationYesText, RallyConfirmationNoText);
         ConfirmationPopUp.onConfirm += GoToCompanySelect;
         ConfirmationPopUp.onCancel  += CancelRally;
     }
     else
     {
         MapUIManager.RequestAlert(companyAlreadyAssignedText, EncounterStartConfirmationNoText);
     }
 }
Example #3
0
 void Awake()
 {
     uiManager = transform.parent.parent.GetComponent <MapUIManager>();
     LoadJson();
 }
Example #4
0
	void Update() {
		if (!mUM) mUM = GameObject.Find("UIManager").GetComponent<MapUIManager>();
		currentlySelected = mUM.getCurrentlySelectedObject();
	}
Example #5
0
	void Start () {
		//Set it to null on runtime because the default is
		//the unity logo.
		headDisplay.texture = null;
		mUM = GameObject.Find("UIManager").GetComponent<MapUIManager>();
	}
Example #6
0
 public override void EncounterButtonSelected()
 {
     MapUIManager.RequestConfirmation(EncounterStartConfirmationQuestionText, EncounterStartConfirmationYesText, EncounterStartConfirmationNoText);
     ConfirmationPopUp.onConfirm += StartEncounter;
     ConfirmationPopUp.onCancel  += CancelEncounter;
 }
Example #7
0
	protected virtual void OnMouseOver() {
		if (uiManager == null) uiManager = GameObject.Find("UIManager").GetComponent<MapUIManager>();
		uiManager.setDefaultCursor();
	}
Example #8
0
 public override void Init()
 {
     //base.Init();
     uiManager         = root.transform.Find("Map_Panel").GetComponent <MapUIManager>();
     uiManager.mapNode = this;
 }