internal static void Setup()
        {
            DefaultMessageRaiser.EarlySetup();

            LSDatabaseManager.Setup();

            UnityInstance = GameObject.CreatePrimitive(PrimitiveType.Quad).AddComponent <MonoBehaviour>();
            GameObject.Destroy(UnityInstance.GetComponent <Collider>());
            UnityInstance.GetComponent <Renderer>().enabled = false;
            GameObject.DontDestroyOnLoad(UnityInstance.gameObject);

            GridManager.Setup();
            AbilityInterfacer.Setup();

            AgentController.Setup();
            TeamManager.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();

            PhysicsManager.Setup();
            ClientManager.Setup(MainGameManager.MainNetworkHelper);

            Application.targetFrameRate = 60;
            Time.fixedDeltaTime         = BaseDeltaTime;
            Time.maximumDeltaTime       = Time.fixedDeltaTime * 2;
            InputCodeManager.Setup();


            DefaultMessageRaiser.LateSetup();
        }
Example #2
0
 private static void LateSimulate()
 {
     BehaviourHelperManager.LateSimulate();
     AgentController.LateSimulate();
     PhysicsManager.LateSimulate();
     DefaultMessageRaiser.LateSimulate();
 }
Example #3
0
 internal static void LateVisualize()
 {
     DefaultMessageRaiser.LateVisualize();
     AgentController.LateVisualize();
     PhysicsManager.LateVisualize();
     BehaviourHelperManager.LateVisualize();
 }
        internal static void Setup()
        {
            DefaultMessageRaiser.EarlySetup();

            LSDatabaseManager.Setup();
            Command.Setup();

            UnityInstance = GameObject.CreatePrimitive(PrimitiveType.Quad).AddComponent <MonoBehaviour>();
            GameObject.Destroy(UnityInstance.GetComponent <Collider>());
            UnityInstance.GetComponent <Renderer>().enabled = false;
            GameObject.DontDestroyOnLoad(UnityInstance.gameObject);

            GridManager.Setup();
            AbilityDataItem.Setup();

            AgentController.Setup();
            TeamManager.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();

            PhysicsManager.Setup();
            ClientManager.Setup();

            Time.fixedDeltaTime   = BaseDeltaTime;
            Time.maximumDeltaTime = Time.fixedDeltaTime * 2;
            InputCodeManager.Setup();


            DefaultMessageRaiser.LateSetup();
            if (onSetup != null)
            {
                onSetup();
            }
        }
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (GameStarted == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            EffectManager.Deactivate();
            ClientManager.Deactivate();

            ClientManager.Quit();
            PhysicsManager.Deactivate();
            GameStarted = false;
            LSServer.Deactivate();
            DefaultMessageRaiser.LateDeactivate();
            CoroutineManager.Deactivate();

            if (MainGameManager.gameObject != null)
            {
                GameObject.Destroy(MainGameManager.gameObject);
            }
        }
Example #6
0
//		public static void Reset ()
//		{
//			LockstepManager.Deactivate ();
//			GameObject.Instantiate (MainGameManager.gameObject);
//		}

        internal static void Setup()
        {
            DefaultMessageRaiser.EarlySetup();

            LSDatabaseManager.Setup();
            Command.Setup();

            GridManager.Setup();
            InputCodeManager.Setup();
            AbilityDataItem.Setup();

            AgentController.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();

            PhysicsManager.Setup();
            ClientManager.Setup();

            Time.fixedDeltaTime   = DeltaTimeF;
            Time.maximumDeltaTime = Time.fixedDeltaTime * 2;


            DefaultMessageRaiser.LateSetup();
            if (onSetup != null)
            {
                onSetup();
            }
        }
        internal static void Execute(Command com)
        {
            AgentController cont = AgentController.InstanceManagers [com.ControllerID];

            cont.Execute(com);


            DefaultMessageRaiser.Execute(com);
        }
        internal static void Initialize(GameManager gameManager)
        {
            MainGameManager = gameManager;

            if (!Loaded)
            {
                Setup();
                Loaded = true;
            }

            InitializeHelpers();


            DefaultMessageRaiser.EarlyInitialize();
            SimulationTimer.Stop();
            SimulationTimer.Reset();
            SimulationTimer.Start();
            LSDatabaseManager.Initialize();
            LSUtility.Initialize(1);
            InfluenceCount = 0;
            Time.timeScale = 1f;
            Stalled        = true;

            FrameCount          = 0;
            InfluenceFrameCount = 0;

            ClientManager.Initialize(MainGameManager.MainNetworkHelper);

            TriggerManager.Initialize();

            GridManager.Initialize();

            TeamManager.Initialize();

            CoroutineManager.Initialize();
            FrameManager.Initialize();

            CommandManager.Initialize();

            AgentController.Initialize();
            TeamManager.LateInitialize();

            PhysicsManager.Initialize();
            PlayerManager.Initialize();
            SelectionManager.Initialize();
            InfluenceManager.Initialize();
            ProjectileManager.Initialize();

            DefaultMessageRaiser.LateInitialize();

            BehaviourHelperManager.LateInitialize();
            if (onInitialize != null)
            {
                onInitialize();
            }
        }
Example #9
0
        internal static void Initialize(ILockstepEventsHandler[] helpers, NetworkHelper networkHelper)
        {
            PlayRate = FixedMath.One;
            //PauseCount = 0;

            if (!Loaded)
            {
                Setup();
                Loaded = true;
            }



            DefaultMessageRaiser.EarlyInitialize();

            LSDatabaseManager.Initialize();
            LSUtility.Initialize(1);
            InfluenceCount = 0;
            Time.timeScale = 1f;

            Stalled = true;

            FrameCount          = 0;
            InfluenceFrameCount = 0;
            MainNetworkHelper   = networkHelper;
            AgentController.Initialize();
            ClientManager.Initialize(MainNetworkHelper);

            BehaviourHelperManager.Initialize(helpers);

            GridManager.Initialize();


            CoroutineManager.Initialize();
            FrameManager.Initialize();

            CommandManager.Initialize();


            PhysicsManager.Initialize();
            PlayerManager.Initialize();
            SelectionManager.Initialize();
            InfluenceManager.Initialize();
            ProjectileManager.Initialize();

            DefaultMessageRaiser.LateInitialize();
            BehaviourHelperManager.LateInitialize();
            if (onInitialize != null)
            {
                onInitialize();
            }
        }
        internal static void Visualize()
        {
            DefaultMessageRaiser.EarlyVisualize();
            PlayerManager.Visualize();
            MainGameManager.MainInterfacingHelper.Visualize();
            BehaviourHelperManager.Visualize();
            PhysicsManager.Visualize();
            AgentController.Visualize();
            ProjectileManager.Visualize();
            EffectManager.Visualize();

            TeamManager.Visualize();
        }
Example #11
0
        internal static void Execute(Command com)
        {
            if (!GameStarted)
            {
                Debug.LogError("BOOM");
                return;
            }
            AgentController cont = AgentController.InstanceManagers [com.ControllerID];

            cont.Execute(com);


            DefaultMessageRaiser.Execute(com);
        }
 internal static void Visualize()
 {
     if (!GameStarted)
     {
         return;
     }
     DefaultMessageRaiser.EarlyVisualize();
     PlayerManager.Visualize();
     BehaviourHelperManager.Visualize();
     AgentController.Visualize();
     ProjectileManager.Visualize();
     EffectManager.Visualize();
     CommandManager.Visualize();
 }
        internal static void Simulate()
        {
            MainGameManager.MainNetworkHelper.Simulate();
            DefaultMessageRaiser.EarlySimulate();
            if (InfluenceCount == 0)
            {
                InfluenceSimulate();
                InfluenceCount = InfluenceResolution - 1;
                if (FrameManager.CanAdvanceFrame == false)
                {
                    Stalled = true;
                    return;
                }
                Stalled = false;
                if (InfluenceFrameCount == 0)
                {
                    GameStart();
                }
                FrameManager.Simulate();
                InfluenceFrameCount++;
            }
            else
            {
                InfluenceCount--;
            }
            if (Stalled)
            {
                return;
            }

            MainGameManager.MainInterfacingHelper.Simulate();


            BehaviourHelperManager.Simulate();
            AgentController.Simulate();
            PhysicsManager.Simulate();
            CoroutineManager.Simulate();
            InfluenceManager.Simulate();
            ProjectileManager.Simulate();
            TeamManager.Simulate();

            TriggerManager.Simulate();

            LateSimulate();
            FrameCount++;
        }
Example #14
0
        internal static void Execute(Command com)
        {
            if (!GameStarted)
            {
                Debug.LogError("BOOM");
                return;
            }
            if (com.ControllerID != byte.MaxValue)
            {
                AgentController cont = AgentController.InstanceManagers [com.ControllerID];
                cont.Execute(com);
            }
            else
            {
                BehaviourHelperManager.Execute(com);
            }

            DefaultMessageRaiser.Execute(com);
        }
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (GameStarted == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            EffectManager.Deactivate();
            ClientManager.Deactivate();

            TeamManager.Deactivate();
            ClientManager.Quit();
            PhysicsManager.Deactivate();
            GameStarted = false;
            LSServer.Deactivate();
            DefaultMessageRaiser.LateDeactivate();
        }
        internal static void Deactivate()
        {
            DefaultMessageRaiser.EarlyDeactivate();

            if (Started == false)
            {
                return;
            }
            Selector.Clear();
            AgentController.Deactivate();
            MainGameManager.MainInterfacingHelper.Deactivate();
            BehaviourHelperManager.Deactivate();
            ProjectileManager.Deactivate();
            ClientManager.Deactivate();
            LockstepManager.Deactivate();

            TeamManager.Deactivate();
            ClientManager.NetworkHelper.Disconnect();
            Started = false;

            DefaultMessageRaiser.LateDeactivate();
        }
Example #17
0
 internal static void LateVisualize()
 {
     DefaultMessageRaiser.LateVisualize();
     AgentController.LateVisualize();
 }
 internal static void LateVisualize()
 {
     DefaultMessageRaiser.LateVisualize();
 }