private void Test() { var factory = new Factory <IComponent>(); var c1 = factory.Create("StructA"); Logger.Log(c1.GetType().ToString()); }
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); }); }); }
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); }
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()); } } }
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); }