Beispiel #1
0
    private void OnDataProxySelection(DataProxySelectionEvent e)
    {
        _currentEvent = e;

        TextMeshProUGUI upTmp = _upButton.GetComponentInChildren <TextMeshProUGUI> ();

        if (e.compound != null)
        {
            upTmp.text = $"sentences ({e.sentenceChoices.Count})";
        }
        else if (e.kanji != null)
        {
            upTmp.text = $"words ({e.compoundChoices.Count})";
        }

        TextMeshProUGUI dnTmp = _downButton.GetComponentInChildren <TextMeshProUGUI> ();

        if (e.compound != null)
        {
            dnTmp.text = $"kanji ({e.kanjiChoices.Count})";
        }
        else if (e.sentence != null)
        {
            dnTmp.text = $"words ({e.compoundChoices.Count})";
        }

        UpdateButtons();
        _title.gameObject.SetActive(_currentEvent.navType == NavType.Choice);
    }
 private void OnDataProxySelection(DataProxySelectionEvent e)
 {
     if (e.kanji != null)
     {
         DisplayItem(e.kanji);
     }
     else if (e.compound != null)
     {
         DisplayItem(e.compound);
     }
     else if (e.sentence != null)
     {
         DisplayItem(e.sentence);
     }
 }
Beispiel #3
0
    private void UpdateTitle(RuneType rType, DataProxySelectionEvent e)
    {
        _title.gameObject.SetActive(_currentEvent.navType == NavType.Choice);

        int kC = e.kanjiChoices?.Count ?? 0;
        int cC = e.compoundChoices?.Count ?? 0;
        int sC = e.sentenceChoices?.Count ?? 0;

        string val = e.kanji != null && cC > 0 && rType == RuneType.Up ? "Pick a word" :
                     e.compound != null && sC > 0 && rType == RuneType.Up ? "Pick a sentence" :
                     e.compound != null && kC > 0 && rType == RuneType.Down ? "Pick a kanji" :
                     e.sentence != null && cC > 0 && rType == RuneType.Down ? "Pick a word" :
                     "";

        _title.text = val;
    }
Beispiel #4
0
 public DataProxyChoicesEvent(RuneType runeType, DataProxySelectionEvent currentEvent)
 {
     this.runeType     = runeType;
     this.currentEvent = currentEvent;
 }