UnityEngine.UI.GemToggleGroup.NotifyToggleClick C# (CSharp) Method

NotifyToggleClick() public method

public NotifyToggleClick ( GemToggle toggle ) : void
toggle GemToggle
return void
        public void NotifyToggleClick(GemToggle toggle)
        {
            if (ActiveToggles ().Count () == 1) {
                for (var i = 0; i < m_Toggles.Count; i++) {
                    if (m_Toggles [i].isOn) {
                        gm.SetGemOne (m_Toggles [i].AssociatedGem);
                        gm.SetGemTwo (m_Toggles [i].AssociatedGem);
                    }
                }
            }
            if (!toggle.isOn) {

                if (gm.GetGemOne () == toggle.AssociatedGem)
                    gm.ClearGemOne ();
                else if (gm.GetGemTwo () == toggle.AssociatedGem)
                    gm.ClearGemTwo ();
            }
            Debug.Log ("***********************");
            Debug.Log (gm.GetGemOne ().ToString ());
            Debug.Log (gm.GetGemTwo ().ToString ());
        }

Usage Example

コード例 #1
0
ファイル: GemToggle.cs プロジェクト: xiekaren/phobia-game
        /**
         * Called everytime toggle is clicked
         */
        public virtual void OnPointerClick(PointerEventData eventData)
        {
            if (eventData.button != PointerEventData.InputButton.Left)
            {
                return;
            }

            InternalToggle();
            m_Group.NotifyToggleClick(this);
        }