/// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.UI.VerticalLayoutGroup verticalLayoutGroup = (UnityEngine.UI.VerticalLayoutGroup)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "spacing":
                    verticalLayoutGroup.spacing = reader.ReadProperty <System.Single> ();
                    break;

                case "childForceExpandWidth":
                    verticalLayoutGroup.childForceExpandWidth = reader.ReadProperty <System.Boolean> ();
                    break;

                case "childForceExpandHeight":
                    verticalLayoutGroup.childForceExpandHeight = reader.ReadProperty <System.Boolean> ();
                    break;

                case "childControlWidth":
                    verticalLayoutGroup.childControlWidth = reader.ReadProperty <System.Boolean> ();
                    break;

                case "childControlHeight":
                    verticalLayoutGroup.childControlHeight = reader.ReadProperty <System.Boolean> ();
                    break;

                case "padding":
                    verticalLayoutGroup.padding = reader.ReadProperty <UnityEngine.RectOffset> ();
                    break;

                case "childAlignment":
                    verticalLayoutGroup.childAlignment = reader.ReadProperty <UnityEngine.TextAnchor> ();
                    break;

                case "useGUILayout":
                    verticalLayoutGroup.useGUILayout = reader.ReadProperty <System.Boolean> ();
                    break;

                case "enabled":
                    verticalLayoutGroup.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    verticalLayoutGroup.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    verticalLayoutGroup.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    verticalLayoutGroup.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
Exemple #2
0
        UniRx.IObservable <bool> InitRecommand(ulong current, UnityEngine.UI.VerticalLayoutGroup inst)
        {
            var obj   = DC.CNetwork.s.platform.context.local_db.Get("confirm_color") as Newtonsoft.Json.Linq.JObject;
            var vec   = Sas.SasUtil.CovertTxtToVec4((string)obj ["value"]);
            var color = new Color(vec.x, vec.y, vec.z, vec.w);

            var likes   = inst.transform.FindDST(child => child.name == "likes");
            var unlikes = inst.transform.FindDST(child => child.name == "unlikes");

            return(Sas.SasUtil.StartRx()
                   .SelectMany(_ => {
                return UniRx.Observable.Range(1, 2).Select(i => {
                    switch (i)
                    {
                    case 1:
                        return likes.GetComponent <UnityEngine.UI.Button> ()
                        .OnClickAsOptional()
                        .Select(__ => {
                            likes.GetComponent <UnityEngine.UI.Image> ().color = color;

                            return i;
                        });

                    case 2:
                        return unlikes.GetComponent <UnityEngine.UI.Button> ()
                        .OnClickAsOptional()
                        .Select(__ => {
                            unlikes.GetComponent <UnityEngine.UI.Image> ().color = color;

                            return i;
                        });
                    }
                    return Sas.SasUtil.StartRx();
                })
                .SelectMany(exce => exce)
                .SelectMany(i => {
                    likes.GetComponent <UnityEngine.UI.Button> ().enabled = false;
                    unlikes.GetComponent <UnityEngine.UI.Button> ().enabled = false;

                    return DC.CNetwork.s.chatti.Likes(current, i == 1)
                    .Catch <bool, System.Exception> (err => {
                        var serr = err as Sas.Exception;
                        if (serr == null || serr.code != Sas.ERRNO.ALREADY_SETTED.ToErrCode())
                        {
                            likes.GetComponent <UnityEngine.UI.Button> ().enabled = true;
                            unlikes.GetComponent <UnityEngine.UI.Button> ().enabled = true;
                            var src = (i == 1 ? unlikes : likes);
                            var dst = (i == 1 ? likes : unlikes);
                            dst.GetComponent <UnityEngine.UI.Image> ().color = src.GetComponent <UnityEngine.UI.Image> ().color;
                        }

                        return InitRecommand(current, inst);
                    });
                });
            }));
        }
        static StackObject *SetLayoutVertical_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.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);
            UnityEngine.UI.VerticalLayoutGroup instance_of_this_method = (UnityEngine.UI.VerticalLayoutGroup) typeof(UnityEngine.UI.VerticalLayoutGroup).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetLayoutVertical();

            return(__ret);
        }
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.UI.VerticalLayoutGroup verticalLayoutGroup = (UnityEngine.UI.VerticalLayoutGroup)value;
     writer.WriteProperty("spacing", verticalLayoutGroup.spacing);
     writer.WriteProperty("childForceExpandWidth", verticalLayoutGroup.childForceExpandWidth);
     writer.WriteProperty("childForceExpandHeight", verticalLayoutGroup.childForceExpandHeight);
     writer.WriteProperty("childControlWidth", verticalLayoutGroup.childControlWidth);
     writer.WriteProperty("childControlHeight", verticalLayoutGroup.childControlHeight);
     writer.WriteProperty("padding", verticalLayoutGroup.padding);
     writer.WriteProperty("childAlignment", verticalLayoutGroup.childAlignment);
     writer.WriteProperty("useGUILayout", verticalLayoutGroup.useGUILayout);
     writer.WriteProperty("enabled", verticalLayoutGroup.enabled);
     writer.WriteProperty("tag", verticalLayoutGroup.tag);
     writer.WriteProperty("name", verticalLayoutGroup.name);
     writer.WriteProperty("hideFlags", verticalLayoutGroup.hideFlags);
 }
        static int _m_SetLayoutHorizontal(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.UI.VerticalLayoutGroup __cl_gen_to_be_invoked = (UnityEngine.UI.VerticalLayoutGroup)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.SetLayoutHorizontal(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_CalculateLayoutInputVertical(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.UI.VerticalLayoutGroup gen_to_be_invoked = (UnityEngine.UI.VerticalLayoutGroup)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.CalculateLayoutInputVertical(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.UI.VerticalLayoutGroup verticalLayoutGroup = SaveGameType.CreateComponent <UnityEngine.UI.VerticalLayoutGroup> ();
     ReadInto(verticalLayoutGroup, reader);
     return(verticalLayoutGroup);
 }