Exemplo n.º 1
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (detective != null)
     {
         InterfaceManager.GetInstantiate().detectiveRollover.Show(this);
     }
 }
Exemplo n.º 2
0
        private void Equipe()
        {
            InterfaceManager interfaceManager = InterfaceManager.GetInstantiate();
            Detective        detective        = interfaceManager.detectiveFile.GetDetective();

            detective.EquipeItem((Equipment)item, !isEquiped);
            interfaceManager.detectiveFile.SetInventory();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     //ControlManager.GetInstantiate().mouseover = this;
     if (item != null)
     {
         InterfaceManager.GetInstantiate().itemRollover.Show(this);
     }
 }
Exemplo n.º 5
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (ControlManager.GetInstantiate().mouseover == this)
     {
         ControlManager.GetInstantiate().mouseover = null;
     }
     InterfaceManager.GetInstantiate().detectiveRollover.Hide();
 }
Exemplo n.º 6
0
 public void OnPointerExit(PointerEventData eventData)
 {
     //if (ControlManager.GetInstantiate().mouseover == this)
     //{
     //    ControlManager.GetInstantiate().mouseover = null;
     //}
     InterfaceManager.GetInstantiate().itemRollover.Hide();
 }
Exemplo n.º 7
0
        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();
            }
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        // 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);
            }
        }
Exemplo n.º 10
0
        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();
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
 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);
     }
 }
Exemplo n.º 13
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     ControlManager.GetInstantiate().mouseover = this;
     InterfaceManager.GetInstantiate().detectiveRollover.Show(this);
 }
Exemplo n.º 14
0
 private void OpenFile()
 {
     InterfaceManager.GetInstantiate().detectiveFile.Open(detective);
 }
Exemplo n.º 15
0
 private void Check()
 {
     InterfaceManager.GetInstantiate().activitiesPanel.CheckAccept();
 }
Exemplo n.º 16
0
 public void Open()
 {
     InterfaceManager.GetInstantiate().filesPanel.AddFile(this);
 }
Exemplo n.º 17
0
 private void ShowQuestFile()
 {
     InterfaceManager.GetInstantiate().questFile.Open(quest);
 }
Exemplo n.º 18
0
 public void OnPointerExit(PointerEventData eventData)
 {
     InterfaceManager.GetInstantiate().detectiveRollover.Hide();
 }
Exemplo n.º 19
0
 private void ReturnToHome()
 {
     _detective.ReturnToHome();
     InterfaceManager.GetInstantiate().dialogPanel.ResetDetectives();
 }
Exemplo n.º 20
0
 public void Close()
 {
     InterfaceManager.GetInstantiate().filesPanel.RemoveFile(this);
 }
Exemplo n.º 21
0
        private void Awake()
        {
            InterfaceManager interfaceManager = InterfaceManager.GetInstantiate();

            questsButton.onClick.AddListener(delegate { interfaceManager.questBureau.Open(); });
        }