<ListBox x:Name="ListBox_gameList" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="auto" >
<Label Content="{Binding Path=GameName}" HorizontalAlignment="Left"/>
<Button Content="删除" Click="Button_ClickDelete" HorizontalAlignment="Right" MinWidth="40"
Tag="{Binding Path=Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
然后在点击事件中获取这个按钮的Tag
private void Button_ClickDelete(object sender, RoutedEventArgs e)
Button btn = sender as Button;
for (int i = 0; i < EditorData.CurrentGameChannelList.Count; i++)
ChannelInfo info = EditorData.CurrentGameChannelList[i];
if (info.Name == (string)btn.Tag)
EditorData.CurrentGameChannelList.RemoveAt(i);
return;
Unity Android SDK 管理方案
之前在框架中使用SDKManager来解决不同渠道使用不同SDK的问题,但是这个方案的问题是,在一个项目中切换渠道是方便了(也不是特别方便),在不同的项目中同一套SDK还是要接入多次,所以想要做一个能够支持在多个项目中同一个SDK也只需要接入一次的方案。 我的思路是,首先调整框架的SDKManager,使它暴露出登陆、支付、数据上报和广告四个接口,在unity工程中不再导入渠道的SDK,而是在导出的APK中,我们再将他重新解包并放入我们需要的SDK,并且调整一些其他资源。 为达到这一目标,我们需要一个APK重打包工具,这个工具可以根据我们的渠道和游戏,从SDK库中取出我们所需要的SDK文件和对应的配置文件,…