Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a715d8

Browse files
authored
Merge pull request #2 from RenderHeads/feature/updatemodule-deltatime
Proposed change to allow for deltaTime
2 parents 5662482 + 54325ef commit 0a715d8

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

‎Assets/RenderHeads/ModulePatternSample/Scripts/Modules/MoverModule.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Stop()
3737
{
3838
_canMove = false;
3939
}
40-
public void UpdateModule()
40+
public void UpdateModule(float?deltaTime)
4141
{
4242
if (!_canMove)
4343
{

‎Assets/RenderHeads/ModulePatternSample/Scripts/Modules/SpawnerModule.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void Stop()
7575
_canSpawn = false;
7676
}
7777

78-
public void UpdateModule()
78+
public void UpdateModule(float?deltaTime)
7979
{
8080
if (!_canSpawn)
8181
{
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
//(C) RenderHeads PTY LTD 2021
2-
//Author: Ross Borchers
1+
usingSystem.Collections;
2+
usingSystem.Collections.Generic;
33

44
namespace RenderHeads.Tooling.Core.ModulePattern
55
{
6-
/// <summary>
7-
/// Base interface for all modules, IModuleFactory requires modules inherit from this.
8-
/// General module usage pattern is:
9-
/// RAII. All initialization is done through the constructor. After a constructor is run the module should be fully usable.
10-
/// 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.
11-
/// Pass in dependencies through the constructor IOC like.
12-
/// </summary>
6+
/// <summary>
7+
/// Base interface for all modules, IModuleFactory requires modules inherit from this.
8+
/// General module usage pattern is:
9+
/// RAII. All initialization is done through the constructor. After a constructor is run the module should be fully usable.
10+
/// 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.
11+
/// Pass in dependencies through the constructor IOC like.
12+
/// </summary>
1313
public interface IModule
14-
{
15-
/// <summary>
16-
/// 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.
17-
/// </summary>
18-
void UpdateModule();
19-
}
20-
}
14+
{/// <summary>
15+
/// 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.
16+
/// </summary>
17+
/// <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>
18+
void UpdateModule(float?deltaTime=null);
19+
}
20+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /