public void createMon(Variant m) { int monid = m["mid"]._int; uint iid = m["iid"]._uint; // debug.Log("!!createMon!! monid:" + monid + " " + iid + " " + debug.count); Variant b = MonsterConfig.instance.conf; Variant mconf = b["monsters"][monid + ""]; if (mconf == null) { GameTools.PrintError(" mon[ " + monid + " ] no conf ERR!"); return; } m["x"] = m["x"] / GameConstant.PIXEL_TRANS_UNITYPOS; m["y"] = m["y"] / GameConstant.PIXEL_TRANS_UNITYPOS; LGAvatarMonster ct = new LGAvatarMonster(this.g_mgr); _mons[iid] = ct; //if( info.ContainsKey( "owner_cid" ) ) //{ // GameTools.PrintNotice("mon todo owner_cid!"); //} //if( info.ContainsKey("moving") ) //{ // GameTools.PrintNotice("mon todo moving!"); //} //if( info.ContainsKey( "atking" ) ) //{ // GameTools.PrintNotice("mon todo atking!"); //} //if( info.ContainsKey( "states" ) ) //{ // GameTools.PrintNotice("mon todo states!"); //} ct.initData(m); ct.init(); this.g_mgr.g_processM.addRender(ct); // GameRoomMgr.getInstance().onMonsterEnterView(ct.grAvatar); }
public void createMon(Variant m) { int @int = m["mid"]._int; uint @uint = m["iid"]._uint; Variant conf = MonsterConfig.instance.conf; Variant variant = conf["monsters"][string.Concat(@int)]; bool flag = variant == null; if (flag) { GameTools.PrintError(" mon[ " + @int + " ] no conf ERR!"); } else { m["x"] = m["x"] / 53.333f; m["y"] = m["y"] / 53.333f; LGAvatarMonster lGAvatarMonster = new LGAvatarMonster(this.g_mgr); this._mons[@uint] = lGAvatarMonster; lGAvatarMonster.initData(m); lGAvatarMonster.init(); this.g_mgr.g_processM.addRender(lGAvatarMonster, false); } }