Basically I am using Unity and it used c#. I want to program procedurally. Can I mimick this with static namespaces and static classes, so that I can use the static namespaces as "header files", so I dont have to instantiate a bunch of singletons. How is this performance wise?
For example:
namespace Balls
{
public static Ball [] balls;
public static class Balls
{
public static void UpdateBalls (){}
}
}
Another file:
using static Balls;
namespace Player
{
public static class Player
{
public static bool PlayerAlive;
public static Vector3 position;
public static void UpdatePlayer ()
{
for (int i=0; i<balls.Length; i++)
{
if (position == balls[i].position)
{
PlayerAlive = false;
}
}
}
}
}
Another file:
using static Balls;
using static Player;
namespace Main
{
public static class Main
{
public static void MainUpdate ()
{
if (PlayerAlive)
{
UpdateBalls ();
UpdatePlayer ();
}
}
}
}