本文整理汇总了C#中Achievement类的典型用法代码示例。如果您正苦于以下问题:C# Achievement类的具体用法?C# Achievement怎么用?C# Achievement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Achievement类属于命名空间,在下文中一共展示了Achievement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start () {
this.inventory = new List<Item>();
this.offered = new List<Item>();
var manager = GameObject.Find("GameHandler").GetComponent<AchievementManager>();
achHungryPanda = manager.GetAchievement("hungry_panda");
}
示例2: UIAchievementListItem
public UIAchievementListItem(Achievement achievement)
{
this.BackgroundColor = new Color(26, 40, 89) * 0.8f;
this.BorderColor = new Color(13, 20, 44) * 0.8f;
this._achievement = achievement;
this.Height.Set(82f, 0f);
this.Width.Set(0f, 1f);
this.PaddingTop = 8f;
this.PaddingLeft = 9f;
int iconIndex = Main.Achievements.GetIconIndex(achievement.Name);
this._iconIndex = iconIndex;
this._iconFrameUnlocked = new Rectangle(iconIndex % 8 * 66, iconIndex / 8 * 66, 64, 64);
this._iconFrameLocked = this._iconFrameUnlocked;
this._iconFrameLocked.X = this._iconFrameLocked.X + 528;
this._iconFrame = this._iconFrameLocked;
this.UpdateIconFrame();
this._achievementIcon = new UIImageFramed(TextureManager.Load("Images/UI/Achievements"), this._iconFrame);
base.Append(this._achievementIcon);
this._achievementIconBorders = new UIImage(TextureManager.Load("Images/UI/Achievement_Borders"));
this._achievementIconBorders.Left.Set(-4f, 0f);
this._achievementIconBorders.Top.Set(-4f, 0f);
base.Append(this._achievementIconBorders);
this._innerPanelTopTexture = TextureManager.Load("Images/UI/Achievement_InnerPanelTop");
this._innerPanelBottomTexture = TextureManager.Load("Images/UI/Achievement_InnerPanelBottom");
this._categoryTexture = TextureManager.Load("Images/UI/Achievement_Categories");
}
示例3: InvokeIfNotNull
public static void InvokeIfNotNull(this AchievementUnlockedDelegate achievementUnlockedDelegate, Achievement achievement)
{
if (achievementUnlockedDelegate != null)
{
achievementUnlockedDelegate(achievement);
}
}
示例4: AchievementToast
/// <summary>
/// Constructor
/// </summary>
/// <param name="achv">Associated achievement</param>
/// <param name="duration">Duration to stay visible (ms)</param>
/// <param name="position">Starting position</param>
/// <param name="width"></param>
/// <param name="height"></param>
public AchievementToast(Achievement achv, int duration, Vector2 position, int width, int height)
{
title = achv.Name;
description = achv.Description;
age = 0;
lifespan = duration;
this.position = position;
this.width = width;
this.height = height;
banner = SpriteDatabase.GetAnimation("achievement_banner").Texture;
// Yellow particles spew out on the left and right in semi-circles away from the banner
leftSpewer = new ParticleSpewer(
position.X+53, position.Y + 52,
10000, 30, MathHelper.ToRadians(90), MathHelper.ToRadians(270),
0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f);
leftSpewer.Absolute = true;
leftSpewer.Start();
rightSpewer = new ParticleSpewer(
position.X + width, position.Y + 52,
10000, 30, MathHelper.ToRadians(-90), MathHelper.ToRadians(90),
0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f);
rightSpewer.Absolute = true;
rightSpewer.Start();
}
示例5: Achievement_t
/// <summary>
/// Creates an Achievement. You must also mirror the data provided here in
/// https://partner.steamgames.com/apps/achievements/yourappid
/// </summary>
/// <param name="achievement">The "API Name Progress Stat" used to uniquely identify the achievement.</param>
/// <param name="name">The "Display Name" that will be shown to players in game and on the Steam Community.</param>
/// <param name="desc">The "Description" that will be shown to players in game and on the Steam Community.</param>
public Achievement_t(Achievement achievementID, string name, string desc)
{
_eAchievementID = achievementID;
m_strName = name;
m_strDescription = desc;
_bAchieved = false;
}
示例6: createAchievement2
private static Achievement createAchievement2()
{
Achievement a = new Achievement();
a.name = "Beatles and Rolling Stones";
a.description = "Sing at least one beatles and at least one rolling stones song.";
a.ID = 0;
a.image = AchievementImage.Image1;
a.statementsAnd = true;
a.selectList = new AchievementSelect[2];
AchievementSelect select = new AchievementSelect();
select.startDate = DateTime.MinValue;
select.endDate = DateTime.MaxValue;
select.selectKeyword = SelectKeyword.CountGTE;
select.selectValue = "1";
select.clauseKeyword = ClauseKeyword.Artist;
select.clauseValue = "Rolling Stones";
a.selectList[0] = select;
AchievementSelect select2 = new AchievementSelect();
select2.startDate = DateTime.MinValue;
select2.endDate = DateTime.MaxValue;
select2.selectKeyword = SelectKeyword.CountGTE;
select2.selectValue = "1";
select2.clauseKeyword = ClauseKeyword.Artist;
select2.clauseValue = "Beatles";
a.selectList[1] = select2;
a.isPermanant = false;
a.visible = true;
return a;
}
示例7: AchievementSellScreen
public AchievementSellScreen(Game game, Achievement achievement)
: base(game)
{
this.achievement = achievement;
this.UpdateOrder = -1;
this.DrawOrder = 1002;
}
示例8: Frame
public override void Frame(double frameTime)
{
base.Frame(frameTime);
Achievement achv = m_guinan.GetCurrentAchievement();
//send achievement if it's different than the last one or more than 5s have passed
if (((achv != null && m_achievementStopwatch.IsRunning == false)
||(achv != null && m_achievementStopwatch.ElapsedMilliseconds > 5000))
||(achv != m_lastAchivement && achv != null))
{
m_achievementStopwatch.Reset();
m_achievementStopwatch.Start();
m_lastAchivement = achv;
sendAchievement(achv);
}
//send player data if session is started and data hasnt been set yet
if(m_statTracker.SessionStarted() && !m_playerdatasent)
{
RecursionTracker.StatTracker.SessionStats sessionStats = m_statTracker.GetSessionStats();
Player player = m_statTracker.GetPlayer();
m_playerdatasent = true;
sendPlayerData(player, sessionStats);
}
//reset playerdata bool
else if(!m_statTracker.SessionStarted() && m_playerdatasent)
{
m_playerdatasent = false;
}
}
示例9: TestAchievement
public void TestAchievement()
{
var achievement = new Achievement(Name, Description);
Assert.AreEqual(Name, achievement.Name);
Assert.AreEqual(Description, achievement.Description);
Assert.IsFalse(achievement.IsAchieved);
}
示例10: PlayerWithAchievement
public PlayerWithAchievement(Player player, int levelOfAchievement, string toNextLevelLabel, Achievement achievement)
{
Player = player;
LevelOfAchievement = levelOfAchievement;
ToNextLevelLabel = toNextLevelLabel;
Achievement = achievement;
}
示例11: DrawableAchievement
public DrawableAchievement(SceneManager sceneManager, Achievement achievement)
{
_title = achievement.Name;
_description = achievement.Description;
_imagePath = achievement.ImagePath;
_isOwned = achievement.IsOwned;
_sceneManager = sceneManager;
}
示例12: ShowAchievement
public static void ShowAchievement(Achievement a, string comm)
{
if (a == null) return;
AchievementForm f = new AchievementForm();
f.achievement = a;
ShowNotification(f, comm);
}
示例13: AlreadyContainsAchievement
public bool AlreadyContainsAchievement(Achievement.Categ type)
{
foreach (Achievement achiev in Achievements)
if (achiev.categ.Equals(type))
return true;
return false;
}
示例14: Post
public HttpResponseMessage Post(Achievement achievement)
{
var hubContext = GlobalHost.ConnectionManager.GetHubContext<Notify>();
hubContext.Clients.NewAchievement(achievement.Message);
return Request.CreateResponse(HttpStatusCode.OK);
}
示例15: UpdateInner
protected override void UpdateInner(UpdateContext updateContext)
{
_achievementShowTimer.Update(updateContext);
if (_currentAchievement != null && _achievementShowTimer.HasFinished)
{
_currentAchievement = null;
}
}