void DoSetValue()
		{
			if (_selectable!=null)
			{
				_navigation = _selectable.navigation;
				_navigation.mode = navigationMode;
				_selectable.navigation = _navigation;
			}
		}
		public override void OnExit()
		{
			if (_selectable==null)
			{
				return;
			}
			
			if (resetOnExit.Value)
			{
				_navigation = _selectable.navigation;
				_navigation.mode = _originalValue;
				_selectable.navigation = _navigation;
			}
		}
        private void SetupTemplateButtonNavigation()
        {
            // Assumes buttons are active (since uses GetComponent), so call after activating panel.
            for (int i = 0; i < instantiatedButtons.Count; i++)
            {
                var button     = instantiatedButtons[i].GetComponent <UnityUIResponseButton>().button;
                var above      = (i == 0) ? null : instantiatedButtons[i - 1].GetComponent <UnityUIResponseButton>().button;
                var below      = (i == instantiatedButtons.Count - 1) ? null : instantiatedButtons[i + 1].GetComponent <UnityUIResponseButton>().button;
                var navigation = new UnityEngine.UI.Navigation();

                navigation.mode          = UnityEngine.UI.Navigation.Mode.Explicit;
                navigation.selectOnUp    = above;
                navigation.selectOnLeft  = above;
                navigation.selectOnDown  = below;
                navigation.selectOnRight = below;
                button.navigation        = navigation;
            }
        }
Esempio n. 4
0
        static StackObject *set_navigation_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Navigation value = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.UI.Selectable instance_of_this_method;
            instance_of_this_method = (UnityEngine.UI.Selectable) typeof(UnityEngine.UI.Selectable).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.navigation = value;

            return(__ret);
        }
        static StackObject *get_mode_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.UI.Navigation instance_of_this_method = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.mode;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
        public override void OnEnter()
        {
            GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (_go != null)
            {
                _selectable = _go.GetComponent <UnityEngine.UI.Selectable>();
            }

            if (_selectable != null && resetOnExit.Value)
            {
                _originalState = _selectable.navigation;
            }

            DoSetValue();


            Finish();
        }
        public virtual void SetupTemplateButtonNavigation(bool hasDisabledButton)
        {
            // Assumes buttons are active (since uses GetComponent), so call after activating panel.
            if (instantiatedButtons == null || instantiatedButtons.Count == 0)
            {
                return;
            }
            var buttons = new List <GameObject>();

            if (hasDisabledButton)
            {
                // If some buttons are disabled, make a list of only the clickable ones:
                buttons.AddRange(instantiatedButtons.FindAll(x => x.GetComponent <StandardUIResponseButton>().isClickable));
            }
            else
            {
                buttons.AddRange(instantiatedButtons);
            }

            for (int i = 0; i < buttons.Count; i++)
            {
                var button = buttons[i].GetComponent <UnityEngine.UI.Button>();
                if (button == null)
                {
                    continue;
                }
                var above = (i == 0) ? (loopExplicitNavigation ? buttons[buttons.Count - 1].GetComponent <UnityEngine.UI.Button>() : null)
                    : buttons[i - 1].GetComponent <UnityEngine.UI.Button>();
                var below = (i == buttons.Count - 1) ? (loopExplicitNavigation ? buttons[0].GetComponent <UnityEngine.UI.Button>() : null)
                    : buttons[i + 1].GetComponent <UnityEngine.UI.Button>();
                var navigation = new UnityEngine.UI.Navigation();

                navigation.mode          = UnityEngine.UI.Navigation.Mode.Explicit;
                navigation.selectOnUp    = above;
                navigation.selectOnLeft  = above;
                navigation.selectOnDown  = below;
                navigation.selectOnRight = below;
                button.navigation        = navigation;
            }
        }
        static StackObject *set_selectOnRight_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Selectable @value = (UnityEngine.UI.Selectable) typeof(UnityEngine.UI.Selectable).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.UI.Navigation instance_of_this_method = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            instance_of_this_method.selectOnRight = value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }
        static StackObject *Equals_11(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.UI.Navigation other = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.UI.Navigation instance_of_this_method;
            instance_of_this_method = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.Equals(other);

            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method ? 1 : 0;
            return(__ret + 1);
        }
Esempio n. 10
0
        /** 初期化。
         */
        public void Initialize(InputField2D a_parent)
        {
            //raw
            this.raw_gameobject          = Fee.Instantiate.Instantiate.CreateUiInputField("InputField", Fee.Render2D.Render2D.GetInstance().GetRootTransform());
            this.raw_focus_monobehaviour = this.raw_gameobject.AddComponent <Fee.Ui.Focus_MonoBehaviour>();
            this.raw_transform           = this.raw_gameobject.GetComponent <UnityEngine.Transform>();
            this.raw_inputfield          = this.raw_gameobject.GetComponent <UnityEngine.UI.InputField>();
            this.raw_recttransform       = this.raw_gameobject.GetComponent <UnityEngine.RectTransform>();
            this.raw_text             = this.raw_inputfield.textComponent;
            this.raw_image            = this.raw_inputfield.image;
            this.raw_placeholder_text = this.raw_inputfield.placeholder.GetComponent <UnityEngine.UI.Text>();
            this.raw_gameobject.SetActive(false);

            {
                UnityEngine.UI.Navigation t_navigation = this.raw_inputfield.navigation;
                t_navigation.mode = UnityEngine.UI.Navigation.Mode.None;
                this.raw_inputfield.navigation = t_navigation;
            }

            //共通マテリアルアイテム複製。
            this.raw_custom_text_material_item  = Render2D.GetInstance().GetUiTextMaterialItem().DuplicateMaterialItem();
            this.raw_custom_image_material_item = Render2D.GetInstance().GetUiImageMaterialItem().DuplicateMaterialItem();
        }
        public virtual void SetupTemplateButtonNavigation()
        {
            // Assumes buttons are active (since uses GetComponent), so call after activating panel.
            if (instantiatedButtons == null || instantiatedButtons.Count == 0)
            {
                return;
            }
            for (int i = 0; i < instantiatedButtons.Count; i++)
            {
                var button = instantiatedButtons[i].GetComponent <StandardUIResponseButton>().button;
                var above  = (i == 0) ? (loopExplicitNavigation ? instantiatedButtons[instantiatedButtons.Count - 1].GetComponent <StandardUIResponseButton>().button : null)
                    : instantiatedButtons[i - 1].GetComponent <StandardUIResponseButton>().button;
                var below = (i == instantiatedButtons.Count - 1) ? (loopExplicitNavigation ? instantiatedButtons[0].GetComponent <StandardUIResponseButton>().button : null)
                    : instantiatedButtons[i + 1].GetComponent <StandardUIResponseButton>().button;
                var navigation = new UnityEngine.UI.Navigation();

                navigation.mode          = UnityEngine.UI.Navigation.Mode.Explicit;
                navigation.selectOnUp    = above;
                navigation.selectOnLeft  = above;
                navigation.selectOnDown  = below;
                navigation.selectOnRight = below;
                button.navigation        = navigation;
            }
        }
        static StackObject *get_selectOnRight_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.UI.Navigation instance_of_this_method = (UnityEngine.UI.Navigation) typeof(UnityEngine.UI.Navigation).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            var result_of_this_method = instance_of_this_method.selectOnRight;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);

            __intp.Free(ptr_of_this_method);
            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Esempio n. 13
0
 public Void UnityEngine.UI.Navigation::set_mode(UnityEngine.UI.Navigation / Mode)
        static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.UI.Navigation instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.UI.Navigation[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }