private void TryUpdateValue(StoryInstance instance) { if (m_CampId.HaveValue && m_Index.HaveValue) { m_HaveValue = true; int sceneId = PluginFramework.Instance.SceneId; int campId = m_CampId.Value; int index = m_Index.Value; int monstersId = TableConfigUtility.GenLevelMonstersId(sceneId, campId); List <TableConfig.LevelMonster> monsterList; if (TableConfig.LevelMonsterProvider.Instance.TryGetValue(monstersId, out monsterList)) { if (index >= 0 && index < monsterList.Count) { m_Value = monsterList[index]; } else { m_Value = null; } } else { m_Value = null; } } }
private void TryUpdateValue(StoryInstance instance) { Scene scene = instance.Context as Scene; if (null != scene) { if (m_CampId.HaveValue && m_Index.HaveValue) { m_HaveValue = true; int sceneId = scene.SceneResId; int campId = m_CampId.Value; int index = m_Index.Value; int monstersId = TableConfigUtility.GenLevelMonstersId(sceneId, campId); List <TableConfig.LevelMonster> monsterList; if (TableConfig.LevelMonsterProvider.Instance.TryGetValue(monstersId, out monsterList)) { if (index >= 0 && index < monsterList.Count) { m_Value = BoxedValue.From(monsterList[index]); } else { m_Value = BoxedValue.NullObject; } } else { m_Value = BoxedValue.NullObject; } } } }