'No overload for 'Update' matches delegate 'Action<UnityModManager.ModEntry,float>'
I'm updating a mod for Planetbase but the entry method gives me issues. The error is:
No overload for 'Update' matches delegate 'Action<UnityModManager.ModEntry,float>'
Here is the snipped of the source code that I have problem with, error at line 13:
using Planetbase;
using UnityEngine;
using System;
using UnityModManagerNet;
namespace Tahvohck_Mods
{
public class BetterHours_Main
{
[LoaderOptimization(LoaderOptimization.NotSpecified)]
public static void Init(UnityModManager.ModEntry modData)
{
modData.OnUpdate = Update;
}
#pragma warning disable IDE0060 // Remove unused parameter
public void Update(UnityModManager.ModEntry modData, PlanetDefinition planetDefinition)
#pragma warning restore IDE0060 // Remove unused parameter
{
StatsCollector sCollector = Singleton<StatsCollector>.getInstance();
EnvironmentManager eManager = Singleton<EnvironmentManager>.getInstance();
_ = (Singleton<EnvironmentManager>.getInstance().getDayTime() + Singleton<EnvironmentManager>.getInstance().getNightTime()) / 6f;
if (sCollector != null && eManager != null)
{
float dayHours = (float)GetDayHours(planetDefinition);
_ = (float)((eManager.getDayTime() + (double)eManager.getNightTime()) / (dayHours / 6.0));
}
}
Help would be welcome as I just started working with Planetbase mods.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
