API
The Heathen Steam API wrapper

Introduction

The Heathen API provides access to the full Steam API wrapping every interface with a Unity friendly static class, simplifying use of the raw API without reducing its funcitonality and exposing every callback as a UnityEvent and every callresult as a Unity firendly Action.
We have wrapped every interface (except Networking interfaces) and copied its relivent documentaiton meaning you can now explore Valve's own documentaiton in yoru IDE via intellisense, take full advantage of auto complete and sugestions and explore the full API via the object explorer.
Why not wrap the networking interfaces?
We feel networking is best served working directly against the API with no "middle layer" sitting between. We are happy to revisit this if there is a community demand for it.

Is this just Facepunch from Heathen?

No
We are still built on top of Steamworks.NET something we feel strongly about as it provides an unadultrated view of the Steam API making it possible for you to leverage decades of community guides, sample code, the offical Steam Developer forums and support channels from Valve, etc.
Heathen's API does wrap the raw Steam API up as an extension to Steamworks.NET making it not just C# friendly but more Unity native. You could say what Facepunch does for a C# programmer Heathen does for a Unity programmer, Unity designer, C# programmer, C/C++ programmer, etc.

Features

Platform Smart

Every interface has been organized into subsclasses (.Client and .Server) making it clear what is available to the client, to a server or both. This works with conditional compile optionally stripping away code that is not available to the current build platform.
EXAMPLES
1
//Clearly client only
2
API.StatsAndAchievements.Client.ClearAchievement(achievement);
3
4
//Clearly server only
5
API.StatsAndAchievements.Server.ClearUserAchievement(user, achievement);
Copied!

Simply C#

Valve's Steam API is big, powerful and written in C and C++ ... not exsactly friendly to many of the tride and true patterns and structures we use in C#. Heathen's API still exploses the traditional methods but also provides C# based alternatives.
TRADITIONAL
1
var count = API.StatsAndAchievements.Client.GetNumAchievements();
2
var results = new string[count];
3
for (int i = 0; i < count; i++)
4
{
5
results[i] = API.StatsAndAchievements.Client.GetAchievementName(i);
6
}
Copied!
MODERN
1
var results = API.StatsAndAchievements.Client.GetAchievementNames();
Copied!

Unity Native

Steam API makes heavy use of callbacks and callresults which is Valve's answer to deligates. In Unity we normaly use UnityEvents (for callbacks) and Actions (for callresults). Heathen's API wraps every occasion of callback and callresult with the appropreate Unity native equivlent managing the memory for you.
RAW STEAM API
1
if (m_NumberOfCurrentPlayers_t == null)
2
m_NumberOfCurrentPlayers_t = CallResult<NumberOfCurrentPlayers_t>.Create();
3
4
var handle = SteamUserStats.GetNumberOfCurrentPlayers();
5
m_NumberOfCurrentPlayers_t.Set(handle, (result, IOFailure) =>
6
{
7
//Do work here
8
});
Copied!
MODERN
1
API.StatsAndAchievements.GetNumberOfCurrentPlayers((result, IOFailure) =>
2
{
3
//Do work here
4
});
Copied!
Last modified 2mo ago