public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(IDKey, out _ID); dict.TryGetInt(MagazineSizeKey, out _MagazineSize); dict.TryGetInt(ConsumePerHitKey, out _ConsumePerHit); dict.TryGetInt(DamageValKey, out _DamageVal); dict.TryGetFloat(AtkIntervalKey, out _AtkInterval); dict.TryGetFloat(ChargeTimeKey, out _ChargeTime); dict.TryGetFloat(ReloadTimeKey, out _ReloadTime); dict.TryGetFloat(ThrustKey, out _Thrust); dict.TryGetFloat(AlertRangeKey, out _AlertRange); dict.TryGetString(PrefabPathKey, out _PrefabPath); dict.TryGetString(SkinNameKey, out _SkinName); string customDataKey; dict.TryGetString(OpaTypeKey, out customDataKey); _OpaType = new GDEEnum_OpaTypeData(customDataKey); dict.TryGetString(AniTypeKey, out customDataKey); _AniType = new GDEEnum_WeaponAniTypeData(customDataKey); LoadFromSavedData(dataKey); } }
public void SyncKey(Dictionary <string, object> data) { int serverFrameCount = 0; serverFrameCount = data.TryGetInt("framecount"); GameData.m_GameFrame = serverFrameCount; //补帧逻辑,后续添加 //if (serverFrameCount >= GameData.m_GameFrame) //{ FrameKeyData frameKeyData = new FrameKeyData(); frameKeyData.m_KeyDataList = new List <KeyData>(); frameKeyData.m_FrameCount = serverFrameCount; GameData.m_OperationEventList.Add(frameKeyData); if (data["keydatalist"] == null) { return; } object[] keydataArray = data["keydatalist"] as object[]; for (int i = 0; i < keydataArray.Length; i++) { Dictionary <string, object> keydata = keydataArray[i] as Dictionary <string, object>; KeyData m_KeyData = new KeyData(); m_KeyData.m_RoleId = keydata.TryGetInt("m_RoleId"); m_KeyData.m_Cmd = keydata.TryGetInt("m_Cmd"); m_KeyData.m_Parameter = keydata.TryGetString("m_Parameter"); frameKeyData.m_KeyDataList.Add(m_KeyData); m_BattleLogicManager.OnOperation(m_KeyData); LogMsg(string.Format("收到操作:{0},参数:{1},帧数:{2}", m_KeyData.m_Cmd.ToString(), m_KeyData.m_Parameter, GameData.m_GameFrame)); } //GameData.m_GameFrame += 1; //} }
/// <summary> /// 匹配游戏成功 /// </summary> /// <param name="data"></param> public void MatchGameSuccess(Dictionary <string, object> data) { int result = data.TryGetInt("ret"); if (result != 0) { return; } string matchKey = data.TryGetString("matchKey"); GameData.m_CampId = (CampType)data.TryGetInt("teamId"); GameData.m_MatchPos = data.TryGetInt("pos"); GameData.m_MatchKey = matchKey; if (!data.ContainsKey("teamInfo")) { return; } object[] teamInfoArray = data["teamInfo"] as object[]; List <MatchPlayerData> matchPlayerList = new List <MatchPlayerData>(); for (int i = 0; i < teamInfoArray.Length; i++) { Dictionary <string, object> keydata = teamInfoArray[i] as Dictionary <string, object>; MatchPlayerData matchPlayer = new MatchPlayerData(); matchPlayer.m_CampId = keydata.TryGetInt("teamId"); matchPlayer.m_Pos = keydata.TryGetInt("pos"); matchPlayerList.Add(matchPlayer); } m_UIManager.m_UpdateMatchSuccessUICallback(); }
/// <summary> /// 点亮匹配头像 /// </summary> /// <param name="data"></param> public void JoinMatchRoomInPos(Dictionary <string, object> data) { int campId = data.TryGetInt("teamId"); int pos = data.TryGetInt("pos"); GameData.m_GameManager.m_UIManager.m_UpdateSelectHeroConfirmMatchUI(campId, pos); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(lockedKey, out _locked); dict.TryGetInt(HashcodeKey, out _Hashcode); dict.TryGetInt(posInOwnerKey, out _posInOwner); dict.TryGetInt(qualityKey, out _quality); dict.TryGetInt(starKey, out _star); dict.TryGetInt(levelKey, out _level); dict.TryGetFloat(initalQualityKey, out _initalQuality); dict.TryGetString(idKey, out _id); dict.TryGetString(ownerIdKey, out _ownerId); string customDataKey; dict.TryGetString(attitubeKey, out customDataKey); _attitube = new GDEgoddessAttiData(customDataKey); LoadFromSavedData(dataKey); } }
// // Constructor that takes the data returned by the // GDEDataManager.Get() method and will now pull out the // individual fields using the TryGet() methods. // public Buff(Dictionary <string, object> data) { if (data != null) { data.TryGetString("name", out Name); data.TryGetInt("hp_delta", out HPDelta); data.TryGetInt("mana_delta", out ManaDelta); data.TryGetInt("damage_delta", out DamageDelta); } }
// // Constructor that takes the data returned by the // GDEDataManager.Get() method and will now pull out the // individual fields using the TryGet() methods. // public Buff(Dictionary<string, object> data) { if (data != null) { data.TryGetString("name", out Name); data.TryGetInt("hp_delta", out HPDelta); data.TryGetInt("mana_delta", out ManaDelta); data.TryGetInt("damage_delta", out DamageDelta); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(starKey, out _star); dict.TryGetInt(volumeKey, out _volume); dict.TryGetInt(expKey, out _exp); dict.TryGetInt(rune0Key, out _rune0); dict.TryGetInt(rune1Key, out _rune1); dict.TryGetInt(rune2Key, out _rune2); dict.TryGetInt(rune3Key, out _rune3); dict.TryGetInt(indexKey, out _index); dict.TryGetInt(skillGradeKey, out _skillGrade); dict.TryGetString(idKey, out _id); dict.TryGetString(NAMEKey, out _NAME); string customDataKey; dict.TryGetString(attitubeKey, out customDataKey); _attitube = new GDEgoddessAttiData(customDataKey); dict.TryGetIntList(UseTeamIdKey, out UseTeamId); LoadFromSavedData(dataKey); } }
public override void ParseJson(object jd) { Dictionary <string, object> item = (Dictionary <string, object>)jd; released = item.TryGetInt("released"); if (released == 1) { skinId = item.TryGetLong("skin_id"); grade = item.TryGetString("grade"); commodity_id = item.TryGetInt("commodity_id"); skin_cardId = item.TryGetLong("skin_card"); heroId = item.TryGetLong("hero_id"); skinName = item.TryGetString("name"); iconAtlas = item.TryGetString("icon_atlas"); head_icon_atlas = item.TryGetString("head_icon_atlas"); skinCard = item.TryGetString("original_painting"); modelId = item.TryGetInt("model"); modelNode = FSDataNodeTable <ModelNode> .GetSingleton().FindDataByType(modelId); path = item.TryGetString("path"); deathSound = item.TryGetString("death_sound"); if (item.ContainsKey("hit_sound")) { hitSound = item["hit_sound"].ToString(); } if (item.ContainsKey("dlgAmount")) { dlgAmount = item.TryGetInt("dlgAmount"); } if (item.ContainsKey("icon_name")) { iconName = item["icon_name"].ToString(); } if (item.ContainsKey("type")) { type = item.TryGetInt("type"); } if (item.ContainsKey("property")) { property = item.TryGetFloat("property"); } if (item.ContainsKey("price")) { price = item["price"] as int[]; } if (item.ContainsKey("effectName")) { effectName = item["effectName"] == null ? null : item["effectName"].ToString(); } } }
// // Constructor that takes the data returned by the // GDEDataManager.Get() method and will now pull out the // individual fields using the TryGet() methods. // public Character(Dictionary <string, object> data) { if (data != null) { // Pull out the individual fields and load our Character stats. data.TryGetString("name", out Name); data.TryGetInt("hp", out baseHP); data.TryGetInt("mana", out baseMana); data.TryGetInt("damage", out baseDamage); // // Get the Buff list // // First get a string list of the buffs using TryGetStringList List <string> buffKeyList; if (data.TryGetStringList("buffs", out buffKeyList)) { // // Spin through each of the Buff names and pull out // the data with the GDEDataManager.Get() method. // Buffs = new List <Buff>(); foreach (string buffKey in buffKeyList) { // // Pull out Buff data with Get() method and pass // it down to the Buff classes constructor where // it will pull out the individual fields and set // it's properties. // Buff curBuff; Dictionary <string, object> curBuffData; GDEDataManager.Instance.Get(buffKey, out curBuffData); // // For each Buff in the string list create a new // object passing it the data from the Get() // method and add it to the Buff's list. // curBuff = new Buff(curBuffData); Buffs.Add(curBuff); // // Now that the Buff's properties have been set // from the data in the Buff's constructor add the // bonuses to the HP, Mana, and Damage. // bonusHP += curBuff.HPDelta; bonusMana += curBuff.ManaDelta; bonusDamage += curBuff.DamageDelta; } } } }
// // Constructor that takes the data returned by the // GDEDataManager.Get() method and will now pull out the // individual fields using the TryGet() methods. // public Character(Dictionary<string, object> data) { if (data != null) { // Pull out the individual fields and load our Character stats. data.TryGetString("name", out Name); data.TryGetInt("hp", out baseHP); data.TryGetInt("mana", out baseMana); data.TryGetInt("damage", out baseDamage); // // Get the Buff list // // First get a string list of the buffs using TryGetStringList List<string> buffKeyList; if (data.TryGetStringList("buffs", out buffKeyList)) { // // Spin through each of the Buff names and pull out // the data with the GDEDataManager.Get() method. // Buffs = new List<Buff>(); foreach(string buffKey in buffKeyList) { // // Pull out Buff data with Get() method and pass // it down to the Buff classes constructor where // it will pull out the individual fields and set // it's properties. // Buff curBuff; Dictionary<string, object> curBuffData; GDEDataManager.Instance.Get(buffKey, out curBuffData); // // For each Buff in the string list create a new // object passing it the data from the Get() // method and add it to the Buff's list. // curBuff = new Buff(curBuffData); Buffs.Add(curBuff); // // Now that the Buff's properties have been set // from the data in the Buff's constructor add the // bonuses to the HP, Mana, and Damage. // bonusHP += curBuff.HPDelta; bonusMana += curBuff.ManaDelta; bonusDamage += curBuff.DamageDelta; } } } }
/// <summary> /// 登录游戏 /// </summary> /// <param name="data"></param> public void LoginGame(Dictionary <string, object> data) { int result = data.TryGetInt("ret"); int playerId = data.TryGetInt("playerId"); GameData.m_CurrentRoleId = playerId; if (result != 0) { return; } m_UIManager.m_UpdateMatchUICallback(); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(isMusicOnKey, out _isMusicOn); dict.TryGetBool(isSoundEffectOnKey, out _isSoundEffectOn); dict.TryGetBool(isAutoBattleKey, out _isAutoBattle); dict.TryGetBool(isAutoHangKey, out _isAutoHang); dict.TryGetBool(isFastModeEnabledKey, out _isFastModeEnabled); dict.TryGetBool(HapticTouchEnabledKey, out _HapticTouchEnabled); dict.TryGetBool(FoundPurchaseStateKey, out _FoundPurchaseState); dict.TryGetBool(ChargeGiftGotStateKey, out _ChargeGiftGotState); dict.TryGetBool(Show7DaysActivityKey, out _Show7DaysActivity); dict.TryGetInt(BattleSpeedKey, out _BattleSpeed); dict.TryGetInt(WatchAdsSuccessNumKey, out _WatchAdsSuccessNum); dict.TryGetInt(ReviveTimesKey, out _ReviveTimes); dict.TryGetInt(MainMissionProgressKey, out _MainMissionProgress); dict.TryGetInt(autoBattleHintKey, out _autoBattleHint); dict.TryGetInt(FastLeftTimeKey, out _FastLeftTime); dict.TryGetInt(battleTimesKey, out _battleTimes); dict.TryGetInt(first_time_fail_gameKey, out _first_time_fail_game); dict.TryGetIntList(seatUnlockedKey, out seatUnlocked); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(CurrentDayNightIdKey, out _CurrentDayNightId); dict.TryGetInt(CurrentSeasonIdKey, out _CurrentSeasonId); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(numKey, out _num); dict.TryGetInt(indexKey, out _index); dict.TryGetString(idKey, out _id); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(isRareKey, out _isRare); dict.TryGetInt(skeletonIndexKey, out _skeletonIndex); dict.TryGetString(bodyKey, out _body); dict.TryGetString(eyesKey, out _eyes); dict.TryGetString(faceotherKey, out _faceother); dict.TryGetString(hairKey, out _hair); dict.TryGetString(handRKey, out _handR); dict.TryGetString(headKey, out _head); dict.TryGetString(hipsKey, out _hips); dict.TryGetString(L_hand_aKey, out _L_hand_a); dict.TryGetString(L_hand_bKey, out _L_hand_b); dict.TryGetString(L_hand_cKey, out _L_hand_c); dict.TryGetString(L_jiaoKey, out _L_jiao); dict.TryGetString(L_leg_aKey, out _L_leg_a); dict.TryGetString(L_leg_bKey, out _L_leg_b); dict.TryGetString(liuhaiKey, out _liuhai); dict.TryGetString(R_leg_aKey, out _R_leg_a); dict.TryGetString(R_leg_bKey, out _R_leg_b); dict.TryGetString(skinNameKey, out _skinName); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(bool_fieldKey, out _bool_field); dict.TryGetInt(int_fieldKey, out _int_field); dict.TryGetFloat(float_fieldKey, out _float_field); dict.TryGetString(string_fieldKey, out _string_field); dict.TryGetVector2(vector2_fieldKey, out _vector2_field); dict.TryGetVector3(vector3_fieldKey, out _vector3_field); dict.TryGetVector4(vector4_fieldKey, out _vector4_field); dict.TryGetColor(color_fieldKey, out _color_field); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); _custom_field = new GDESetCustomData(customDataKey); LoadFromSavedData(dataKey); } }
/// <summary> /// 创建所有角色 /// </summary> /// <param name="playerStr"></param> public void CreateAllPlayer(object[] data) { for (int i = 0; i < data.Length; i++) { Dictionary <string, object> playerDic = data[i] as Dictionary <string, object>; int roleId = playerDic.TryGetInt("playerId"); string roleName = playerDic.TryGetString("playerName"); int heroId = int.Parse(playerDic.TryGetString("heroId")); int campId = int.Parse(playerDic.TryGetString("teamId")); campId = campId == 0 ? 1 : 2; PlayerData charData = new PlayerData(roleId, heroId, roleName, (CampType)campId, ObjectType.PLAYER); CreatePlayer(charData); } for (int i = 0; i < 2; i++) { int campId = i % 2 == 0 ? 1 : 2; CreateTower((CampType)campId, ObjectType.ARROW_TOWER); } for (int i = 0; i < 2; i++) { int campId = i % 2 == 0 ? 1 : 2; CreateTower((CampType)campId, ObjectType.CRYSTAL_TOWER); } m_GridManager.InitTowerGrid(); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(bool_fieldKey, out _bool_field); dict.TryGetInt(int_fieldKey, out _int_field); dict.TryGetFloat(float_fieldKey, out _float_field); dict.TryGetString(string_fieldKey, out _string_field); dict.TryGetVector2(vector2_fieldKey, out _vector2_field); dict.TryGetVector3(vector3_fieldKey, out _vector3_field); dict.TryGetVector4(vector4_fieldKey, out _vector4_field); dict.TryGetColor(color_fieldKey, out _color_field); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); _custom_field = new GDEReadSceneUnityTypesData(customDataKey); dict.TryGetBoolList(bool_list_fieldKey, out bool_list_field); dict.TryGetIntList(int_list_fieldKey, out int_list_field); dict.TryGetFloatList(float_list_fieldKey, out float_list_field); dict.TryGetStringList(string_list_fieldKey, out string_list_field); dict.TryGetVector2List(vector2_list_fieldKey, out vector2_list_field); dict.TryGetVector3List(vector3_list_fieldKey, out vector3_list_field); dict.TryGetVector4List(vector4_list_fieldKey, out vector4_list_field); dict.TryGetColorList(color_list_fieldKey, out color_list_field); LoadFromSavedData(dataKey); } }
// // Initialize the GUIText from the values in the GDEDataManager // using the TryGet() methods. // public void Init() { if (Data != null) { GUIText guiText = gameObject.GetComponent <GUIText>(); // Pull out the text value from Game Data string text; Data.TryGetString("text", out text); if (text.Contains("{0}")) { guiText.text = string.Format(text, "/GameDataEditor/Scenes/SquareExample/Resources/" + GDEDataManager.Instance.DataFilePath + ".json"); } else { guiText.text = text; } // Pull out the size value from Game Data int fontSize; Data.TryGetInt("size", out fontSize); guiText.fontSize = fontSize; // Pull out the color value from Game Data Color textColor; Data.TryGetColor("color", out textColor); guiText.color = textColor; // Pull out the position value from Game Data Vector3 position; Data.TryGetVector3("position", out position); transform.localPosition = position; } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { return; } else { dict.TryGetInt(hp_deltaKey, out _hp_delta); dict.TryGetInt(mana_deltaKey, out _mana_delta); dict.TryGetInt(damage_deltaKey, out _damage_delta); dict.TryGetString(nameKey, out _name); } }
/// <summary> /// 进入匹配房间 /// </summary> /// <param name="data"></param> public void JoinMatchHeroRoom(Dictionary <string, object> data) { int result = data.TryGetInt("ret"); if (result != 0) { return; } string mobaKey = data.TryGetString("mobaKey"); string udpIp = data.TryGetString("ip"); int udpPort = data.TryGetInt("port"); GameData.m_UdpIP = udpIp; GameData.m_UdpPort = udpPort; GameData.m_MobaKey = mobaKey; m_UIManager.m_UpdateSelectHeroUI(); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(agileKey, out _agile); dict.TryGetInt(staminaKey, out _stamina); dict.TryGetInt(recoveryKey, out _recovery); dict.TryGetInt(leaderKey, out _leader); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(hideHairKey, out _hideHair); dict.TryGetInt(requireWeightKey, out _requireWeight); dict.TryGetInt(healthPointKey, out _healthPoint); dict.TryGetInt(atkBonusKey, out _atkBonus); dict.TryGetInt(defBonusKey, out _defBonus); dict.TryGetInt(dmgClampMinKey, out _dmgClampMin); dict.TryGetInt(dmgClampMaxKey, out _dmgClampMax); dict.TryGetInt(dmgCountKey, out _dmgCount); dict.TryGetFloat(populationKey, out _population); dict.TryGetFloat(speedBonusKey, out _speedBonus); dict.TryGetFloat(visionRangeKey, out _visionRange); dict.TryGetFloat(atkRangeKey, out _atkRange); dict.TryGetFloat(atkSpeedKey, out _atkSpeed); dict.TryGetFloat(weightRobRateKey, out _weightRobRate); dict.TryGetString(nickNameKey, out _nickName); dict.TryGetString(raceNameKey, out _raceName); dict.TryGetString(ownerNameKey, out _ownerName); dict.TryGetString(shapePathKey, out _shapePath); dict.TryGetString(leftWeaponDataKey, out _leftWeaponData); dict.TryGetString(rightWeaponDataKey, out _rightWeaponData); dict.TryGetString(animPathKey, out _animPath); dict.TryGetString(fsmPathKey, out _fsmPath); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { return; } else { dict.TryGetInt(hpKey, out _hp); dict.TryGetInt(manaKey, out _mana); dict.TryGetInt(damageKey, out _damage); dict.TryGetString(nameKey, out _name); dict.TryGetCustomList(buffsKey, out buffs); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(minuteKey, out _minute); dict.TryGetInt(lotnumberKey, out _lotnumber); dict.TryGetInt(repeatnumberKey, out _repeatnumber); dict.TryGetString(idKey, out _id); dict.TryGetString(nameKey, out _name); LoadFromSavedData(dataKey); } }
/// <summary> /// 确认进入匹配房间 /// </summary> /// <param name="data"></param> public void JoinMatchRoom(Dictionary <string, object> data) { int result = data.TryGetInt("ret"); if (result != 0) { return; } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetBool(isLockedKey, out _isLocked); dict.TryGetBool(receiveRewardKey, out _receiveReward); dict.TryGetInt(remarkKey, out _remark); dict.TryGetInt(finishCountKey, out _finishCount); dict.TryGetInt(IndexKey, out _Index); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(taskBagTypeKey, out _taskBagType); dict.TryGetInt(taskBagIdKey, out _taskBagId); dict.TryGetInt(stepKey, out _step); dict.TryGetString(taskBagClassKey, out _taskBagClass); dict.TryGetCustomList(allTasksKey, out allTasks); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(IDKey, out _ID); dict.TryGetInt(MaxHPKey, out _MaxHP); dict.TryGetFloat(MoveVecKey, out _MoveVec); dict.TryGetFloat(AlertRangeKey, out _AlertRange); dict.TryGetFloat(AtkRangeKey, out _AtkRange); dict.TryGetFloat(AtkIntervalKey, out _AtkInterval); dict.TryGetFloat(HurtProtectKey, out _HurtProtect); dict.TryGetFloat(MassKey, out _Mass); dict.TryGetString(PrefabPathKey, out _PrefabPath); LoadFromSavedData(dataKey); } }
/// <summary> /// 匹配游戏 /// </summary> /// <param name="data"></param> public void MatchGame(Dictionary <string, object> data) { int result = data.TryGetInt("ret"); if (result != 0) { return; } Delay delay = new Delay(); delay.InitMatchTime(Fix64.FromRaw(30000), UpdateMatchTime); m_DelayManager.m_DelayList.Add(delay); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(IDKey, out _ID); dict.TryGetInt(MaxHPKey, out _MaxHP); dict.TryGetInt(MaxShieldValKey, out _MaxShieldVal); dict.TryGetInt(ShieldRestoreVecKey, out _ShieldRestoreVec); dict.TryGetFloat(MoveVecKey, out _MoveVec); dict.TryGetFloat(HurtProtectKey, out _HurtProtect); dict.TryGetFloat(MassKey, out _Mass); dict.TryGetFloat(ShieldRestoreIntervalKey, out _ShieldRestoreInterval); dict.TryGetFloat(ShieldRestoreBreakKey, out _ShieldRestoreBreak); dict.TryGetString(PrefabPathKey, out _PrefabPath); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetBool(stage_lockKey, out _stage_lock); dict.TryGetInt(base_scoreKey, out _base_score); dict.TryGetInt(high_scoreKey, out _high_score); dict.TryGetFloat(remain_fuelKey, out _remain_fuel); dict.TryGetFloat(base_fuelKey, out _base_fuel); dict.TryGetGameObject(game_objectKey, out _game_object); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetInt(KnockbackKey, out _Knockback); dict.TryGetInt(AttackRangeKey, out _AttackRange); dict.TryGetInt(CostOfUseKey, out _CostOfUse); dict.TryGetInt(numberOfUsesKey, out _numberOfUses); dict.TryGetString(itemTypeKey, out _itemType); dict.TryGetGameObject(ItemModelKey, out _ItemModel); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetBool(bool_fieldKey, out _bool_field); dict.TryGetInt(int_fieldKey, out _int_field); dict.TryGetFloat(float_fieldKey, out _float_field); dict.TryGetString(string_fieldKey, out _string_field); dict.TryGetVector2(vector2_fieldKey, out _vector2_field); dict.TryGetVector3(vector3_fieldKey, out _vector3_field); dict.TryGetVector4(vector4_fieldKey, out _vector4_field); dict.TryGetColor(color_fieldKey, out _color_field); string customDataKey; dict.TryGetString(custom_fieldKey, out customDataKey); GDEDataManager.DataDictionary.TryGetCustom(customDataKey, out _custom_field); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetInt(projectileRangeKey, out _projectileRange); dict.TryGetInt(numberOfUsesKey, out _numberOfUses); dict.TryGetInt(CostOfUseKey, out _CostOfUse); dict.TryGetFloat(itemDurationKey, out _itemDuration); dict.TryGetString(itemTypeKey, out _itemType); dict.TryGetGameObject(ItemModelKey, out _ItemModel); LoadFromSavedData(dataKey); } }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetBool(show_remain_fuelKey, out _show_remain_fuel); dict.TryGetBool(long_tap_stage_record_clearKey, out _long_tap_stage_record_clear); dict.TryGetBool(soundKey, out _sound); dict.TryGetBool(musicKey, out _music); dict.TryGetInt(world_countKey, out _world_count); dict.TryGetString(versionKey, out _version); dict.TryGetString(auto_selected_stage_idKey, out _auto_selected_stage_id); dict.TryGetCustomList(stageKey, out stage); LoadFromSavedData(dataKey); } }
protected override void DrawEntry(string schemaKey, Dictionary<string, object> schemaData) { float beginningHeight = drawHelper.CurrentHeight(); // Start drawing below bool isOpen = DrawFoldout(GDEConstants.SchemaLbl + " ", schemaKey, schemaKey, schemaKey, RenameSchema); drawHelper.NewLine(); if (isOpen) { bool shouldDrawSpace = false; bool didDrawSpaceForSection = false; bool isFirstSection = true; int listDimension = 0; // Draw the basic types foreach(BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List<string> fieldKeys = GDEItemManager.SchemaFieldKeysOfType(schemaKey, fieldType.ToString(), 0); foreach(string fieldKey in fieldKeys) { drawHelper.CurrentLinePosition += GDEConstants.Indent; DrawSingleField(schemaKey, fieldKey, schemaData); shouldDrawSpace = true; isFirstSection = false; } } // Draw the custom types foreach(string fieldKey in GDEItemManager.SchemaCustomFieldKeys(schemaKey, 0)) { if (shouldDrawSpace && !didDrawSpaceForSection && !isFirstSection) { drawHelper.NewLine(0.5f); } drawHelper.CurrentLinePosition += GDEConstants.Indent; DrawSingleField(schemaKey, fieldKey, schemaData); shouldDrawSpace = true; isFirstSection = false; didDrawSpaceForSection = true; } didDrawSpaceForSection = false; // Draw the lists for(int dimension=1; dimension <=2; dimension++) { foreach(BasicFieldType fieldType in GDEItemManager.BasicFieldTypes) { List<string> fieldKeys = GDEItemManager.SchemaFieldKeysOfType(schemaKey, fieldType.ToString(), dimension); foreach(string fieldKey in fieldKeys) { string isListKey = string.Format(GDMConstants.MetaDataFormat, GDMConstants.IsListPrefix, fieldKey); schemaData.TryGetInt(isListKey, out listDimension); if (shouldDrawSpace && !didDrawSpaceForSection && !isFirstSection) { drawHelper.NewLine(0.5f); } drawHelper.CurrentLinePosition += GDEConstants.Indent; if (listDimension == 1) DrawListField(schemaKey, schemaData, fieldKey); else Draw2DListField(schemaKey, schemaData, fieldKey); shouldDrawSpace = true; didDrawSpaceForSection = true; isFirstSection = false; } } didDrawSpaceForSection = false; } // Draw the custom lists for(int dimension=1; dimension <=2; dimension++) { foreach(string fieldKey in GDEItemManager.SchemaCustomFieldKeys(schemaKey, dimension)) { if (shouldDrawSpace && !didDrawSpaceForSection && !isFirstSection) { drawHelper.NewLine(0.5f); } drawHelper.CurrentLinePosition += GDEConstants.Indent; if (dimension == 1) DrawListField(schemaKey, schemaData, fieldKey); else Draw2DListField(schemaKey, schemaData, fieldKey); shouldDrawSpace = true; didDrawSpaceForSection = true; isFirstSection = false; } } didDrawSpaceForSection = false; drawHelper.NewLine(); DrawAddFieldSection(schemaKey, schemaData); drawHelper.NewLine(2f); DrawEntryFooter(GDEConstants.CloneSchema, GDEConstants.SizeCloneSchemaKey, schemaKey); // Remove any fields that were deleted above foreach(string deletedKey in deletedFields) RemoveField(schemaKey, schemaData, deletedKey); deletedFields.Clear(); // Rename any fields that were renamed string error; string oldFieldKey; string newFieldKey; foreach(KeyValuePair<List<string>, Dictionary<string, object>> pair in renamedFields) { oldFieldKey = pair.Key[0]; newFieldKey = pair.Key[1]; if (!GDEItemManager.RenameSchemaField(oldFieldKey, newFieldKey, schemaKey, pair.Value, out error)) EditorUtility.DisplayDialog(GDEConstants.ErrorLbl, string.Format(GDEConstants.CouldNotRenameFormat, oldFieldKey, newFieldKey, error), GDEConstants.OkLbl); } renamedFields.Clear(); } float newGroupHeight = drawHelper.CurrentHeight() - beginningHeight; float currentGroupHeight; groupHeights.TryGetValue(schemaKey, out currentGroupHeight); if (!newGroupHeight.NearlyEqual(currentGroupHeight)) { currentGroupHeightTotal -= currentGroupHeight; currentGroupHeightTotal += newGroupHeight; } SetGroupHeight(schemaKey, newGroupHeight); }
public override void LoadFromDict(string dataKey, Dictionary<string, object> dict) { _key = dataKey; if (dict == null) LoadFromSavedData(dataKey); else { dict.TryGetBool(bool_fieldKey, out _bool_field); dict.TryGetInt(int_fieldKey, out _int_field); dict.TryGetFloat(float_fieldKey, out _float_field); dict.TryGetString(descriptionKey, out _description); dict.TryGetString(string_fieldKey, out _string_field); dict.TryGetVector2(vector2_fieldKey, out _vector2_field); dict.TryGetVector3(vector3_fieldKey, out _vector3_field); dict.TryGetColor(color_fieldKey, out _color_field); LoadFromSavedData(dataKey); } }