C# 在xamarin中创建cocossharp项目
我是xamarin studio的新手,我正试图按照官方指南创建一个合作项目,但是这个文档不是很清楚,我的项目有很多错误 我用IOS、android和PCL创建了一个xamarin.form 我已经将cocosSharp包添加到IOS和Android项目中 但是 如果我不将cocosSharp包添加到PCL目标,代码将找不到cocos类 如果我尝试将cocosSharp包添加到PCL,控制台将显示以下内容 无法安装程序包“CocosSharp 1.7.1”。您正试图将此软件包安装到以“.NETPortable,Version=v4.5,Profile=Profile259”为目标的项目中,但该软件包不包含任何与该框架兼容的程序集引用或内容文件。有关更多信息,请联系软件包作者 我试图更改targetFramework,但这对我没有帮助 如果有人使用cocosSharp和xamarin studio V6,我如何解决这个问题 或者,我如何在Galery中添加cocosSharp的外接程序,就像以前版本的xamarin一样 这是ContentPage中的代码,找不到Cocos类C# 在xamarin中创建cocossharp项目,c#,xamarin-studio,cocossharp,C#,Xamarin Studio,Cocossharp,我是xamarin studio的新手,我正试图按照官方指南创建一个合作项目,但是这个文档不是很清楚,我的项目有很多错误 我用IOS、android和PCL创建了一个xamarin.form 我已经将cocosSharp包添加到IOS和Android项目中 但是 如果我不将cocosSharp包添加到PCL目标,代码将找不到cocos类 如果我尝试将cocosSharp包添加到PCL,控制台将显示以下内容 无法安装程序包“CocosSharp 1.7.1”。您正试图将此软件包安装到以“.NET
public class MyPage : ContentPage
{
public MyPage()
{
Content = new StackLayout
{
Children = {
new Label { Text = "Hello ContentPage" }
}
};
}
void CreateTopHalf(Grid grid)
{
// This hosts our game view.
var gameView = new CocosSharpView()
{
// Notice it has the same properties as other XamarinForms Views
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
// This gets called after CocosSharp starts up:
ViewCreated = HandleViewCreated
};
// We'll add it to the top half (row 0)
grid.Children.Add(gameView, 0, 0);
}
void HandleViewCreated(object sender, EventArgs e)
{
var gameView = sender as CCGameView;
if (gameView != null)
{
// This sets the game "world" resolution to 100x100:
gameView.DesignResolution = new CCSizeI(100, 100);
// GameScene is the root of the CocosSharp rendering hierarchy:
gameScene = new GameScene(gameView);
// Starts CocosSharp:
gameView.RunWithScene(gameScene);
}
}
}
我自己就知道了。确实没有与Profile259匹配的构建。试试151: