public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count == 0) { EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Input"; InputEvents.Add(InputLink); } /* if(OutputEvents.Count != NumberOfOutputs) * { * for(int CurrentLink = OutputEvents.Count; CurrentLink < NumberOfOutputs; ++CurrentLink) * { * EntityLink<MonsterTestBase> OutputLink = new EntityLink<MonsterTestBase>(); * OutputLink.SetOwner(this); * OutputLink.Name = "Option " + CurrentLink; * OutputEvents.Add(OutputLink); * } * * for(int CurrentLink = NumberOfOutputs; CurrentLink < OutputEvents.Count;) * { * OutputEvents[CurrentLink].BreakAllLinks(); * OutputEvents.RemoveAt(CurrentLink); * } * }*/ }
public void Start() { //TODO Add weapons to the player weaponSystems = GameObject.Find(Player.NAME).GetComponents <WeaponSystem>(); InputEvents.Add(this); }
public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count != 1) { InputEvents.Clear(); EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Start Dialogue"; InputEvents.Add(InputLink); } if (OutputEvents.Count != 3) { EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Finished"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Problem Encountered"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Navigation Required"; OutputEvents.Add(OutputLink); } }
/// <summary> /// Registers the event for a given action. /// </summary> /// <param name="action">Action.</param> /// <param name="callback">Callback.</param> public void RegisterEvent(InputActions action, EventHandler callback) { if (!InputEvents.ContainsKey(action)) { InputEvents.Add(action, null); } InputEvents[action] += callback; }
public void Update(double timeOffset) { if (IsRecording) { EventsRecordedThisFrame.Clear(); for (int i = 0; i < Keyboard.NumberOfKeys; i++) { if (mRecordingKeyPushed && InputManager.Keyboard.KeyPushed((Keys)i)) { InputEvent <Keys, Keyboard.KeyAction> newEvent = new InputEvent <Keys, Keyboard.KeyAction>( timeOffset + TimeManager.CurrentTime - TimeRecordingStarted, (Keys)i, Keyboard.KeyAction.KeyPushed); InputEvents.Add(newEvent); EventsRecordedThisFrame.Add(newEvent); InputEvents.Sort(); } else if (mRecordingKeyTyped && InputManager.Keyboard.KeyTyped((Keys)i)) // Typed is true when pushed, so don't want to double the info { InputEvent <Keys, Keyboard.KeyAction> newEvent = new InputEvent <Keys, Keyboard.KeyAction>( timeOffset + TimeManager.CurrentTime - TimeRecordingStarted, (Keys)i, Keyboard.KeyAction.KeyTyped); InputEvents.Add(newEvent); EventsRecordedThisFrame.Add(newEvent); InputEvents.Sort(); } if (mRecordingKeyReleased && InputManager.Keyboard.KeyReleased((Keys)i)) { InputEvent <Keys, Keyboard.KeyAction> newEvent = new InputEvent <Keys, Keyboard.KeyAction>( timeOffset + TimeManager.CurrentTime - TimeRecordingStarted, (Keys)i, Keyboard.KeyAction.KeyReleased); InputEvents.Add(newEvent); EventsRecordedThisFrame.Add(newEvent); InputEvents.Sort(); } } } }
public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count == 0) { EntityLink <MonsterTest> InputLink = new EntityLink <MonsterTest>(); InputLink.SetOwner(this); InputLink.Name = "Test Started"; InputEvents.Add(InputLink); InputLink = new EntityLink <MonsterTest>(); InputLink.SetOwner(this); InputLink.Name = "Test Failed To Start"; InputEvents.Add(InputLink); } }
public override void CreateStaticNodesIfNotPresent() { base.CreateStaticNodesIfNotPresent(); if (InputEvents.Count != 3) { InputEvents.Clear(); EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Start New Game"; InputEvents.Add(InputLink); InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Load Saved Game"; InputEvents.Add(InputLink); InputLink = new EntityLink <MonsterTestBase>(); InputLink.SetOwner(this); InputLink.Name = "Quit"; InputEvents.Add(InputLink); } if (OutputEvents.Count != 3) { EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Started"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Game Failed To Start"; OutputEvents.Add(OutputLink); OutputLink = new EntityLink <MonsterTestBase>(); OutputLink.SetOwner(this); OutputLink.Name = "Quit"; OutputEvents.Add(OutputLink); } }