Esempio n. 1
0
    private Slider GetHighlightedSlider()
    {
        HighlightInfo currentHighlight = GetCurrentHighlight();

        if (currentHighlight != null)
        {
            if (currentHighlight.m_SelectedGameObject == m_MasterSlider.gameObject)
            {
                return(m_MasterSlider);
            }
            else if (currentHighlight.m_SelectedGameObject == m_MusicSlider.gameObject)
            {
                return(m_MusicSlider);
            }
            else if (currentHighlight.m_SelectedGameObject == m_SFXSlider.gameObject)
            {
                return(m_SFXSlider);
            }
            else if (currentHighlight.m_SelectedGameObject == m_VoiceSlider.gameObject)
            {
                return(m_VoiceSlider);
            }
        }

        return(null);
    }
Esempio n. 2
0
    protected void Awake()
    {
        if (meshRenderers.Length == 0) return;

        highlightInfos = new HighlightInfo[meshRenderers.Length];

        for (var i = 0; i < meshRenderers.Length; i++)
        {
            var highlightInfo = new HighlightInfo();

            highlightInfo.meshRenderer = meshRenderers[i];

            highlightInfo.normalMaterials = meshRenderers[i].sharedMaterials;

            highlightInfo.highlightMaterials = new Material[highlightInfo.normalMaterials.Length + 1];

            for (var j = 0; j < highlightInfo.normalMaterials.Length; j++)
            {
                highlightInfo.highlightMaterials[j] = highlightInfo.normalMaterials[j];
            }

            highlightInfo.highlightMaterials[highlightInfo.highlightMaterials.Length - 1] = outlineMaterial;
            highlightInfos[i] = highlightInfo;
        }
    }
Esempio n. 3
0
    private IEnumerator WrongPlayerFeedback_Coroutine()
    {
        Image         highlightImage = null;
        HighlightInfo highlightInfo  = GetCurrentHighlight();

        if (highlightInfo != null)
        {
            highlightImage = highlightInfo.m_HighlightImage;
        }

        if (highlightImage != null)
        {
            float startingTime = Time.unscaledTime;
            while (Time.unscaledTime < startingTime + m_WrongPlayerFeedbackDuration)
            {
                if (Mathf.Sin((Time.unscaledTime - startingTime) * m_WrongPlayerFeedbackSpeed) > 0f)
                {
                    highlightImage.color = Color.red;
                }
                else
                {
                    highlightImage.color = Color.white;
                }
                yield return(null);
            }

            highlightImage.color = Color.white;
        }
    }
Esempio n. 4
0
        private static List <AppHighlightInfo> LoadHighlightedApps(XElement element)
        {
            var highlightedApps        = element.Element("HighlightedApps").Elements("HighlightedApp");
            var highlightedAppsObjects = new List <AppHighlightInfo>();

            foreach (XElement e in highlightedApps)
            {
                var highlightedApp = new AppHighlightInfo();
                highlightedApp.DetailedDescription = e.Attribute("detailedDescription").Value;
                highlightedApp.ShortDescription    = e.Attribute("shortDescription").Value;
                highlightedApp.Link       = e.Attribute("link").Value;
                highlightedApp.Name       = e.Attribute("name").Value;
                highlightedApp.Thumbnail  = string.Format("ms-appx:///{0}", e.Attribute("thumbnail").Value);
                highlightedApp.Icon       = string.Format("ms-appx:///{0}", e.Attribute("icon") != null ?  e.Attribute("icon").Value : "");
                highlightedApp.Highlights = new List <HighlightInfo>();

                foreach (XElement highlight in e.Elements("Highlight"))
                {
                    HighlightInfo hl = new HighlightInfo();
                    hl.Image = string.Format("ms-appx:///{0}", highlight.Attribute("image").Value);

                    highlightedApp.Highlights.Add(hl);
                }

                highlightedAppsObjects.Add(highlightedApp);
            }

            return(highlightedAppsObjects);
        }
Esempio n. 5
0
    protected void Awake()
    {
        if (meshRenderers.Length == 0)
        {
            return;
        }

        highlightInfos = new HighlightInfo[meshRenderers.Length];

        for (var i = 0; i < meshRenderers.Length; i++)
        {
            var highlightInfo = new HighlightInfo();

            highlightInfo.meshRenderer = meshRenderers[i];

            highlightInfo.normalMaterials = meshRenderers[i].sharedMaterials;

            highlightInfo.highlightMaterials = new Material[highlightInfo.normalMaterials.Length + 1];

            for (var j = 0; j < highlightInfo.normalMaterials.Length; j++)
            {
                highlightInfo.highlightMaterials[j] = highlightInfo.normalMaterials[j];
            }

            highlightInfo.highlightMaterials[highlightInfo.highlightMaterials.Length - 1] = outlineMaterial;
            highlightInfos[i] = highlightInfo;
        }
    }
Esempio n. 6
0
        private static HighlightInfo CreateHighlightInfo(XElement element)
        {
            HighlightInfo info = new HighlightInfo();

            System.Diagnostics.Debug.Assert(element != null, "Ported from old code, element purposedly should not be null.");
            info.Text        = element.GetAttribute("text", null);
            info.Description = element.GetAttribute("description", null);
            info.Image       = element.GetAttribute("image", null);

            return(info);
        }
Esempio n. 7
0
        public void GenerateHighlightInfoTest()
        {
            var deepLearner = new NeuralNetController();

            highlightInfo = deepLearner.GetHighlightPeriod(matchCollection[0], true);

            // Assert highlightInfo correct.
            Assert.True(highlightInfo.Score > 0.75);
            Assert.True(highlightInfo.StartOffset > 7400);
            Assert.True(File.Exists(TestHelper.tensorflowDataPath + "Predictions\\" + matchCollection[0].Match.BroadcastId + "match1_prediction.csv"));
        }
Esempio n. 8
0
 public static void HighlightedProxy(object node, bool setting, int reason = 7)
 {
     //Set
     if (AltRPal)
     {
         HighlightInfo.Invoke(node, new object[] { reason });
     }
     else if (HighlightedInfo != null)
     {
         HighlightedInfo.SetValue(node, setting);
     }
 }
Esempio n. 9
0
    protected void UpdateHighlightedGameObject(HighlightInfo[] highlightInfos)
    {
        if (EventSystem.current != null)
        {
            GameObject selectedGO = EventSystem.current.currentSelectedGameObject;
            if (selectedGO != null)
            {
                if (m_CurrentHighlight == null || selectedGO != m_CurrentHighlight.m_SelectedGameObject)
                {
                    bool newHighlightFound = false;
                    bool needNavigationSFX = false;
                    for (int i = 0; i < highlightInfos.Length; i++)
                    {
                        if (selectedGO == highlightInfos[i].m_SelectedGameObject)
                        {
                            if (m_CurrentHighlight != null)
                            {
                                m_CurrentHighlight.m_HighlightImage.enabled = false;
                            }
                            needNavigationSFX = m_CurrentHighlight == null || m_CurrentHighlight.m_HighlightImage != highlightInfos[i].m_HighlightImage;

                            m_CurrentHighlight = highlightInfos[i];
                            m_CurrentHighlight.m_HighlightImage.enabled = true;
                            newHighlightFound = true;
                        }
                    }

                    if (!newHighlightFound)
                    {
                        if (m_CurrentHighlight != null)
                        {
                            if (m_CurrentHighlight.m_HighlightImage != null)
                            {
                                m_CurrentHighlight.m_HighlightImage.enabled = false;
                            }
                            m_CurrentHighlight = null;
                        }
                    }
                    else if (needNavigationSFX)
                    {
                        m_AudioManager.PlayUISFX(EUISFXType.Navigation);
                    }
                }
            }
            else if (m_CurrentHighlight != null)
            {
                m_CurrentHighlight.m_HighlightImage.enabled = false;
                m_CurrentHighlight = null;
            }
        }
    }
Esempio n. 10
0
        private void UpdateResults()
        {
            var tssb = this.Items[0] as SearchBar;

            if (tssb == null)
            {
                return;
            }

            tssb.TotalRecords = _foundText.Count;
            foreach (var ft in _forHighlight)
            {
                var item = new HighlightInfo()
                {
                    CharIndex = ft.CharIndex, CharsCount = ft.CharsCount, Color = HighlightColor, Inflate = InflateHighlight
                };
                if (!PdfViewer.HighlightedTextInfo.ContainsKey(ft.PageIndex))
                {
                    PdfViewer.HighlightedTextInfo.Add(ft.PageIndex, new List <HighlightInfo>());
                }
                PdfViewer.HighlightedTextInfo[ft.PageIndex].Add(item);
            }
            _forHighlight.Clear();
        }
        private void btnPreview_Click(object sender, EventArgs e)
        {
            var time = new Model.Time(TimeSpan.Parse("0:33:43.4"), TimeSpan.Parse("0:33:24.72"));
            var start = new Model.AtomicDateTime(DateTime.UtcNow, true);
            var end = new Model.AtomicDateTime(DateTime.UtcNow + TimeSpan.FromMinutes(16.5), true);
            var attempt = new Model.Attempt(0, time, start, end);

            var hl = new HighlightInfo(null, new RunHistory.Run(attempt, "Half-Life", "Any%"), this);
            MessageBox.Show(this, String.Format("Title:\n{0}\n\nDescription:\n{1}", hl.Title, hl.Description), "Preview for a 33:24.72/33:43.4 run");
        }
Esempio n. 12
0
        private bool GetIsValidWholeWordMatch(GetMatchingLinesArgs args, string adjustedSearchLine, HighlightInfo match)
        {
            bool previousCharacterMatters = !LuceneHelper.IsValidTokenBreakCharactor(args.SearchString.FirstOrDefault());
            char previousCharacter        = adjustedSearchLine.ElementAtOrDefault(match.StartIndex - 1);

            bool nextCharacterMatters = !LuceneHelper.IsValidTokenBreakCharactor(args.SearchString.LastOrDefault());
            char nextCharacter        = adjustedSearchLine.ElementAtOrDefault(match.EndIndex);

            bool isValidWholeWordMatch = (!previousCharacterMatters || LuceneHelper.IsValidTokenBreakCharactor(previousCharacter)) &&
                                         (!nextCharacterMatters || LuceneHelper.IsValidTokenBreakCharactor(nextCharacter));

            return(isValidWholeWordMatch);
        }