public void OnPointerEnter(PointerEventData eventData) { if (detective != null) { InterfaceManager.GetInstantiate().detectiveRollover.Show(this); } }
private void Equipe() { InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); Detective detective = interfaceManager.detectiveFile.GetDetective(); detective.EquipeItem((Equipment)item, !isEquiped); interfaceManager.detectiveFile.SetInventory(); }
private void ReturnToOffice() { Team team = DetectiveManager.GetInstantiate().teamOnWait; team.GoTo(Agency.GetInstantiate().GetOffice(), team.GetPriorityWay(), true); InterfaceManager.GetInstantiate().activitiesPanel.Close(); Game.GetInstantiate().ChangeGameState(GameState.IN_GAME); }
public void OnPointerExit(PointerEventData eventData) { //if (ControlManager.GetInstantiate().mouseover == this) //{ // ControlManager.GetInstantiate().mouseover = null; //} InterfaceManager.GetInstantiate().itemRollover.Hide(); }
public void OnPointerExit(PointerEventData eventData) { if (ControlManager.GetInstantiate().mouseover == this) { ControlManager.GetInstantiate().mouseover = null; } InterfaceManager.GetInstantiate().detectiveRollover.Hide(); }
public void OnPointerEnter(PointerEventData eventData) { //ControlManager.GetInstantiate().mouseover = this; if (item != null) { InterfaceManager.GetInstantiate().itemRollover.Show(this); } }
public void CheckDetectives() { InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); if (interfaceManager.activitiesPanel.prevState == GameState.WAIT_ACTIVITY_CHOICE) { detectivePanel.gameObject.SetActive(false); } else { detectivePanel.gameObject.SetActive(true); int dif = detectivePanel.childCount - _questEvent.GetAllDetectivesCount() - 1; if (dif > 0) { for (int i = 0; i < dif; i++) { Destroy(detectivePanel.GetChild(i).gameObject); } } else if (dif < 0) { for (int i = 0; i < -dif; i++) { Instantiate(detectiveIcon, detectivePanel); } } for (int i = 0; i < detectivePanel.childCount; i++) { if (i < _questEvent.detectivesOnEvent.Count) { detectivePanel.GetChild(i).GetComponent <DetectiveEventPanelIcon>().SetDetective(_questEvent.detectivesOnEvent[i], true); } else if (i < _questEvent.detectivesOnEvent.Count + _questEvent.potencialDetectivesOnEvent.Count) { int index = i - _questEvent.detectivesOnEvent.Count; detectivePanel.GetChild(i).GetComponent <DetectiveEventPanelIcon>().SetDetective(_questEvent.potencialDetectivesOnEvent[index], false); } else if (i < _questEvent.GetAllDetectivesCount()) { int index = i - _questEvent.detectivesOnEvent.Count - _questEvent.potencialDetectivesOnEvent.Count; detectivePanel.GetChild(i).GetComponent <DetectiveEventPanelIcon>().SetDetective(_questEvent.plannedDetectivesOnEvent[index], true); } else { detectivePanel.GetChild(i).GetComponent <DetectiveEventPanelIcon>().SetDetective(null, false); } } float iconWidth = detectivePanel.GetChild(0).GetComponent <RectTransform>().rect.width; detectivePanel.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, (_questEvent.GetAllDetectivesCount() + 1) * iconWidth + _questEvent.GetAllDetectivesCount() * 10); interfaceManager.activitiesPanel.CheckAccept(); } }
public static InterfaceManager GetInstantiate() { if (instance == null) { instance = FindObjectOfType <InterfaceManager>(); } if (instance == null) { Game game = Game.GetInstantiate(); instance = Instantiate(game.interfaceManager); } return(instance); }
public void Show(iRolloverOwner rolloverOwner) { gameObject.SetActive(true); owner = rolloverOwner; Item item = ((InventoryIcon)rolloverOwner).item; RectTransform rectTransform = gameObject.GetComponent <RectTransform>(); transform.parent = owner.GetRectTransform(); rectTransform.SetPositionAndRotation(new Vector2(owner.GetRectTransform().position.x, rectTransform.position.y), Quaternion.identity); rectTransform.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, owner.GetRectTransform().rect.yMax - 10 - rectTransform.rect.height, rectTransform.rect.height); transform.parent = InterfaceManager.GetInstantiate().canvas.transform; itemName.text = item.itemName; }
// Use this for initialization public void Show(iRolloverOwner rolloverOwner) { gameObject.SetActive(true); owner = rolloverOwner; Detective detective = null; RectTransform rectTransform = gameObject.GetComponent <RectTransform>(); transform.parent = owner.GetRectTransform(); rectTransform.SetPositionAndRotation(new Vector2(owner.GetRectTransform().position.x, rectTransform.position.y), Quaternion.identity); if (owner is DetectiveIcon) { detective = ((DetectiveIcon)owner).detective; rectTransform.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, owner.GetRectTransform().rect.yMax + 10, rectTransform.rect.height); } else if (owner is DetectiveReportIcon) { detective = ((DetectiveReportIcon)owner).detective; rectTransform.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, owner.GetRectTransform().rect.yMin + 10 + rectTransform.rect.height, rectTransform.rect.height); } else if (owner is DetectiveEventPanelIcon) { detective = ((DetectiveEventPanelIcon)owner).detective; rectTransform.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, owner.GetRectTransform().rect.yMin + 10 + rectTransform.rect.height, rectTransform.rect.height); } transform.parent = InterfaceManager.GetInstantiate().canvas.transform; if (rectTransform.offsetMin.x < -Screen.width / 2) { rectTransform.SetPositionAndRotation(new Vector2(rectTransform.position.x - (rectTransform.offsetMin.x + Screen.width / 2) + 10, rectTransform.position.y), Quaternion.identity); } else if (rectTransform.offsetMax.x > Screen.width / 2) { rectTransform.SetPositionAndRotation(new Vector2(rectTransform.position.x + (Screen.width / 2 - rectTransform.offsetMin.x) - 10, rectTransform.position.y), Quaternion.identity); } if (detective != null) { detectiveName.text = detective.characterName; temper.text = detective.temper.ToString().ToLower(); health.text = detective.GetHealthDescription(); stress.text = detective.GetStressDescription(); brutal.text = detective.GetMethodDescription(Method.Brutal); accuracy.text = detective.GetMethodDescription(Method.Accuracy); diplomacy.text = detective.GetMethodDescription(Method.Diplomacy); science.text = detective.GetMethodDescription(Method.Science); } }
public void Accept() { DetectiveManager detectiveManager = DetectiveManager.GetInstantiate(); InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); List <QuestTask> tasks = new List <QuestTask>(); for (int i = 0; i < tasksPanel.childCount; i++) { TaskPanel panel = tasksPanel.GetChild(i).GetComponent <TaskPanel>(); if (panel.taskToggle.isOn) { tasks.Add(panel.task); } } if (interfaceManager.activitiesPanel.prevState == GameState.WAIT_ACTIVITY_CHOICE) { Team team = detectiveManager.teamOnWait; team.targetTasks = tasks; if (team.startPlace == questEvent) { interfaceManager.activitiesPanel.prevState = GameState.IN_GAME; questEvent.AddTeam(team); team.StartTask(); interfaceManager.detectiveRow.ResetRow(); } else { team.GoTo(questEvent, team.GetPriorityWay(), true); interfaceManager.activitiesPanel.prevState = GameState.IN_GAME; } } else { List <Detective> detectives = new List <Detective>(); foreach (Detective detective in _questEvent.plannedDetectivesOnEvent) { detectives.Add(detective); _questEvent.potencialDetectivesOnEvent.Add(detective); } detectiveManager.TeamOnTarget(detectives, questEvent, tasks); } _questEvent.plannedDetectivesOnEvent.Clear(); }
public bool CheckAccept() { InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); bool detectiveFlag = false; bool taskFlag = false; if (questEvent.plannedDetectivesOnEvent.Count > 0 || interfaceManager.activitiesPanel.prevState == GameState.WAIT_ACTIVITY_CHOICE) { detectiveFlag = true; } for (int i = 0; i < tasksPanel.childCount; i++) { TaskPanel panel = tasksPanel.GetChild(i).GetComponent <TaskPanel>(); if (panel.taskToggle.isOn) { taskFlag = true; break; } } return(detectiveFlag && taskFlag); }
public void SetDetective(Detective detective, bool active) { if (detective != null) { InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); if (this.detective != detective) { _detective = detective; icon.sprite = detective.characterAvatar; name = string.Format("DetectiveEventIcon_{0}", detective.characterName); shadowPanel.gameObject.SetActive(!active); } } else { _detective = detective; icon.sprite = defaultSprite; name = string.Format("DetectiveIcon_Default"); name = string.Format("DetectiveEventIcon_Default"); shadowPanel.gameObject.SetActive(false); } }
public void Open() { InterfaceManager.GetInstantiate().filesPanel.AddFile(this); }
public void OnPointerEnter(PointerEventData eventData) { ControlManager.GetInstantiate().mouseover = this; InterfaceManager.GetInstantiate().detectiveRollover.Show(this); }
private void OpenFile() { InterfaceManager.GetInstantiate().detectiveFile.Open(detective); }
private void Check() { InterfaceManager.GetInstantiate().activitiesPanel.CheckAccept(); }
private void ReturnToHome() { _detective.ReturnToHome(); InterfaceManager.GetInstantiate().dialogPanel.ResetDetectives(); }
public void Realize(iEffectsContainer effectsContainer, Team team) { this.effectsContainer = effectsContainer; Game game = Game.GetInstantiate(); Agency agency = Agency.GetInstantiate(); QuestManager questManager = QuestManager.GetInstantiate(); DetectiveManager detectiveManager = DetectiveManager.GetInstantiate(); UI.InterfaceManager interfaceManager = UI.InterfaceManager.GetInstantiate(); if (type == EffectType.INSTANTIATE_QUEST) { GameObject goFolder = null; if (agency.transform.Find("Quests")) { goFolder = agency.transform.Find("Quests").gameObject; } else { goFolder = new GameObject("Quests"); goFolder.transform.parent = agency.transform; } Quest questInstance = Instantiate(quest, goFolder.transform); agency.quests.Add(questInstance); questInstance.Realize(); } else if (type == EffectType.CHANGE_QUEST) { GetQuest().ChangeMainState(mainState); } else if (type == EffectType.CHANGE_TASK) { if (effectsContainer is QuestTask) { team.reportEvent.Add(questEvent); team.reportChangeTask.Add(task); team.reportTaskState.Add(mainState); if (mainState == MainState.Started && task.mainState == MainState.NotStarted) { team.reportQuest.Add(GetQuest()); List <string> keys = new List <string>() { questEvent.eventName, task.taskName }; FileNoteContainer noteContainer = FileNoteContainer.Create(Dialog.DialogManager.GetInstantiate().newTaskNote, team.transform, keys); team.reportNotes.Add(noteContainer); } } else { questEvent.ChangeTask(task, mainState); } } else if (type == EffectType.CHANGE_OBJECTIVE) { if (effectsContainer is QuestTask) { team.reportChangeObjective.Add(objective); team.reportObjectiveState.Add(mainState); } else { objective.state = mainState; } } else if (type == EffectType.CHANGE_QUEST_STATE || type == EffectType.CHANGE_DIALOG_STATE || type == EffectType.CHANGE_GLOBAL_STATE) { if (questState.type == QuestStateType.BOOL) { questState.boolValue = boolValue; } else if (questState.type == QuestStateType.INT) { questState.intValue = intValue; } else if (questState.type == QuestStateType.SPECIAL) { questState.specialValue = stringValue; } } else if (type == EffectType.ADD_FILE_NOTE) { foreach (FileNote fileNote in fileNotes) { if (fileNote != null) { if (effectsContainer is QuestTask) { team.reportQuest.Add(GetQuest()); team.reportNotes.Add(FileNoteContainer.Create(fileNote, team.transform)); } else { GetQuest().notes.Add(FileNoteContainer.Create(fileNote, GetQuest().transform)); } } } } else if (type == EffectType.ADD_ITEM) { if (team != null) { Item newItem = Instantiate(item); team.AddItem(newItem); team.reportQuest.Add(GetQuest()); FileNoteContainer noteContainer = FileNoteContainer.Create(Dialog.DialogManager.GetInstantiate().addItemNote, team.transform, newItem.itemName); team.reportNotes.Add(noteContainer); } else { Item newItem = Instantiate(item, agency.transform); agency.items.Add(newItem); } } else if (type == EffectType.CHANGE_MONEY) { agency.ChangeMoney(money); } else if (type == EffectType.REALIZE_TASK) { Team owner = effectsContainer.GetTeam(); if (owner != null) { if (!owner.targetTasks.Contains(task)) { owner.targetTasks.Insert(0, task); } } } else if (type == EffectType.REALIZE_LOGIC_MAP) { if (logicMapOwner == LogicMap.LogicMapOwnerType.QUEST) { logicMap.RealizeLogicMap(GetQuest(), team); } else if (logicMapOwner == LogicMap.LogicMapOwnerType.QUEST_TASK) { logicMap.RealizeLogicMap(task, team); } } else if (type == EffectType.START_DIALOG) { Dialog.DialogManager.GetInstantiate().StartDialog(dialog, team, GetQuest()); } else if (type == EffectType.FINALIZE_TASK) { task.FinalizeTask(); } else if (type == EffectType.TEAM_GOTO_OFFICE) { if (team != null) { team.GoTo(agency.GetOffice(), team.GetPriorityWay(), true); } } else if (type == EffectType.TEAM_GOTO_HOMES) { if (team != null) { for (int i = 0; i < team.detectives.Count; i++) { team.detectives[i].ReturnToHome(); i--; } } } else if (type == EffectType.TEAM_GOTO_EVENT) { if (team != null) { game.ChangeGameState(GameState.WAIT_ACTIVITY_CHOICE); detectiveManager.teamOnWait = team; interfaceManager.detectiveRow.ResetRow(); } } else if (type == EffectType.TELEPORT_TO_EVENT) { if (team.curTarget is QuestEvent) { ((QuestEvent)team.startPlace).RemoveTeam(team); team.startPlace = questEvent; questEvent.AddTeam(team); } } else if (type == EffectType.TIMELINE_ACTION_CHANGE_QUEST_STATE) { Timeline timeline = Timeline.GetInstantiate(); GameObject goAction = new GameObject(string.Format("TimelineAction_ChangeQuestState")); goAction.transform.parent = timeline.transform; TimelineAction action = goAction.AddComponent <TimelineAction>(); action.actionType = TimelineActionType.CHANGE_QUEST_STATE; action.questState = questState; action.flag = boolValue; action.value = intValue; action.specialValue = stringValue; if (waitType == LogicMap.WaitType.ABSOLUTE) { action.timer = GameTime.ConvertToFloat(waitTime); } else if (waitType == LogicMap.WaitType.RELATION) { action.timer = timeline.GetTime() + GameTime.ConvertToFloat(waitTime); } timeline.RegistrateAction(action); } else if (type == EffectType.CHECK_QUEST) { } }
private void ShowQuestFile() { InterfaceManager.GetInstantiate().questFile.Open(quest); }
public void OnPointerExit(PointerEventData eventData) { InterfaceManager.GetInstantiate().detectiveRollover.Hide(); }
public void Close() { InterfaceManager.GetInstantiate().filesPanel.RemoveFile(this); }
private void Awake() { InterfaceManager interfaceManager = InterfaceManager.GetInstantiate(); questsButton.onClick.AddListener(delegate { interfaceManager.questBureau.Open(); }); }