public static Clicker CreateNew(EntityInstancePlugin plugin, ILevelManager level) { var newInstance = new Clicker(level); plugin.Entity.AddComponent(newInstance); return(newInstance); }
public static StDefaultComponent SaveState(Clicker clicker) { var storedClicker = new StClicker { Enabled = clicker.Enabled }; return(new StDefaultComponent { Clicker = storedClicker }); }
public override void StartLoading() { if (storedData.ComponentCase != StDefaultComponent.ComponentOneofCase.Clicker) { throw new ArgumentException("Invalid component type data passed to loader", nameof(storedData)); } var storedClicker = storedData.Clicker; Clicker = new Clicker(level) { Enabled = storedClicker.Enabled }; }