예제 #1
0
        public override void Populate(T data)
        {
            if (m_fence != null)
            {
                ForegroundPositionService.Instance.DiscardFence(m_fence);
                m_fence = null;
            }

            m_mapAnnotation = data;

            if (InformationPane)
            {
                InformationPane.SetActive(false);
            }

            SetTitle(data.Location.Name);
            SetSubtitle(data.Location.Subtitle);

            if (WayfindingCompass)
            {
                WayfindingCompass.SetPointAtLocation(data.Location);
            }

            base.Populate(data);

            // Pass annotation data to any components that use it.
            PopulateComponents(data.GetData());
        }
예제 #2
0
        public override void Populate(MapAnnotation <LocationTaskDriver> data)
        {
            base.Populate(data);

            if (data.Data != null)
            {
                m_driver = data.Data;

                string title;
                string description;
                string subtitle;

                var driverLocTitle = data.Data.Task.Title;
                title = (driverLocTitle != "") ? driverLocTitle : data.Location.Name;

                var    character = data.Data.Task.Character;
                string charName  = null;

                if (character != null)
                {
                    charName = character.Alias;
                }

                if (charName != null)
                {
                    subtitle = charName;

                    if (!string.IsNullOrEmpty(data.Location.Name))
                    {
                        subtitle += " at " + data.Location.Name;
                    }
                }
                else
                {
                    subtitle = data.Location.Name;
                }

                description = data.Data.Task.Description;

                if (InformationPane)
                {
                    InformationPane.SetActive(true);
                }

                if (Title)
                {
                    Title.text = title;
                }

                if (Subtitle)
                {
                    Subtitle.text = subtitle;
                }

                if (Description)
                {
                    Description.text = description;
                }

                ShowButton(m_driver.ShowActionButton, m_driver.ActionButtonText);

                if (m_driver.Task.ActionRange != null)
                {
                    SetButtonFence(data.Location, m_driver.Task.ActionRange,
                                   m_driver.ActionButtonText,
                                   m_driver.OutOfRangeActionButtonText);
                }
                else
                {
                    SetInRange(true);
                }
            }
        }