예제 #1
0
        private void Test()
        {
            var factory = new Factory <IComponent>();
            var c1      = factory.Create("StructA");

            Logger.Log(c1.GetType().ToString());
        }
예제 #2
0
        private void TestRepeat()
        {
            var timer = _timeManager.RepeatCall(0.5f, () => {
                Logger.Log("repeat call");
            });

            _timeManager.Call(4.0f, () => {
                timer.Pause();
                _timeManager.Call(3.0f, () => {
                    timer.Resume();
                    _timeManager.Call(3.0f, timer.Stop);
                });
            });
        }
예제 #3
0
        public static void Example()
        {
            var loader = new JsonLoader();
            var data   = loader.LoadObject <Data>("TestLoader/config");

            foreach (var actor in data.Actors)
            {
                Logger.Log(actor.Value.GetType().ToString());
            }

            var zombie = data.Actors.Values.First(actor => actor is Zombie) as Zombie;

            Logger.Log(zombie?.SomeZombieField);
        }
예제 #4
0
        private void TestWithRemoteConfig()
        {
            LoadConfig();

            void LoadConfig()
            {
                var loader = new JsonLoader();
                var data   = loader.LoadObject <ConfigData>("config");//objects creating by factory inside TypeBaseConverter

                foreach (var item in data.Components)
                {
                    Logger.Log(item.Value.GetType().ToString());
                }
            }
        }
예제 #5
0
        private void TestBase()
        {
            var timer = _timeManager.Call(1.0f, () => {
                Logger.Log("Pause Call");
            });

            timer.Pause();

            _timeManager.Call(1.5f, () => {
                Logger.Log("call timer");
            });

            _timeManager.Call(3.0f, () => {
                Logger.Log("Second Call");
                timer.Resume();
            });

            _timeManager.PauseAll();
            _timeManager.Call(1.0f, _timeManager.ResumeAll);
        }