private void InitRigester() { SoundManager.inst.Register(this.gameObject); MicroManager.inst.Register(this.gameObject); DispatchManager.inst.Register(MainEvent.RESTART_GAME, RESTART_GAME); DispatchManager.inst.Register(MainEvent.RELOGIN_GAME, RELOGIN_GAME); DispatchManager.inst.Register(MainEvent.SHOW_USER, SHOW_USER); DispatchManager.inst.Register(MainEvent.SOCKET_ERROR, SOCKET_ERROR); DispatchManager.inst.Register(MainEvent.FIGHT_RESULT, FIGHT_RESULT); DispatchManager.inst.Register(MainEvent.START_FIGHT, START_FIGHT); DispatchManager.inst.Register(MainEvent.CLOSE_FIGHT, CLOSE_FIGHT); DispatchManager.inst.Register(MainEvent.FIGHT_INIT_COMPLETE, FIGHT_INIT_COMPLETE); DispatchManager.inst.Register(MainEvent.FIGHT_QUIT, FIGHT_QUIT); DispatchManager.inst.Register(MainEvent.FIGHT_ING, FIGHT_ING); DispatchManager.inst.Register(MainEvent.SHOW_FIGHTDETAIL, SHOW_FIGHTDETAIL); DispatchManager.inst.Register(MainEvent.SOCKET_CLOSE, SOCKET_CLOSE); userModel = ModelManager.inst.userModel; roleModel = ModelManager.inst.roleModel; chatModel = ModelManager.inst.chatModel; guildModel = ModelManager.inst.guildModel; fightModel = ModelManager.inst.fightModel; shareModel = ModelManager.inst.shareModel; gameModel.width = GRoot.inst.width; gameModel.height = GRoot.inst.height; this.initQueue.Next(); }
// Use this for initialization public override void Init() { base.Init(); Create(Config.VIEW_SHAREBTN); userModel = ModelManager.inst.userModel; shareModel = ModelManager.inst.shareModel; this.y = shareModel.viewY; weiXinId = DataManager.inst.systemSimple[DataManager.SHARE_WEIXIN_ID].ToString(); weiBoId = DataManager.inst.systemSimple[DataManager.SHARE_WEIBO_ID].ToString(); weiBoContent = DataManager.inst.systemSimple[DataManager.SHARE_WEIBO_CONTENT].ToString(); weiBoUrl = DataManager.inst.systemSimple[DataManager.SHARE_WEIBO_URL].ToString(); weiBoCallBack = DataManager.inst.systemSimple[DataManager.SHARE_WEIBO_CALLBACK].ToString(); qqId = DataManager.inst.systemSimple[DataManager.SHARE_QQ_ID].ToString(); qqURL = DataManager.inst.systemSimple[DataManager.SHARE_QQ_URL].ToString(); qqTitle = DataManager.inst.systemSimple[DataManager.SHARE_QQ_TITLE].ToString(); qqDes = DataManager.inst.systemSimple[DataManager.SHARE_QQ_DES].ToString(); friendLike = (Dictionary <string, object>)DataManager.inst.systemSimple["share"]; shareIcon = (object[])DataManager.inst.systemSimple["share_icon"]; iconImageStr = shareModel.shareImageIcon; list = this.GetChild("n1").asList; GImage imag1 = this.GetChild("n2").asImage; GImage imag2 = this.GetChild("n3").asImage; GTextField t1 = this.GetChild("n32").asTextField; t1.text = Tools.GetMessageById("19439"); if (shareModel.isShareRed(2)) { t1.visible = true; } if (shareModel.type == ModelShare.SHARE_FREIND) { this.x = shareModel.viewX; imag1.visible = true; imag2.visible = false; } else { imag1.visible = false; imag2.visible = true; } // list.fairyBatching = true; list.itemRenderer = OnRendere; list.numItems = shareIcon.Length; // AddGlobalListener(MainEvent.SHARE_DATA_EVENT, onSHARE_DATA_EVENT); }
private void InitData() { userModel = ModelManager.inst.userModel; shareModel = ModelManager.inst.shareModel; sumClick = (int)((Dictionary <string, object>)userModel.records["share_data"])["sum_n"]; //被点击的总数 sumShare = (int)((Dictionary <string, object>)userModel.records["share_data"])["sum_num"]; //分享出去的总次数 todaySumClick = userModel.ipList; //今日被点击的数 todaySumShare = (int)((Dictionary <string, object>)userModel.records["share_data"])["succ_times"]; //分享出去的次数 weekClike = (int)((Dictionary <string, object>)userModel.records["share_data"])["week_n"]; timeNewClick = (DateTime)((Dictionary <string, object>)userModel.records["share_data"])["t"]; timeNewShare = (DateTime)((Dictionary <string, object>)userModel.records["share_data"])["succ_time"]; qrType = "**%%_%%**"; Dictionary <string, object> dd = (Dictionary <string, object>)DataManager.inst.systemSimple["weixin_gift"]; string shareM = dd["key"].ToString(); string md5Result = userModel.uid + shareM + string.Format("{0:s}", ModelManager.inst.gameModel.time).Split('T')[0]; string byte2String = Tools.MD5(md5Result); Debug.Log(byte2String); shareUrl = DataManager.inst.systemSimple["share_url"].ToString() + userModel.uid + "&code=" + byte2String; shareUrl_ = DataManager.inst.systemSimple["share_url_"].ToString() + userModel.uid + "&code=" + byte2String; baseUrl = DataManager.inst.systemSimple["share_base_url"].ToString(); share = (Dictionary <string, object>)DataManager.inst.systemSimple["share"]; isUid = userModel.records["invite_uid"] + ""; qrCode_str = LocalStore.GetLocal(LocalStore.LOCAL_QRCODE + userModel.uid); Dictionary <string, object> inviteList = (Dictionary <string, object>)share["invite"]; List <object> arr1 = Tools.ConvertDicToList(inviteList, "name"); Tools.Sort(arr1, new string[] { "name:int:0" }); data = new List <object>(); foreach (object v in arr1) { string name = ((Dictionary <string, object>)v)["name"].ToString(); string value = ((Dictionary <string, object>)v)[name].ToString(); data.Add(name); data.Add(value); } yaoQingText = Tools.GetMessageById("19441", new string[] { data[0] + "", data[1] + "", data[2] + "", data[3] + "", data[4] + "", data[5] + "", }); clickNum = (int)(((object[])share["share2"])[0]); clickGetCoin = (int)(((object[])share["share2"])[1]); WeekClickNum = (int)(((object[])share["share2"])[2]); shareNum = (int)(((object[])share["share1"])[0]); shareGetCoin = (int)(((object[])share["share1"])[1]); }
public void Register() { gameModel = new ModelGame(); alertModel = new ModelAlert(); userModel = new ModelUser(); roleModel = new ModelRole(); guildModel = new ModelGuild(); chatModel = new ModelChat(); cardModel = new ModelCard(); mailModel = new ModelMail(); fightModel = new ModelFight(); rankModel = new ModelRank(); guideModel = new ModelGuide(); shareModel = new ModelShare(); }
/*- fightModel.fightData Count=7 System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] * - ["gifts"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["el_score"] 400 System.Collections.DictionaryEntry + ["card"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["gold"] 12 System.Collections.DictionaryEntry + - ["result"] System.Object[8] System.Collections.DictionaryEntry + - [0] System.Object[3] System.Object + [0] 1267 System.Object + - [1] System.Object[6] System.Object + [0] 1209 System.Object + [1] 7 System.Object + [2] 1 System.Object + [3] 998 System.Object + [4] 21 System.Object + [5] 8 System.Object + - [2] Count=15 System.Object + ["head"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["guild_id"] null System.Collections.DictionaryEntry + ["uid"] 1267 System.Collections.DictionaryEntry + ["is_friend"] false System.Collections.DictionaryEntry + ["name"] null System.Collections.DictionaryEntry + ["dis"] null System.Collections.DictionaryEntry + ["is_mvp"] false System.Collections.DictionaryEntry + ["effort_lv"] 1 System.Collections.DictionaryEntry + ["guild_name"] null System.Collections.DictionaryEntry + ["lv"] 1 System.Collections.DictionaryEntry + ["state"] 1 System.Collections.DictionaryEntry + ["rank_score"] 52 System.Collections.DictionaryEntry + ["sex"] "f" System.Collections.DictionaryEntry + ["rank_lv"] "1" System.Collections.DictionaryEntry + ["is_leader"] 1 System.Collections.DictionaryEntry + [1] System.Object[3] System.Object + [2] System.Object[3] System.Object + [3] System.Object[3] System.Object + [4] System.Object[3] System.Object + [5] System.Object[3] System.Object + [6] System.Object[3] System.Object + [7] System.Object[3] System.Object + - ["user"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["el_score"] 300 System.Collections.DictionaryEntry + ["gold"] 10040 System.Collections.DictionaryEntry + ["lv"] 1 System.Collections.DictionaryEntry + ["records"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["exp"] 0 System.Collections.DictionaryEntry + ["coin"] 100 System.Collections.DictionaryEntry + ["card"] {System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]} System.Collections.DictionaryEntry + ["rank_score"] 81 System.Collections.DictionaryEntry + - ["battle_result"] 1 System.Collections.DictionaryEntry + Key "battle_result" System.String + Value 1 System.Int32 + - ["my_data"] System.Object[6] System.Collections.DictionaryEntry + - [0] System.Object[3] System.Object + [0] 1209 System.Object + [1] 1209 System.Object + [2] 1 System.Object + [1] System.Object[3] System.Object + [2] System.Object[3] System.Object + [3] System.Object[3] System.Object + [4] System.Object[3] System.Object + [5] System.Object[3] System.Object + - ["award_id"] "rank_win" System.Collections.DictionaryEntry + - ["statementType"] "match_Team" System.Collections.DictionaryEntry */ public override void Init() { base.Init(); fightDataTypeChange = new List <int>(); for (int i = 0; i < 5; i++) { fightDataTypeChange.Add(i); } userModel = ModelManager.inst.userModel; roleModel = ModelManager.inst.roleModel; fightModel = ModelManager.inst.fightModel; shareModel = ModelManager.inst.shareModel; statementType = (string)fightModel.fightData["statementType"]; if (statementType.Equals(ModelFight.FIGHT_MATCHTEAM)) { Create(Config.SCENE_FIGTHTDATA2); } else { Create(Config.SCENE_FIGTHTDATA); } btnBgUp = "n_btn_5"; btnBgDo = "n_btn_6"; textAttention = "13013"; textAttentiond = "13018"; textBtnColor = "FFFFFF"; textBtnStrokeColor = "#B266E0"; textShield = "13016"; textShieldd = "13032"; fontSize = ""; FindObject(); InitData(); }
public override void Init() { GRoot.inst.touchable = false; base.Init(); this.Create(Config.VIEW_AD); // fightData = this.GetChild("n0").asImage; ad = this.GetChild("n10").asImage; isFight = (typeAd == ModelShare.SHARE_FIGHT); ad.visible = !isFight; // killAll = this.GetChild("n3").asTextField; killPass = this.GetChild("n4").asTextField; hertAll = this.GetChild("n5").asTextField; score = this.GetChild("n6").asTextField; name = this.GetChild("n7").asTextField; QRcode = this.GetChild("n8").asLoader; // // GameObject cutCamera = new GameObject(); cutCamera.name = "cutCamera"; Vector3 mCa = StageCamera.main.transform.localPosition; camera = cutCamera.AddComponent <Camera> (); camera.clearFlags = CameraClearFlags.SolidColor; camera.farClipPlane = StageCamera.main.farClipPlane; camera.nearClipPlane = StageCamera.main.nearClipPlane; camera.orthographic = true; camera.depth = StageCamera.main.depth - 1; camera.orthographicSize = StageCamera.main.orthographicSize; camera.backgroundColor = Color.white; camera.transform.localPosition = new Vector3(-mCa.x, mCa.y, 0); camera.useOcclusionCulling = false; // float nw = (this.width / this.height) * GRoot.inst.height; this.height = GRoot.inst.height; this.width = nw; // this.group.x = -(GRoot.inst.width * 0.5f) - (this.width * 0.5f); this.group.y = 0; // Debug.LogError(":: >> "+this.view.width+" | "+this.view.actualWidth+" | "+this.view.viewWidth + " | "+GRoot.inst.scale.y.ToString()); // userModel = ModelManager.inst.userModel; shareModel = ModelManager.inst.shareModel; fightModel = ModelManager.inst.fightModel; // if (isFight) { object[] arr = (object[])fightModel.fightData["my_data"]; bool isNotCustom = false; if (arr [0] is object[]) { isNotCustom = true; } // Debug.Log (isNotCustom); if (isNotCustom) { score.text = ((object[])arr [0]) [0] + ""; killAll.text = ((object[])arr [1]) [0] + ""; killPass.text = ((object[])arr [2]) [0] + ""; hertAll.text = ((object[])arr [3]) [0] + ""; } else { score.text = (arr [0]) + ""; killAll.text = (arr [1]) + ""; killPass.text = (arr [2]) + ""; hertAll.text = (arr [3]) + ""; } name.text = userModel.GetUName(); } // shareUrl = DataManager.inst.systemSimple["share_url"] + userModel.uid; // string qr = LocalStore.GetLocal(LocalStore.LOCAL_QRCODE + userModel.uid); if (qr != "" && qr != null && qr.Length > 0) { QRcode.texture = new NTexture(PhoneManager.inst.Base64ToTexter2d(qr, 150, 150)); CutBitmap(); } else { LoaderManager.inst.Load(shareUrl + ".jpg", (object w) => { if (this.group == null || this.parent == null) { GRoot.inst.touchable = true; return; } Texture2D topImage = (Texture2D)w; if (w != null && w != null && QRcode != null) { if (this.group == null) { return; } QRcode.texture = new NTexture(topImage); // Log.debug("topImage:"+topImage); // Log.debug("erBg"+erBg); LocalStore.SetLocal(LocalStore.LOCAL_QRCODE + userModel.uid, Convert.ToBase64String(topImage.EncodeToJPG())); // share_bitmap = ComposeImage(baseImage, topImage); CutBitmap(); } }, (object error) => { GRoot.inst.touchable = true; }); } }