/// <summary> /// 创建一个简易配置,并添加一组数据 /// </summary> /// <param name="items">数组</param> /// <param name="encoding">编辑</param> public static CreateConfig Create(Dictionary <string, string> items, Encoding encoding) { CreateConfig cc = new CreateConfig(encoding); cc.AddRange(items); return(cc); }
// ビル生成 private void CreateBuildings(CreateConfig config) { Debug.Assert(arowMapObjectModel != null); var p = GameObject.Find(BUILDING_OBJ_PARENT_NAME); if (p == null) { p = new GameObject(BUILDING_OBJ_PARENT_NAME); } // 「BuildingのMesh生成」に必要な設定を行う var buildingMeshCreator = new BuildingCreator .Builder(arowMapObjectModel.BuildingDataModels) .SetRoadDataModels(arowMapObjectModel.RoadDataModels) .SetWorldCenter(worldCenter) .SetWorldScale(MapUtility.WorldScale) .SetConfig(config) .IsExtractWithTaskAsync(true) .SetOnMeshBuildType(BuildingCreator.BUILD_TYPE.BUILDING) .SetOnMeshCreatedCallBack((BuildingDataModelWithMesh buildingDataWithMesh) => { // Mesh生成が完了するたびに、そのmeshをGameObject化する CreateBuildingMeshScripts.CreateBuildingGameObject(buildingDataWithMesh, p.transform, worldCenter, MapUtility.WorldScale, config); }) .SetOnCompletedCreateMeshCallBack((List <BuildingDataModelWithMesh> list) => { // 全てのmeshを生成し終えたら、state切り替え isEndOfFunction[MAP_CREATE.BUILDING] = true; }); // 「BuildingのMesh生成」の開始 buildingMeshCreator.Build(); }
public async Task CreateConfigTest() { const string name = "Kurt test"; const string description = "Kurt's test config from test proj"; CreateConfig newConfig = new CreateConfig { Name = name, Description = description, Settings = new List <Setting> { new Setting { Key = "Hello", Value = "Bye 👋" } } }; ConfigWithSettingsList config = await _remoteConfigsRepo.CreateConfigAsync(newConfig); Assert.NotNull(config); Assert.AreEqual(config.Name, name); Assert.AreEqual(config.Description, description); Assert.NotNull(config.Settings); Assert.NotZero(config.Settings.Count); Assert.AreEqual(config.Settings.Count, 1); Assert.Pass(); }
void initLocalBase() { // Поиск локальной базы данный Config DataConfig.configFile = DataConfig.resource + "\\config.mdb"; if (!File.Exists(DataConfig.configFile)) { CreateConfig.Create(); //файл не найден, он будет создан ReadingConfig.ReadDatabaseSettings(); ReadingConfig.ReadSettings(); } else { ReadingConfig.ReadDatabaseSettings(); ReadingConfig.ReadSettings(); } // Поиск локальной базы данный Database if (!File.Exists(DataConfig.localDatabase) && DataConfig.typeConnection == DataConstants.CONNETION_LOCAL) { // файл не найден, он будет создан DataConfig.oledbConnectLineBegin = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="; DataConfig.oledbConnectLineEnd = ""; DataConfig.oledbConnectPass = ""; CreateDatabaseMSAccess createDatabaseMSAccess = new CreateDatabaseMSAccess(DataConfig.localDatabase); createDatabaseMSAccess.CreateDB(); } createFormSelectUser(); }
public static IntPtr DataChannelCreateObjectCallback(IntPtr peer, CreateConfig config, out Callbacks callbacks) { var peerWrapper = Utils.ToWrapper <PeerConnection>(peer); var dataChannelWrapper = CreateWrapper(peerWrapper, config, out callbacks); return(Utils.MakeWrapperRef(dataChannelWrapper)); }
public static IntPtr DataChannelCreateObjectCallback(IntPtr peer, CreateConfig config, out Callbacks callbacks) { var peerWrapper = Utils.ToWrapper <PeerConnection>(peer); var dataChannelWrapper = CreateWrapper(peerWrapper, config, out callbacks); var handle = GCHandle.Alloc(dataChannelWrapper, GCHandleType.Normal); return(GCHandle.ToIntPtr(handle)); }
public void CreateBuildingsNonCollider() { // 建物などに関しての「設定ファイル」の作成 CreateConfig config = ScriptableObject.CreateInstance <CreateConfig>(); CreateRuntimeBuildingBuilder.SetupConfigForSampleSlice(config); CreateRuntimeBuildingBuilder.SetupFillGapGroundElement(config); config.SetupSharedMaterials = CreateRuntimeBuildingBuilder.GetFixTextureSuiteCallbackForSampleSlice(config); CreateBuildings(config); }
public async Task <ConfigWithSettingsList> CreateConfigAsync(CreateConfig newConfig) { string configurationUrl = Path.Combine(_configurationsUrl); string payload = JsonConvert.SerializeObject(newConfig); using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders.Add(HeaderKey, _apiKey); HttpResponseMessage response = await client.PostAsync(configurationUrl, new StringContent(payload, Encoding.UTF8, "application/json")); string content = await response.Content.ReadAsStringAsync(); ConfigWithSettingsList config = JsonConvert.DeserializeObject <ConfigWithSettingsList>(content); return(config); } }
/// <summary> /// DEMO用のConfig関連の読み込み /// ※Demo用のConfigファイルなので、読み込み先は決め打ちしている /// </summary> /// <param name="use_landmark_config">true:LandmarkConfigを読み込む</param> /// <param name="use_poi_config">true:PoiConfigを読み込む</param> public void CreateBuildingFromConfigAsset(bool use_landmark_config, bool use_poi_config) { #if UNITY_EDITOR if (!File.Exists("Assets/ArowSample/Resources/Demo/BuildingConfig.asset")) { DisplayDemoError("asset ファイルが無いためビル生成ができません。ArowSample メニューからセットアップを実行してください。"); return; } #endif CreateConfig configpublic = Resources.Load <CreateConfig>("Demo/BuildingConfig"); if (use_landmark_config) { #if UNITY_EDITOR if (!File.Exists("Assets/ArowSample/Resources/Demo/LandmarkPoiConfig_DemoSample.asset")) { DisplayDemoError("LandmarkPoiConfig ファイルが無いためビル生成ができません。ArowSample メニューからセットアップを実行してください。"); return; } #endif LandmarkPoiConfig configlandmark = Resources.Load <LandmarkPoiConfig>("Demo/LandmarkPoiConfig_DemoSample"); configpublic.LandmarkConfig = configlandmark; } if (use_poi_config) { #if UNITY_EDITOR if (!File.Exists("Assets/ArowSample/Resources/Demo/CategoryPoiConfig_DemoSample.asset")) { DisplayDemoError("CategoryPoiConfig ファイルが無いためビル生成ができません。ArowSample メニューからセットアップを実行してください。"); return; } #endif CategoryPoiConfig configpoi = Resources.Load <CategoryPoiConfig>("Demo/CategoryPoiConfig_DemoSample"); configpublic.CategoryPoiConfig = configpoi; } CreateBuildings(configpublic); }
public static DataChannel CreateWrapper(PeerConnection parent, CreateConfig config, out Callbacks callbacks) { // Create the callback args for the data channel var args = new CallbackArgs() { Peer = parent, DataChannel = null, // set below MessageCallback = DataChannelMessageCallback, BufferingCallback = DataChannelBufferingCallback, StateCallback = DataChannelStateCallback }; // Pin the args to pin the delegates while they're registered with the native code var handle = GCHandle.Alloc(args, GCHandleType.Normal); IntPtr userData = GCHandle.ToIntPtr(handle); // Create a new data channel. It will hold the lock for its args while alive. bool ordered = (config.flags & 0x1) != 0; bool reliable = (config.flags & 0x2) != 0; var dataChannel = new DataChannel(parent, handle, config.id, config.label, ordered, reliable); args.DataChannel = dataChannel; // Fill out the callbacks callbacks = new Callbacks() { messageCallback = args.MessageCallback, messageUserData = userData, bufferingCallback = args.BufferingCallback, bufferingUserData = userData, stateCallback = args.StateCallback, stateUserData = userData }; return(dataChannel); }
private void SetConfig(CreateConfig createConfig) { _config = createConfig(); _config.Validate(); }
/// <summary> /// 创建一个简易配置 /// </summary> /// <param name="encoding">配置编码</param> public static CreateConfig Create(Encoding encoding) { CreateConfig cc = new CreateConfig(encoding); return(cc); }
public void InitializeCreateConfigTest() { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); dbConfig = new DBConfig("System.Data.OleDb", "Provider=Microsoft.JET.OLEDB.4.0;data source=DatabaseMigrator.mdb"); createConfig = new CreateConfig(); }
public void OnGUI(Rect pos) { m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition); bool newState = false; var centeredStyle = GUI.skin.GetStyle("Label"); centeredStyle.alignment = TextAnchor.UpperCenter; GUILayout.Label(new GUIContent("Example build setup"), centeredStyle); //basic options EditorGUILayout.Space(); GUILayout.BeginVertical(); // build target using (new EditorGUI.DisabledScope(!AssetBundleModel.Model.DataSource.CanSpecifyBuildTarget)) { ValidBuildTarget tgt = (ValidBuildTarget)EditorGUILayout.EnumPopup(m_TargetContent, m_UserData.m_BuildTarget); if (tgt != m_UserData.m_BuildTarget) { m_UserData.m_BuildTarget = tgt; if (m_UserData.m_UseDefaultPath) { m_UserData.m_OutputPath = "AssetBundles/"; m_UserData.m_OutputPath += m_UserData.m_BuildTarget.ToString(); //EditorUserBuildSettings.SetPlatformSettings(EditorUserBuildSettings.activeBuildTarget.ToString(), "AssetBundleOutputPath", m_OutputPath); } } } ////output path using (new EditorGUI.DisabledScope(!AssetBundleModel.Model.DataSource.CanSpecifyBuildOutputDirectory)) { EditorGUILayout.Space(); GUILayout.BeginHorizontal(); var newPath = EditorGUILayout.TextField("Output Path", m_UserData.m_OutputPath); if ((newPath != m_UserData.m_OutputPath) && (newPath != string.Empty)) { m_UserData.m_UseDefaultPath = false; m_UserData.m_OutputPath = newPath; //EditorUserBuildSettings.SetPlatformSettings(EditorUserBuildSettings.activeBuildTarget.ToString(), "AssetBundleOutputPath", m_OutputPath); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Browse", GUILayout.MaxWidth(75f))) { BrowseForFolder(); } if (GUILayout.Button("Reset", GUILayout.MaxWidth(75f))) { ResetPathToDefault(); } //if (string.IsNullOrEmpty(m_OutputPath)) // m_OutputPath = EditorUserBuildSettings.GetPlatformSettings(EditorUserBuildSettings.activeBuildTarget.ToString(), "AssetBundleOutputPath"); GUILayout.EndHorizontal(); EditorGUILayout.Space(); newState = GUILayout.Toggle( m_ForceRebuild.state, m_ForceRebuild.content); if (newState != m_ForceRebuild.state) { if (newState) { m_UserData.m_OnToggles.Add(m_ForceRebuild.content.text); } else { m_UserData.m_OnToggles.Remove(m_ForceRebuild.content.text); } m_ForceRebuild.state = newState; } newState = GUILayout.Toggle( m_CopyToStreaming.state, m_CopyToStreaming.content); if (newState != m_CopyToStreaming.state) { if (newState) { m_UserData.m_OnToggles.Add(m_CopyToStreaming.content.text); } else { m_UserData.m_OnToggles.Remove(m_CopyToStreaming.content.text); } m_CopyToStreaming.state = newState; } } // advanced options using (new EditorGUI.DisabledScope(!AssetBundleModel.Model.DataSource.CanSpecifyBuildOptions)) { EditorGUILayout.Space(); m_AdvancedSettings = EditorGUILayout.Foldout(m_AdvancedSettings, "Advanced Settings"); if (m_AdvancedSettings) { var indent = EditorGUI.indentLevel; EditorGUI.indentLevel = 1; CompressOptions cmp = (CompressOptions)EditorGUILayout.IntPopup( m_CompressionContent, (int)m_UserData.m_Compression, m_CompressionOptions, m_CompressionValues); if (cmp != m_UserData.m_Compression) { m_UserData.m_Compression = cmp; } foreach (var tog in m_ToggleData) { newState = EditorGUILayout.ToggleLeft( tog.content, tog.state); if (newState != tog.state) { if (newState) { m_UserData.m_OnToggles.Add(tog.content.text); } else { m_UserData.m_OnToggles.Remove(tog.content.text); } tog.state = newState; } } EditorGUILayout.Space(); EditorGUI.indentLevel = indent; } } // build. EditorGUILayout.Space(); if (GUILayout.Button("Build")) { CreateConfig.MenuCreateConfigAsset(); EditorApplication.delayCall += ExecuteBuild; } GUILayout.EndVertical(); EditorGUILayout.EndScrollView(); }
private static void CreateArmorConfig() { List <Dictionary <string, string> > xxListResult; #region BasicHeros xxListResult = ReadVSC("hero"); HeroRace[] heroRaces = Resources.LoadAll <HeroRace>(""); RoleCareer[] careers = Resources.LoadAll <RoleCareer>(""); List <HeroInfo> AlreadyHave = Resources.LoadAll <HeroInfo>("").ToList(); for (int i = 0; i < xxListResult.Count; i++) { Dictionary <string, string> Dic = xxListResult[i]; if (AlreadyHave.Exists(x => x.ID == Dic["id"])) { continue; } // HeroInfo mi = ScriptableObject.CreateInstance <HeroInfo>(); CharacterSex sex = (CharacterSex)(StringToInteger(Dic["gender"])); mi.initData(Dic["id"], Dic["name"], Dic["desc"], sex, ""); int Race = StringToInteger(Dic["race"]); foreach (HeroRace race in heroRaces) { if (race.Index == Race) { mi.Race = race; break; } } int career = StringToInteger(Dic["career"]); foreach (RoleCareer c in careers) { if (c.Index == career) { mi.Career = c; break; } } mi.InitRAL(RALByDictionary(Dic)); mi.WeaponRaceList = GetWeaponTypeList(Dic["weaponClass"]); mi.SpecialStr = Dic["specialStr"]; mi.AddSkillData( getSkillsByString(Dic["skill0"]) , getSkillsByString(Dic["skill1"]) , getSkillsByString(Dic["skillOmega"]) ); // AssetDatabase.CreateAsset(mi, "Assets/Resources/ScriptableObjects/heroes/" + career + "_" + mi.ID.Substring(mi.ID.Length - 3) + "_" + mi.Name + ".asset"); } #endregion return; #region enemy xxListResult = CreateConfig.ReadVSC("enemy"); EnemyRank[] eRanks = Resources.LoadAll <EnemyRank>(""); for (int i = 0; i < xxListResult.Count; i++) { Dictionary <string, string> Dic = xxListResult[i]; EnemyInfo mi = ScriptableObject.CreateInstance <EnemyInfo>(); CharacterSex sex = (CharacterSex)(StringToInteger(Dic["gender"])); mi.initData(Dic["id"], Dic["name"], Dic["desc"], sex, ""); mi.Race = EnemyRaces(Dic["race"]); int ranktype = StringToInteger(Dic["rank"]); foreach (EnemyRank rank in eRanks) { if (rank.Index == ranktype) { mi.EnemyRank = rank; break; } } mi.RAL = RALByDictionary(Dic); mi.weight = StringToInteger(Dic["weight"]); mi.dropPercent = StringToInteger(Dic["dropRate"]); mi.StartAppearLevel = StringToInteger(Dic["startLevel"]); mi.EndAppearLevel = StringToInteger(Dic["endLevel"]); // AssetDatabase.CreateAsset(mi, "Assets/Resources/ScriptableObjects/enemies/" + mi.ID.Split('#')[1] + mi.Name + ".asset"); } #endregion return; #region Equip xxListResult = CreateConfig.ReadVSC("equip"); ArmorRank[] armor_ranks = Resources.LoadAll <ArmorRank>(""); WeaponRace[] waepon_races = Resources.LoadAll <WeaponRace>(""); List <SpriteAtlas> allAtlas = Resources.LoadAll <SpriteAtlas>("Sprites/atlas").ToList(); for (int i = 0; i < xxListResult.Count; i++) { Dictionary <string, string> Dic = xxListResult[i]; EquipItem ei = ScriptableObject.CreateInstance <EquipItem>(); ei.initData(Dic["id"], Dic["name"], Dic["desc"], CreateConfig.StringToInteger(Dic["level"]) , false, true, true, true, false, Dic["specialStr"]); ei.ResistStr = Dic["resistStr"]; // int rankType = CreateConfig.StringToInteger(Dic["type"]); foreach (ArmorRank rank in armor_ranks) { if (rank.Index == rankType) { ei.ArmorRank = rank; break; } } if (!string.IsNullOrEmpty(Dic["suit"])) { ei.SuitBelong = true; ei.SuitId = Dic["suit"]; } // ei.RAL = RALBySpecialStr(RoleAttributeList.zero, Dic["specialStr"]); ei.RAL = RALByResistStr(ei.RAL, Dic["resistStr"]); ei.PassiveEffect = Dic["passiveEffect"]; // string _class = Dic["class"]; EquipPosition pos = ROHelp.EQUIP_POS(_class); ei.EquipPos = pos; if (pos == EquipPosition.Hand) { string weaponClass = Dic["weaponClass"].ToLower(); foreach (WeaponRace r in waepon_races) { if (weaponClass == r.NAME.ToLower()) { ei.WeaponRace = r; break; } } } // AssetDatabase.CreateAsset(ei, "Assets/Resources/ScriptableObjects/items/Equips/" + (int)ei.EquipPos + "_" + ei.LEVEL + "_" + ei.NAME + ".asset"); } #endregion return; xxListResult = ReadVSC("hero"); //HeroRace[] heroRaces = Resources.LoadAll<HeroRace>(""); //RoleCareer[] careers = Resources.LoadAll<RoleCareer>(""); for (int i = 0; i < xxListResult.Count; i++) { Dictionary <string, string> Dic = xxListResult[i]; HeroInfo mi = ScriptableObject.CreateInstance <HeroInfo>(); CharacterSex sex = (CharacterSex)(StringToInteger(Dic["gender"])); mi.initData(Dic["id"], Dic["name"], Dic["desc"], sex, ""); int Race = StringToInteger(Dic["race"]); foreach (HeroRace race in heroRaces) { if (race.Index == Race) { mi.Race = race; break; } } int career = StringToInteger(Dic["career"]); foreach (RoleCareer c in careers) { if (c.Index == career) { mi.Career = c; break; } } mi.InitRAL(RALByDictionary(Dic)); mi.WeaponRaceList = GetWeaponTypeList(Dic["weaponClass"]); mi.SpecialStr = Dic["specialStr"]; mi.AddSkillData( getSkillsByString(Dic["skill0"]) , getSkillsByString(Dic["skill1"]) , getSkillsByString(Dic["skillOmega"]) ); // AssetDatabase.CreateAsset(mi, "Assets/Resources/ScriptableObjects/heroes/" + career + "_" + mi.ID.Substring(mi.ID.Length - 3) + "_" + mi.Name + ".asset"); } return; return; #region Consumable xxListResult = CreateConfig.ReadVSC("material"); for (int i = 0; i < xxListResult.Count; i++) { Dictionary <string, string> Dic = xxListResult[i]; SDConstants.MaterialType MT = CreateConfig.getMTypeByString(Dic["materialType"]); consumableItem mi = ScriptableObject.CreateInstance <consumableItem>(); mi.initData(Dic["id"], Dic["name"], Dic["desc"], CreateConfig.StringToInteger(Dic["level"]) , false, true, true, true, false, Dic["specialStr"], SDConstants.ItemType.Consumable); mi.MaterialType = MT; mi.buyPrice_coin = StringToInteger(Dic["buyPrice_coin"]); mi.buyPrice_diamond = StringToInteger(Dic["buyPrice_diamond"]); mi.minLv = StringToInteger(Dic["minLv"]); mi.maxLv = StringToInteger(Dic["maxLv"]); mi.exchangeType = StringToInteger(Dic["exchangeType"]); mi.weight = StringToInteger(Dic["weight"]); mi.ConsumableType = (SDConstants.ConsumableType)StringToInteger(Dic["consumableType"]); if (Dic.ContainsKey("range")) { mi.AOE = ROHelp.AOE_TYPE(Dic["range"]); } if (Dic.ContainsKey("target")) { mi.AIM = Dic["target"].ToUpper(); } // AssetDatabase.CreateAsset(mi, "Assets/Resources/ScriptableObjects/items/Consumables/" + mi.ID.Substring(mi.ID.Length - 3) + mi.NAME + ".asset"); } #endregion }