When a register a role, it threw out an error: System.NullReferenceException: Object reference not set to an instance of an object.
[Error : BepInEx] Error loading [Clash Of Gods 1.0.0-dev]: System.NullReferenceException: Object reference not set to an instance of an object.
at PeasAPI.Roles.BaseRole..ctor()
at COG.Roles.TestRole..ctor() in D:\RiderProjects\ClashOfGods\COG\Roles\TestRole.cs:line 8
at COG.Main.Load() in D:\RiderProjects\ClashOfGods\COG\Main.cs:line 50
at BepInEx.Unity.IL2CPP.IL2CPPChainloader.LoadPlugin(PluginInfo pluginInfo, Assembly pluginAssembly) in /home/runner/work/BepInEx/BepInEx/Runtimes/Unity/BepInEx.Unity.IL2CPP/IL2CPPChainloader.cs:line 134
at BepInEx.Bootstrap.BaseChainloader`1.LoadPlugins(IList`1 plugins) in /home/runner/work/BepInEx/BepInEx/BepInEx.Core/Bootstrap/BaseChainloader.cs:line 411
using PeasAPI.Roles;
using UnityEngine;
namespace COG.Roles;
public class TestRole : BaseRole
{
public TestRole() : base(Main.Instance)
{
Name = "Test";
Color = Color.green;
Description = "Just a test role";
LongDescription = "Just long description";
TaskText = "NMSL";
HasToDoTasks = true;
Visibility = Visibility.Crewmate;
Team = Team.Crewmate;
}
public override void OnTaskComplete(PlayerControl player, PlayerTask task)
{
Main.Logger.LogInfo("HHH");
}
public override string Name { get; }
public override string Description { get; }
public override string LongDescription { get; }
public override string TaskText { get; }
public override Color Color { get; }
public override Visibility Visibility { get; }
public override Team Team { get; }
public override bool HasToDoTasks { get; }
}