Пример #1
0
        public void Start()
        {
            var toggleEvent = new Toggle.ToggleEvent();

            gameObject.GetComponent <Toggle>().onValueChanged = toggleEvent;
            theme.BridgePainter = lightPainter;
            toggleEvent.AddListener(Toggle_Changed);
        }
Пример #2
0
        public void AddToggleChange(GameObject go, LuaFunction luafunc)
        {
            var toggle = go.GetComponent <Toggle>();

            if (toggle != null)
            {
                var changeEvent = new Toggle.ToggleEvent();
                changeEvent.AddListener((bool value) => luafunc.Call(toggle));
                toggle.onValueChanged = changeEvent;
            }
        }
Пример #3
0
            public virtual Toggle.ToggleEvent GetOnSelectAction()
            {
                var newAction = new Toggle.ToggleEvent();

                newAction.AddListener((x) =>
                {
                    if (TabToggle?.isOn ?? false)
                    {
                        TabToggle.GetComponentInParent <PediaUI>().SelectEntry(Entries[0], true, Entries[0]);
                    }
                });
                return(newAction);
            }
Пример #4
0
    /// <summary>
    /// Bind Event Handler at LogicManager to UnityUI callbacks
    /// </summary>
    private void BindEventHandler()
    {
        SetHandler_And_InitDefaultString(_AddHeaderInputField, _LogicManager.OnEndInputHeader, DefaultHeader);
        SetHandler_And_InitDefaultString(_KeywordInputField, _LogicManager.OnEndInputKeyword, DefaultKeyword);
        SetHandler_And_InitDefaultString(_ParsingSymbolField, _LogicManager.OnEndInputParsingTerminateSymbol, DefaultParsing);
        SetHandler_And_InitDefaultString(_UrlInputField, _LogicManager.OnEndInputUrl);

        var handlerWrapper = new Toggle.ToggleEvent();

        handlerWrapper.AddListener(_LogicManager.OnNicoNicoToggleSwitched);
        _WhenNicoNico.onValueChanged = handlerWrapper;

        _ExportInputField.text = UILogicManager.ExportDirectory;
    }
Пример #5
0
 private void ActivateTogglesBehaviour(int windowsCount)
 {
     for (var i = 0; i < windowsCount; i++)
     {
         var onValueChanged = new Toggle.ToggleEvent();
         var windowIndex    = i;
         onValueChanged.AddListener(arg0 =>
         {
             if (arg0)
             {
                 GoToWindow(windowIndex);
             }
         });
         var toggle = toggleContainer.GetChild(i).GetComponent <Toggle>();
         toggle.onValueChanged = onValueChanged;
         toggle.isOn           = i == activeWindow;
         toggleContainer.GetChild(i).gameObject.SetActive(true);
     }
 }
Пример #6
0
    void Start()
    {
        //Scene m_Scene = SceneManager.GetActiveScene();
        if (FindObjectOfType <MusicManager>() == null && SceneManager.GetActiveScene().buildIndex != 1)
        {
            Instantiate(musicManager as GameObject);
            childMusicManager = FindObjectOfType <MusicManager>().gameObject;
        }

        if (OnValueChanged == null && m_MutedToggle != null)
        {
            OnValueChanged = m_MutedToggle.onValueChanged;
            OnValueChanged.AddListener(SetSourcesMuted);
        }
        if (m_MutedToggle != null)
        {
            m_MutedToggle.isOn = PlayerPrefsManager.GetGlobalMusicManagerMuted();
        }
    }
Пример #7
0
 void Update()
 {
     if (Liste_de_couleurs_listeners_set == false)
     {
         //Ajout des listener à chaque toggle pour la couleur de la cible
         Toggle[] Toggles_couleurs = Liste_de_couleurs.GetComponentsInChildren <Toggle> ();
         for (int i = 0; i < Toggles_couleurs.Length; i++)
         {
             string             couleur             = Toggles_couleurs [i].GetComponentInChildren <Text> ().text;
             Toggle             currentToggle       = Toggles_couleurs [i];
             Toggle.ToggleEvent onToggleChangeEvent = new Toggle.ToggleEvent();
             onToggleChangeEvent.AddListener(delegate {
                 onValueChangeCouleurCible(couleur, currentToggle);
             });
             Toggles_couleurs [i].onValueChanged = onToggleChangeEvent;
             Liste_de_couleurs_listeners_set     = true;
         }
     }
 }
Пример #8
0
        private void CreateEaseToggles()
        {
            Toggle.ToggleEvent toggleEvent = new Toggle.ToggleEvent();
            toggleEvent.AddListener(OnValueChanged);

            ToggleGroup toggleGroup = EaseTogglesRoot.GetComponent<ToggleGroup>();
            foreach (string easeName in Enum.GetNames(typeof(Ease)))
            {
                RectTransform easeToggle = Instantiate(EaseTogglePrefab);
                easeToggle.SetParent(EaseTogglesRoot);
                easeToggle.name = easeName;
                easeToggle.localScale = Vector3.one;
                easeToggle.GetComponentInChildren<Text>().text = easeName;
                Toggle toggle = easeToggle.GetComponent<Toggle>();
                toggle.group = toggleGroup;
                toggle.onValueChanged = toggleEvent;
                _easeToggles.Add(toggle);
            }
            toggleGroup.SetAllTogglesOff();
            _easeToggles[0].isOn = true;
        }
Пример #9
0
		private void CreateEaseToggles()
		{
			Toggle.ToggleEvent toggleEvent = new Toggle.ToggleEvent();
			toggleEvent.AddListener(new UnityEngine.Events.UnityAction<bool>(OnValueChanged));

			ToggleGroup toggleGroup = EaseTogglesRoot.GetComponent<ToggleGroup>();
			foreach(string easeName in Enum.GetNames(typeof(Ease)))
			{
				RectTransform easeToggle = Instantiate(EaseTogglePrefab);
				easeToggle.SetParent(EaseTogglesRoot);
				easeToggle.name = easeName;
				easeToggle.localScale = Vector3.one;
				easeToggle.GetComponentInChildren<Text>().text = easeName;
				Toggle toggle = easeToggle.GetComponent<Toggle>();
				toggle.group = toggleGroup;
				toggle.onValueChanged = toggleEvent;
				_easeToggles.Add(toggle);
			}
			toggleGroup.SetAllTogglesOff();
			_easeToggles[0].isOn = true;
		}
Пример #10
0
 public static void Add(this Toggle.ToggleEvent toggleEvent, Action action)
 {
     toggleEvent.AddListener((isToggle) => { action(); });
 }
Пример #11
0
 public static void AddListener(this Toggle.ToggleEvent submitEvent, Function funcToExecute)
 {
     submitEvent.AddListener(new Action <bool>((b) => { funcToExecute(b); }));
 }
Пример #12
0
        void CalledByStartInitPage06()
        {
            OnMultiModeChange.AddListener(VRCattleManager.instance.MultiModeChange);
            AddBtListener(page06Bt01, ForPage06Bt01);
            AddBtListener(page06Bt02, ForPage06Bt02);
            AddBtListener(page06Bt03, ForPage06Bt03);
            AddBtListener(page06Bt04, ForPage06Bt04);
            AddBtListener(page06Bt05, ForPage06Bt05);
            AddBtListener(page06Bt06, ForPage06Bt06);
            AddBtListener(page06Bt07, ForPage06Bt07);
            AddBtListener(page06Bt08, ForPage06Bt08);
            AddBtListener(page06Bt09, ForPage06Bt09);
            AddBtListener(page06Bt10, ForPage06Bt10);
            AddBtListener(page06Bt11, ForPage06Bt11);
            AddBtListener(page06Bt12, ForPage06Bt12);
            AddBtListener(page06Bt13, ForPage06Bt13);
            AddBtListener(page06Bt14, ForPage06Bt14);
            AddBtListener(page06Bt15, ForPage06Bt15);
            AddBtListener(page06Bt16, ForPage06Bt16);
            AddBtListener(page06Bt17, ForPage06Bt17);
            AddBtListener(page06Bt18, ForPage06Bt18);
            AddBtListener(page06Bt19, ForPage06Bt19);
            AddBtListener(page06Bt20, ForPage06Bt20);
            AddBtListener(page06Bt21, ForPage06Bt21);
            AddBtListener(page06Bt22, ForPage06Bt22);
            AddBtListener(page06Bt23, ForPage06Bt23);
            AddBtListener(page06Bt24, ForPage06Bt24);
            AddBtListener(page06Bt25, ForPage06Bt25);
            AddBtListener(page06Bt26, ForPage06Bt26);
            AddBtListener(page06Bt27, ForPage06Bt27);
            AddBtListener(page06Bt28, ForPage06Bt28);
            AddBtListener(page06Bt29, ForPage06Bt29);
            AddBtListener(page06Bt30, ForPage06Bt30);
            AddBtListener(page06Bt31, ForPage06Bt31);
            AddBtListener(page06Bt32, ForPage06Bt32);
            AddBtListener(page06Bt33, ForPage06Bt33);
            AddBtListener(page06Bt34, ForPage06Bt34);
            AddBtListener(page06Bt35, ForPage06Bt35);
            AddBtListener(page06Bt36, ForPage06Bt36);
            AddBtListener(page06Bt37, ForPage06Bt37);
            AddBtListener(page06Bt38, ForPage06Bt38);
            AddBtListener(page06Bt39, ForPage06Bt39);
            AddBtListener(page06Bt40, ForPage06Bt40);
            AddBtListener(page06Bt41, ForPage06Bt41);
            AddBtListener(page06Bt42, ForPage06Bt42);
            AddBtListener(page06Bt43, ForPage06Bt43);
            AddBtListener(page06Bt44, ForPage06Bt44);
            AddBtListener(page06Bt45, ForPage06Bt45);
            AddScrollbarListener(page06Scrollbar, ForPage06Scrollbar);

            page06Bt34ForDrawG = page06Bt34.GetComponent <VRCattleForDrawGraphicBts>();
            page06Bt35ForDrawG = page06Bt35.GetComponent <VRCattleForDrawGraphicBts>();
            page06Bt36ForDrawG = page06Bt36.GetComponent <VRCattleForDrawGraphicBts>();

            page06LeftToolChildBts.SetActive(false);
            page06ChildBtList.SetActive(false);
            page06ImageInfo.SetActive(false);
            page06RawImageBiaoJi.SetActive(false);
            page06ImageBiaoJiBts.SetActive(false);
            saveOkImage.SetActive(false);
            jieTuSaveOKImage.SetActive(false);
            page06PanelExitMask.SetActive(false);
            page06KeyBoard.SetActive(false);

            ForPage06Bt09();

            page06.SetActive(false);
            VRCattleManager.instance.root.SetActive(false);
        }
Пример #13
0
 public static void Add(this Toggle.ToggleEvent buttonClickedEvent, Action <bool> action)
 {
     buttonClickedEvent.AddListener((b) => { action(b); });
 }
Пример #14
0
 void Update()
 {
     if (Liste_de_couleurs_listeners_set == false) {
         //Ajout des listener à chaque toggle pour la couleur de la cible
         Toggle[] Toggles_couleurs = Liste_de_couleurs.GetComponentsInChildren<Toggle> ();
         for (int i=0; i<Toggles_couleurs.Length; i++) {
             string couleur = Toggles_couleurs [i].GetComponentInChildren<Text> ().text;
             Toggle currentToggle = Toggles_couleurs [i];
             Toggle.ToggleEvent onToggleChangeEvent = new Toggle.ToggleEvent ();
             onToggleChangeEvent.AddListener (delegate {
                 onValueChangeCouleurCible (couleur, currentToggle);
             });
             Toggles_couleurs [i].onValueChanged = onToggleChangeEvent;
             Liste_de_couleurs_listeners_set = true;
         }
     }
 }