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 a827eef

Browse files
committed
small refactor and cleanup
1 parent 3dcd1a7 commit a827eef

File tree

13 files changed

+14
-34
lines changed

13 files changed

+14
-34
lines changed

‎Assets/RenderHeads/Sample/Scripts/GameManager.cs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// (C) RenderHeads PTY LTD
22
// Author: Shane Marks
3+
34
using System;
45
using System.Collections;
56
using System.Collections.Generic;
@@ -30,8 +31,7 @@ public class GameManager : MonoBehaviour
3031
/// </summary>
3132
[SerializeField]
3233
private GameView _gameView = null;
33-
34-
34+
3535
/// <summary>
3636
/// We want to use AWAKE so our modules initialize before everything else.
3737
/// </summary>
@@ -47,7 +47,6 @@ void Awake()
4747
//declare our mover module for moving objects around
4848
_moverModule = new MoverModule(_spawnerModule);
4949

50-
5150
//add our modules to the factory so they can be accessed outside this scope.
5251
_factory.AddModule(_spawnerModule);
5352
_factory.AddModule(_moverModule);
@@ -84,7 +83,6 @@ private void SetupViewCallbacks()
8483
_moverModule.Start();
8584
}
8685
};
87-
8886
}
8987

9088
/// <summary>

‎Assets/RenderHeads/Sample/Scripts/GameView.cs‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// (C) RenderHeads PTY LTD
22
// Author: Shane Marks
3+
34
using System;
45
using System.Collections;
56
using System.Collections.Generic;
@@ -38,18 +39,12 @@ void Start()
3839
_spawnButton.onClick.AddListener(() => { OnSpawnerClick.Invoke(); });
3940
_moverButton.onClick.AddListener(() => { OnMoverClick.Invoke(); });
4041
}
41-
42-
43-
44-
// Update is called once per frame
42+
4543
void Update()
4644
{
4745
_countLabel.text = $"Total Spawned: {_spawnerModule.GetSpawnCount()}";
4846
_spawnButtonText.text = $"{(_spawnerModule.IsSpawning() ? "Stop" : "Start")} spawning";
4947
_moveButtonText.text = $"{(_moverModule.IsMoving() ? "Stop" : "Start")} moving";
50-
51-
52-
5348
}
5449
}
5550
}

‎Assets/RenderHeads/Sample/Scripts/Modules/IMoverModule.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// (C) RenderHeads PTY LTD
22
// Author: Shane Marks
3+
34
namespace RenderHeads.Tooling.Core.ModulePattern.Sample
45
{
56
public interface IMoverModule : IModule
@@ -13,12 +14,11 @@ public interface IMoverModule : IModule
1314
/// stop moving objects
1415
/// </summary>
1516
void Stop();
16-
17-
17+
1818
/// <summary>
1919
/// Returns if objects are moving (started = true)
2020
/// </summary>
2121
/// <returns> Returns if objects are moving (started = true)</returns>
2222
bool IsMoving();
2323
}
24-
}
24+
}

‎Assets/RenderHeads/Sample/Scripts/Modules/ISpawnerModule.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// (C) RenderHeads PTY LTD
22
// Author: Shane Marks;
3+
34
using System.Collections.Generic;
45
using UnityEngine;
56

67
namespace RenderHeads.Tooling.Core.ModulePattern.Sample
78
{
89
public interface ISpawnerModule : IModule
910
{
10-
1111
/// <summary>
1212
/// Return total amount of spawn objects since the start of the game
1313
/// </summary>
@@ -19,7 +19,6 @@ public interface ISpawnerModule : IModule
1919
/// </summary>
2020
void Stop();
2121

22-
2322
/// <summary>
2423
/// Start spawning
2524
/// </summary>
@@ -36,7 +35,5 @@ public interface ISpawnerModule : IModule
3635
/// </summary>
3736
/// <returns>Returns if the spawner is spawning</returns>
3837
bool IsSpawning();
39-
40-
4138
}
4239
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public void UpdateModule()
5050
{
5151
go.transform.position = new Vector3(go.transform.position.x, go.transform.position.y + Mathf.Sin(_delta)*0.1f, go.transform.position.z);
5252
}
53-
54-
5553
}
5654
public bool IsMoving()
5755
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// (C) RenderHeads PTY LTD
22
// Author: Shane Marks
3+
34
using System;
45
using System.Collections.Generic;
56
using UnityEngine;

‎Packages/RH.ModulePattern/Runtime/Scripts/DefaultModuleFactory.cs‎ renamed to ‎Packages/RH.ModulePattern/Runtime/DefaultModuleFactory.cs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//(C) RenderHeads PTY LTD 2021
22
//Author: Ross Borchers
3+
34
using System;
45
using System.Collections.Generic;
56
using UnityEngine;
@@ -46,9 +47,7 @@ public static IModuleFactory[] GetAll()
4647
{
4748
return _all.ToArray();
4849
}
49-
50-
51-
50+
5251
/// <summary>
5352
/// [Dangerous] Finds all modules of type in ALL registered default module factories across ALL SCENES. Only use for 'singleton' modules
5453
/// </summary>
@@ -204,6 +203,5 @@ public List<IModule> GetModules()
204203
{
205204
return _modules;
206205
}
207-
208206
}
209-
}
207+
}

‎Packages/RH.ModulePattern/Runtime/Scripts/IModule.cs‎ renamed to ‎Packages/RH.ModulePattern/Runtime/IModule.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public interface IModule
1717
/// </summary>
1818
void UpdateModule();
1919
}
20-
}
20+
}

0 commit comments

Comments
(0)

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