public LogicEngine() { ImgUtils.Init(); KeyUtils.WindowToSendKeysIn = Constants.KO_WINDOW; _gos = new List <GameObject>(); _initTimer = new CTimer(); _initTimer.Interval = START_DELAY * 1000; _initTimer.AutoReset = false; _updateTimer = new CTimer(); _updateTimer.Elapsed += OnUpdate; _updateTimer.AutoReset = false; _updateTimer.Interval = UPDATE_DELAY * 1000; GameObject go = new GameObject(); CharacterStateMachine sm = new CharacterStateMachine(); Character character = new Character(sm); DirComponent direction = new DirComponent(); ScreenPosition screenPos = new ScreenPosition(); go.AddComponent(screenPos); go.AddComponent(sm); go.AddComponent(direction); go.AddComponent(character); _gos.Add(go); _sendStart = true; }
public override void onAttach() { base.onAttach(); _dirComp = GetComponent <DirComponent>(); }