private void SetUp() { string str = string.Empty; if (this.Type == AwardItem.PlayerType.Player) { PlayerData dataOfClass = DataSource.FindDataOfClass <PlayerData>(((Component)this).get_gameObject(), (PlayerData)null); if (dataOfClass != null) { str = dataOfClass.SelectedAward; } } else if (this.Type == AwardItem.PlayerType.Friend) { FriendData dataOfClass = DataSource.FindDataOfClass <FriendData>(((Component)this).get_gameObject(), (FriendData)null); if (dataOfClass != null) { str = dataOfClass.SelectAward; } } else if (this.Type == AwardItem.PlayerType.ArenaPlayer) { ArenaPlayer dataOfClass = DataSource.FindDataOfClass <ArenaPlayer>(((Component)this).get_gameObject(), (ArenaPlayer)null); if (dataOfClass != null) { str = dataOfClass.SelectAward; } } else if (this.Type == AwardItem.PlayerType.MultiPlayer) { JSON_MyPhotonPlayerParam dataOfClass = DataSource.FindDataOfClass <JSON_MyPhotonPlayerParam>(((Component)this).get_gameObject(), (JSON_MyPhotonPlayerParam)null); if (dataOfClass != null) { str = dataOfClass.award; } } else if (this.Type == AwardItem.PlayerType.ChatPlayer) { ChatPlayerData dataOfClass = DataSource.FindDataOfClass <ChatPlayerData>(((Component)this).get_gameObject(), (ChatPlayerData)null); if (dataOfClass != null) { str = dataOfClass.award; } } this.mSelectedAward = str; if (!string.IsNullOrEmpty(this.mSelectedAward)) { AwardParam awardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAwardParam(this.mSelectedAward); if (awardParam != null) { this.mAwardParam = awardParam; } } else { this.mAwardParam = (AwardParam)null; } this.IsDone = true; }
private void DummyUserData() { this.mPlayer = new ChatPlayerData(); this.mPlayer.exp = 10000; this.mPlayer.name = "TestMan"; this.mPlayer.lv = 10; this.mPlayer.lastlogin = 0L; this.mPlayer.unit = MonoSingleton <GameManager> .Instance.Player.Units[0]; }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { Network.EErrCode errCode = Network.ErrCode; } else { WebAPI.JSON_BodyResponse <JSON_ChatPlayerData> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <JSON_ChatPlayerData> >(www.text); DebugUtility.Assert(jsonObject != null, "res == null"); Network.RemoveAPI(); ChatPlayerData chatPlayerData = new ChatPlayerData(); chatPlayerData.Deserialize(jsonObject.body); if (Object.op_Inequality((Object)this.window, (Object)null)) { this.window.Player = chatPlayerData; } this.Success(); } }
public void SetChatPlayerData(ChatPlayerData data) { this.m_ChatPlayerData = data; this.m_ValueList.SetField("fuid", data.fuid); }