-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTemplate.cs
More file actions
38 lines (34 loc) · 1.26 KB
/
Template.cs
File metadata and controls
38 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Landfall.Haste;
using Landfall.Modding;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Localization;
using Zorro.Settings;
namespace $safeprojectname$;
[LandfallPlugin]
public class $safeprojectname$
{
static $safeprojectname$()
{
Debug.Log("Hello from $projectname$!");
On.PlayerCharacter.RestartPlayer_Launch_Transform_float += (orig, self, spawnPoint, minVel) =>
{
// normally it's 100
var launchSetting = GameHandler.Instance.SettingsHandler.GetSetting<HelloSetting>().Value;
minVel = Mathf.Max(minVel, launchSetting);
Debug.Log("Hooked launch! Velocity is now " + minVel);
orig(self, spawnPoint, minVel);
};
}
}
// The HasteSetting attribute is equivalent to
// GameHandler.Instance.SettingsHandler.AddSetting(new HelloSetting());
[HasteSetting]
public class HelloSetting : FloatSetting, IExposedSetting
{
public override void ApplyValue() => Debug.Log($"Mod apply value {Value}");
protected override float GetDefaultValue() => 120;
protected override float2 GetMinMaxValue() => new(100, 200);
public LocalizedString GetDisplayName() => new UnlocalizedString("mod setting!!");
public string GetCategory() => SettingCategory.General;
}