Reworked on resource loading, Added RegisterCommands overload to register commands from an instance.

This commit is contained in:
Sardelka
2022-06-24 16:49:59 +08:00
parent 82ab9237f5
commit 6167417bf8
19 changed files with 301 additions and 131 deletions

View File

@ -3,21 +3,17 @@
/// <summary>
/// Inherit from this class, constructor will be called automatically, but other scripts might have yet been loaded, you should use <see cref="OnStart"/>. to initiate your script.
/// </summary>
public abstract class ClientScript:Core.Scripting.IScriptable
public abstract class ClientScript:Core.Scripting.Scriptable
{
/// <summary>
/// This method would be called from main thread shortly after all scripts have been loaded.
/// </summary>
public abstract void OnStart();
public override abstract void OnStart();
/// <summary>
/// This method would be called from main thread when the client disconnected from the server, you MUST terminate all background jobs/threads in this method.
/// </summary>
public abstract void OnStop();
public override abstract void OnStop();
/// <summary>
/// Get the <see cref="Core.Scripting.Resource"/> object this script belongs to, this property will be initiated before <see cref="OnStart"/> (will be null if you access it in the constructor).
/// </summary>
public Core.Scripting.Resource CurrentResource { get; internal set; }
}
}