/// <summary> /// 初期化 /// </summary> /// <param name="setting">レイヤー設定データ</param> public void InitLayerSetting(AdvLayerSetting setting) { foreach (AdvLayerSettingData item in setting.List) { AdvLayer layer = UtageToolKit.AddChildGameObjectComponent<AdvLayer>(this.transform, item.Name); layer.Init(item, PixelsToUnits); layers.Add(item.Name, layer); if (item == setting.DefaultBGLayer) { bgLayer = layer; } //キャラクターレイヤー登録 if (item.Type == AdvLayerSettingData.LayerType.Character) { characterLayers.Add(item.Name, layer); if (item == setting.DefaultCharacterLayer) { defaultCharacterLayer = layer; } } //スプライトレイヤー登録 if (item.Type == AdvLayerSettingData.LayerType.Sprite) { spriteLayers.Add(item.Name, layer); if (item == setting.DefaultSpriteLayer) { defaultSpriteLayer = layer; } } } }
AdvLayer AddLayer(AdvLayerSettingData data) { AdvLayer layer = UtageToolKit.AddChildGameObjectComponent <AdvLayer>(this.transform, data.Name); layer.Init(data, PixelsToUnits); layers.Add(data.Name, layer); //キャラクターレイヤー登録 if (data.Type == AdvLayerSettingData.LayerType.Character) { characterLayers.Add(data.Name, layer); } //スプライトレイヤー登録 if (data.Type == AdvLayerSettingData.LayerType.Sprite) { spriteLayers.Add(data.Name, layer); } return(layer); }