Added UI Element and other QoL fixes for scripting #329
|
@ -259,6 +259,13 @@ namespace SHADE
|
|||
ScriptStore::RemoveScript<T>(entity);
|
||||
}
|
||||
|
||||
void GameObject::RemoveScript(Script^ script)
|
||||
{
|
||||
if (!valid)
|
||||
throw gcnew System::NullReferenceException();
|
||||
ScriptStore::RemoveScript(entity, script);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
/* Scene Graph Functions */
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
|
|
@ -259,6 +259,12 @@ namespace SHADE
|
|||
/// <typeparam name="T">Type of Scripts to remove.</typeparam>
|
||||
generic<typename T> where T : ref class, Script
|
||||
void RemoveScript();
|
||||
/// <summary>
|
||||
/// Removes a specific script from this script's parent.
|
||||
/// </summary>
|
||||
/// <param name="script">The script to remove.</param>
|
||||
/// <returns>True if successfully removed. False otherwise.</returns>
|
||||
void RemoveScript(Script^ script);
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Scene Graph Functions */
|
||||
|
|
|
@ -126,6 +126,11 @@ namespace SHADE
|
|||
ScriptStore::RemoveScript<T>(owner.GetEntity());
|
||||
}
|
||||
|
||||
void Script::RemoveScript(Script^ script)
|
||||
{
|
||||
ScriptStore::RemoveScript(owner.GetEntity(), script);
|
||||
}
|
||||
|
||||
Script::operator bool(Script^ s)
|
||||
{
|
||||
return s != nullptr;
|
||||
|
|
|
@ -198,6 +198,12 @@ namespace SHADE
|
|||
/// </typeparam>
|
||||
generic<typename T> where T : ref class, Script
|
||||
void RemoveScript();
|
||||
/// <summary>
|
||||
/// Removes a specific script from this script's parent.
|
||||
/// </summary>
|
||||
/// <param name="script">The script to remove.</param>
|
||||
/// <returns>True if successfully removed. False otherwise.</returns>
|
||||
void RemoveScript(Script^ script);
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Operator Overloads */
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace SHADE
|
|||
generic<typename T> where T : ref class, Script
|
||||
static void RemoveScript(Entity entity);
|
||||
/// <summary>
|
||||
/// Removes a specific script from the
|
||||
/// Removes a specific script from the specified entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to remove the script from.</param>
|
||||
/// <param name="script">The script to remove.</param>
|
||||
|
|
Loading…
Reference in New Issue