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(); }
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); } }
void Awake() { uiManager = transform.parent.parent.GetComponent <MapUIManager>(); LoadJson(); }
void Update() { if (!mUM) mUM = GameObject.Find("UIManager").GetComponent<MapUIManager>(); currentlySelected = mUM.getCurrentlySelectedObject(); }
void Start () { //Set it to null on runtime because the default is //the unity logo. headDisplay.texture = null; mUM = GameObject.Find("UIManager").GetComponent<MapUIManager>(); }
public override void EncounterButtonSelected() { MapUIManager.RequestConfirmation(EncounterStartConfirmationQuestionText, EncounterStartConfirmationYesText, EncounterStartConfirmationNoText); ConfirmationPopUp.onConfirm += StartEncounter; ConfirmationPopUp.onCancel += CancelEncounter; }
protected virtual void OnMouseOver() { if (uiManager == null) uiManager = GameObject.Find("UIManager").GetComponent<MapUIManager>(); uiManager.setDefaultCursor(); }
public override void Init() { //base.Init(); uiManager = root.transform.Find("Map_Panel").GetComponent <MapUIManager>(); uiManager.mapNode = this; }