Exemple #1
0
 void ToggleValueChanged(bool aOn)
 {
     if (aOn)
     {
         mToggle.GetComponentInChildren <UnityEngine.UI.Text>().text = "閉じる";
         mExtend.SetActive(true);
     }
     else
     {
         mToggle.GetComponentInChildren <UnityEngine.UI.Text>().text = "開く";
         mExtend.SetActive(false);
     }
 }
Exemple #2
0
    public void OnEnable()
    {
        hours.text = h.ToString(); minutes.text = m.ToString();

        if (!GameManager.instance.hasUnlockedNotifications)
        {
            notificationToggle.interactable = false;
            notificationToggle.GetComponentInChildren <UnityEngine.UI.Text>().text = "[Gesperrt]";
        }
        else
        {
            notificationToggle.interactable = true;
            notificationToggle.GetComponentInChildren <UnityEngine.UI.Text>().text = "Aktiv?";
        }
    }
Exemple #3
0
 public string GetAnswer()
 {
     if (yes.isOn)
     {
         return($"{questionText.text} : {yes.GetComponentInChildren<Text>().text}");
     }
     else
     {
         return($"{questionText.text} : {no.GetComponentInChildren<Text>().text}");
     }
 }
    public override void Setup(SidebarManager _sidebarManager)
    {
        base.Setup(_sidebarManager);
        Util.FindIfNotSet(this, ref userMain);
        closeButton.onClick.AddListener(RequestClose);

        for (int i = 0; i < FXnames.Length; i++)
        {
            UnityEngine.UI.Toggle newtoggle = Instantiate(FXToggleFab, FXparent).GetComponent <UnityEngine.UI.Toggle>();
            string scriptname = FXscripts[i];
            newtoggle.GetComponentInChildren <TMPro.TextMeshProUGUI>().text = FXnames[i];
            newtoggle.onValueChanged.AddListener((on) => ToggleFX(on, scriptname));
        }

        Destroy(FXToggleFab.gameObject);
    }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     SoundManager = GetComponent <UnityEngine.UI.Toggle> ();
     SoundText    = SoundManager.GetComponentInChildren <UnityEngine.UI.Text> ();
 }
 private void Init()
 {
     btnToggleSound.GetComponentInChildren <TextMeshProUGUI>().text = "Sound is ON";
     sliderBgMusic.value = PlayerPrefs.GetFloat(PlayerPrefsConstants.PLAYER_PREFS_BG_MUSIC, 100f);
 }