private void OnTokenAdded(Object sender, EventArgs e) { TokenEventArgs tokenEventArgs = (TokenEventArgs)e; if (tokenEventArgs.TokenID == 699) { LegacyLogic.Instance.WorldManager.SaveCurrentMapData(); m_changeContext = EContext.End; LegacyLogic.Instance.WorldManager.SaveGameName = String.Empty; LegacyLogic.Instance.WorldManager.IsSaveGame = false; LegacyLogic.Instance.WorldManager.IsShowingEndingSequences = true; PlayCutsceneByID("Killed_Erebos"); } if (tokenEventArgs.TokenID == 329) { InteractiveObject interactiveObject = LegacyLogic.Instance.MapLoader.Grid.FindInteractiveObject <InteractiveObject>(123); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } interactiveObject = LegacyLogic.Instance.MapLoader.Grid.FindInteractiveObject <InteractiveObject>(88); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } } }
protected override void DoExecute() { InteractiveObject interactiveObject = Grid.FindInteractiveObject(m_targetSpawnID); if (interactiveObject == null) { throw new InvalidOperationException("Tried to execute!"); } interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); FinishExecution(); }
public override void Trigger(ConversationManager p_manager) { InteractiveObject interactiveObject = LegacyLogic.Instance.WorldManager.FindObjectBySpawnerId <InteractiveObject>(TargetSpawnerID); if (interactiveObject != null) { interactiveObject.ClearInteractions(); interactiveObject.Execute(LegacyLogic.Instance.MapLoader.Grid); interactiveObject.Update(); } else { LegacyLogger.LogError("InteractiveObject spawnerID not found! ID: " + TargetSpawnerID); } }
private void Update() { if (GlobalState.isInDialog) { return; //will not check for move input during dialog sequences } if (!EventSystem.current.IsPointerOverGameObject()) { Vector2 currentMousePos = mainCamera.ScreenToWorldPoint(Input.mousePosition); OnMousePositionChange.Invoke(currentMousePos); if (Input.GetButtonDown("Fire1")) { if (currentlyHighlighted != null) { currentlyHighlighted.Execute(); } else if (player != null) { player.StartTravel(currentMousePos); } } } }