You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/MMTools/Tools/MMAchievements/Scripts/MMAchievementEvent.cs

53 lines
1.3 KiB
C#

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace MoreMountains.Tools
{
/// <summary>
/// An event type used to broadcast the fact that an achievement has been unlocked
/// </summary>
public struct MMAchievementUnlockedEvent
{
/// the achievement that has been unlocked
public MMAchievement Achievement;
/// <summary>
/// Constructor
/// </summary>
/// <param name="newAchievement">New achievement.</param>
public MMAchievementUnlockedEvent(MMAchievement newAchievement)
{
Achievement = newAchievement;
}
static MMAchievementUnlockedEvent e;
public static void Trigger(MMAchievement newAchievement)
{
e.Achievement = newAchievement;
MMEventManager.TriggerEvent(e);
}
}
public struct MMAchievementChangedEvent
{
/// the achievement that has been unlocked
public MMAchievement Achievement;
/// <summary>
/// Constructor
/// </summary>
/// <param name="newAchievement">New achievement.</param>
public MMAchievementChangedEvent(MMAchievement newAchievement)
{
Achievement = newAchievement;
}
static MMAchievementChangedEvent e;
public static void Trigger(MMAchievement newAchievement)
{
e.Achievement = newAchievement;
MMEventManager.TriggerEvent(e);
}
}
}