public void StartConversation(Conversation conversation) { InGameEvents.OnDialogStartedFunction(); UI_Base.Instance.DialogDisplayer.SetDialogBox(true); ConvertDialogsToQueue(conversation); conversationCoroutine = StartCoroutine(ConversationCoroutine()); }
public void Collect() { SoundManager.instance.PlaySingle(collectClip); InGameEvents.ItemCollected(this); Destroy(gameObject); GameManager.instance.AddFish(value); }
public void Collect() { SoundManager.instance.PlaySingle(collectClip); InGameEvents.ItemCollected(this); Destroy(gameObject); temperature.LowerTemperature(temperatureAmount + 1 * GameManager.instance.GetUpgradeLevels(GameManager.Upgrade.snowflake)); }
public void Die() { Analytics.CustomEvent("Died at level ", new Dictionary <string, object> { { "level", (int)(transform.position.y / levelHeight) + 1 } }); // Remove 1 life when the player dies /* * GameManager.instance.RemoveLives(1); * GameManager.instance.SaveProgress(); */ Time.timeScale = 0; InGame.playerAlive = false; // Set the max travel distance on death Distance = (int)gameObject.transform.position.y; // Set playerAlive to false youDiedScreen.SetActive(false); gameOverScreen.SetActive(true); pauseButton.SetActive(false); GameManager.instance.SaveProgress(); QuestManager.instance.UpdateQuests(); InGameEvents.GameOver(this); Destroy(gameObject); }
public void Use() { InGameEvents.ConsumableUsed(this); Count--; GameManager.instance.SetPowerupUses(GameManager.Consumable.bomb, Count); GameManager.instance.SaveProgress(); UpdateDisplay(); }
public void BackToMainMenu() { InGameEvents.OnMainMenuButtonPressedFunction(); PlayerController.Instance.ResetToDefaults(); ObjectPooler.Instance.ReturnToPool(tmpPlayer.name, tmpPlayer); TimeManager.timeScale = 1; StartCoroutine(LoadSceneWithASyncCoroutine()); }
public void OnFadeOutFinished() { switch (sceneName) { case MAIN_MENU: break; case GAME: InGameEvents.OnGameStartFunction(); break; default: break; } }
IEnumerator ConversationCoroutine() { if (conversations.Count > 0) { ConversationHolder tmpConversationHolder = conversations.Dequeue(); UI_Base.Instance.DialogDisplayer.SetConversationSettings(tmpConversationHolder.speaker.Icon, tmpConversationHolder.dialog); } else { InGameEvents.OnDialogEndedFunction(); UI_Base.Instance.DialogDisplayer.SetDialogBox(false); } yield return(null); }
public void UseItem() { if (Item != null) { Item.UseItem(); if (Amount > 0) { Amount--; } RemoveItem(); InGameEvents.OnInventoryModifiedFunction(); } }
// Snaps the blocks in place and they become fixed after that public void SnapBlock() { SoundManager.instance.PlaySnapIceBlockSoundClip(); InGameEvents.IceBlockSnapped(); // Destroy the rigidbody so that it won't move after it snapped Destroy(gameObject.GetComponent <Rigidbody2D>()); //Debug.Log("Object Snapped"); // Mark that hold has ended HoldEnded(); // Debug.Log("SnappedBlock"); for (int i = 0; i < transform.childCount; i++) { //Debug.Log(holograms[i].transform.position); Transform block = transform.GetChild(i); // Debug.Log(block); // Place each block in it's coresponding hologram position //block.position = holograms[i].transform.position; // Change the tag of each block to "FixedBlock" block.tag = "FixedBlock"; block.GetComponent <BoxCollider2D>().size = new Vector2(1f, 1f); } // Destroy all the holograms foreach (GameObject o in holograms) { Destroy(o); } // Set animator to active if (!isExtraBlock && !isBomb) { GetComponent <Animator>().enabled = true; } // Activate the breaking of ice if (!isExtraBlock && !isBomb) { GetComponent <IceBlockLife>().PlayerOnTop(); } // Center the object transform.position = new Vector3(Mathf.Round(transform.position.x), Mathf.Round(transform.position.y), transform.position.z); allowRotation = false; holograms.Clear(); // Begin breaking the iceBlock GetComponent <IceBlockLife>().PlayerOnTop(); }
public bool AddItem(Item item) { if (InventoryUI.Instance.IsInventoryFull() && Items.Contains(item) && item.stackable) { HandleItemAdd(); return(true); } else if (InventoryUI.Instance.IsInventoryFull()) { return(false); } HandleItemAdd(); return(true); void HandleItemAdd() { Items.Add(item); Items.Sort(); InGameEvents.OnInventoryModifiedFunction(); } }
public void Collect() { InGameEvents.ItemCollected(this); Destroy(gameObject); }
public void Collect() { InGameEvents.ItemCollected(this); Destroy(gameObject); GameManager.instance.AddCandy(value); }
public void OnContinueButtonPressed() { InGameEvents.OnDialogContinueButtonPressedFunction(); }
public void ClosePauseMenu() { pauseCanvas.enabled = false; TimeManager.timeScale = 1; InGameEvents.OnGameContinueFunction(); }
public void OpenPauseMenu() { pauseCanvas.enabled = true; TimeManager.timeScale = 0; InGameEvents.OnGamePausedFunction(); }