Esempio n. 1
0
        public void OnClickNext()
        {
            long curr = Utils.GetTimestampSeconds();

#if UNITY_EDITOR
            if (long.TryParse(input.text, out uuid_override))
            {
            }
            else
            {
                uuid_override = 0;
            }
            curr += 5;
#else
            uuid_override = 0;
#endif
            if (curr - last_click_time > 2)
            {
                last_click_time = curr;
            }
            else
            {
                UIPopMsg.Show("请勿点击过快!");

                return;
            }
            HasLike = false;
            MapGalleryRunner.kv_cache    = null;
            MapGalleryRunner.just_reload = false;

            SceneMgr.LoadLevel("MapGallery");
        }
Esempio n. 2
0
        public bool IsExceedMaxObjectCount(int curSelectId)
        {
#if UNITY_EDITOR
            const int MAX_NUM      = 9999;
            const int GRID_MAX_NUM = 9999;
#else
            int MAX_NUM      = DevConfig.MapEditorMaxAllowMapObjectNumber;
            int GRID_MAX_NUM = DevConfig.MapEditorMaxAllowGridMapObjectNumber;
#endif

            if (MapObjectRoot.ins.IsGridObjectById(curSelectId))
            {
                if (MapObjectRoot.ins.GetGridMapObjectCount() >= GRID_MAX_NUM)
                {
                    UIPopMsg.Show("地形刷组件数量达到上限!");

                    return(true);
                }
            }
            else
            {
                if (MapObjectRoot.ins.GetNormalMapObjectCount() >= MAX_NUM)
                {
                    UIPopMsg.Show("组件数量达到上限!");

                    return(true);
                }
            }

            return(false);
        }
Esempio n. 3
0
        public void OnClickLike()
        {
            //disable
            return;

            if (MapGalleryRunner.kv_cache != null && HasLike == false)
            {
                if (MapGalleryRunner.kv_cache.Get("ret") == "ok")
                {
                    string uuid = MapGalleryRunner.kv_cache.Get("uuid");
                    if (!string.IsNullOrEmpty(uuid))
                    {
                        RpcClient.ins.SendRequest("rpc", "map_info_like", "uuid:" + uuid + ",", (RpcRespone ss) =>
                        {
                            if (ss != null && ss.ok)
                            {
                                //TODO play animation
                                HasLike = true;
                                Debug.Log(ss.protocol.json);

                                var kv = Json.Decode(ss.protocol.json);
                                if (kv != null && kv.Get("ret") == "ok")
                                {
                                    MapGalleryRunner.kv_cache = kv;
                                    this.Sync(kv.GetLong("like"));

                                    if (UITips.ins != null)
                                    {
                                        // UITips.ins.ShowTips("+1");
                                    }
                                    UIPopMsg.Show("点赞成功");
                                    var part = like_part.GetComponentInChildren <ParticleSystem>();
                                    if (part != null)
                                    {
                                        part.Play();
                                    }
                                }
                            }
                        });
                    }
                }
            }
            if (HasLike)
            {
                UIPopMsg.Show("请勿重复点赞!");
            }
        }