- 转载地址
-
using UnityEngine;
-
using UnityEngine. SocialPlatforms;
-
-
{
-
// we'll create some buttons in OnGui, allowing us to bump achievement and
-
// score values for testing
-
-
private double ach1 = 0;
-
private double ach2 = 0;
-
private double ach3 = 0;
-
private double ach4 = 0;
-
-
private long score1 = 1000;
-
private long score2 = 200;
-
-
private int buttonWidth = 120;
-
private int buttonHeight = 50;
-
private int buttonGap = 10;
-
-
{
-
}
-
-
// authentication
-
-
{
-
}
-
}
-
-
{
-
}
-
}
-
-
{
-
}
-
}
-
-
private void HandleAchievementDescriptionsLoaded ( IAchievementDescription [ ] achievementDescriptions )
-
{
-
}
-
}
-
-
// achievements
-
-
{
-
}
-
}
-
-
{
-
}
-
-
public void ShowAchievements ( )
-
{
-
}
-
}
-
-
// leaderboard
-
-
{
-
}
-
}
-
-
{
-
}
-
-
public void ShowLeaderboard ( )
-
{
-
}
-
}
-
-
// gui
-
-
{
-
// four buttons, allowing us to bump and test setting achievements
-
int yDelta = buttonGap;
-
ach1 = (ach1 == 100 ) ? 0 : ach1 + 10;
-
}
-
yDelta += buttonHeight + buttonGap;
-
ach2 = (ach2 == 100 ) ? 0 : ach2 + 10;
-
}
-
yDelta += buttonHeight + buttonGap;
-
ach3 = (ach3 == 100 ) ? 0 : ach3 + 10;
-
}
-
yDelta += buttonHeight + buttonGap;
-
ach4 = (ach4 == 100 ) ? 0 : ach4 + 10;
-
}
-
// show achievements
-
yDelta += buttonHeight + buttonGap;
-
ShowAchievements ( );
-
}
-
-
// two buttons, allowing us to bump and test setting high scores
-
yDelta = buttonGap;
-
score1 += 500;
-
}
-
yDelta += buttonHeight + buttonGap;
-
score2 += 100;
-
}
-
// show leaderboard
-
yDelta += buttonHeight + buttonGap;
-
ShowLeaderboard ( );
-
}
-
}
-
}
【转】Unity3.5 GameCenter基础教程
最新推荐文章于 2024-08-12 17:28:06 发布