Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Stop()
{
_canMove = false;
}
public void UpdateModule()
public void UpdateModule(float? deltaTime)
{
if (!_canMove)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void Stop()
_canSpawn = false;
}

public void UpdateModule()
public void UpdateModule(float? deltaTime)
{
if (!_canSpawn)
{
Expand Down
32 changes: 16 additions & 16 deletions Packages/RH.ModulePattern/Runtime/IModule.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
//(C) RenderHeads PTY LTD 2021
//Author: Ross Borchers
using System.Collections;
using System.Collections.Generic;

namespace RenderHeads.Tooling.Core.ModulePattern
{
/// <summary>
/// Base interface for all modules, IModuleFactory requires modules inherit from this.
/// General module usage pattern is:
/// RAII. All initialization is done through the constructor. After a constructor is run the module should be fully usable.
/// UpdateModules should be called at regular intervals. The order of module updates should be controlled by the caller to ensure all dependencies have already been updated.
/// Pass in dependencies through the constructor IOC like.
/// </summary>
/// <summary>
/// Base interface for all modules, IModuleFactory requires modules inherit from this.
/// General module usage pattern is:
/// RAII. All initialization is done through the constructor. After a constructor is run the module should be fully usable.
/// UpdateModules should be called at regular intervals. The order of module updates should be controlled by the caller to ensure all dependencies have already been updated.
/// Pass in dependencies through the constructor IOC like.
/// </summary>
public interface IModule
{
/// <summary>
/// Should be called at a regular interval. The order of module updates should be controlled by the caller to ensure all dependencies have already been updated.
/// </summary>
void UpdateModule();
}
}
{/// <summary>
/// Should be called at a regular interval. The order of module updates should be controlled by the caller to ensure all dependencies have already been updated.
/// </summary>
/// <param name="delta">Pass in a deltaTime calculated in parent update, if you want to pass that into underlying update event, so thay you don't need to query it within the method</param>
void UpdateModule(float? deltaTime = null);
}
}