-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Add variables + Add example basic logic
- Loading branch information
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
using Rocket.Core.Plugins; | ||
using Rocket.Core.Logging; | ||
using Rocket.Core.Plugins; | ||
using Rocket.Unturned.Chat; | ||
using SDG.Unturned; | ||
using System; | ||
|
||
namespace UnturnedExamplePlugin | ||
{ | ||
public class Plugin : RocketPlugin<PluginConfiguration> | ||
{ | ||
public static Plugin Instance { get; private set; } // Your plugin variable | ||
public UnityEngine.Color MessageColor { get; private set; } // Message color variable | ||
public Random Random { get; private set; } // Randomizer variable | ||
|
||
protected override void Load() | ||
{ | ||
// Enter code for load | ||
Instance = this; // Link plugin and make this public | ||
MessageColor = UnturnedChat.GetColorFromName(Configuration.Instance.MessageColor, UnityEngine.Color.black); // Get message color from config | ||
Random = new Random(); // Create and set new Random object for use later in plugin | ||
Logger.Log(Configuration.Instance.LoadMessage); // Log load message with Rocket | ||
CommandWindow.Log($"{Name} {Assembly.GetName().Version} has been loaded!"); // Log loading info with Unturned SDG (without Rocket or other loaders) | ||
} | ||
protected override void Unload() | ||
{ | ||
// Enter code for unload | ||
CommandWindow.LogWarning($"{Name} {Assembly.GetName().Version} has been unloaded!"); // Log warning unloading info with Unturned SDG | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters