private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { SaveData saveData = SaveData.Get(); // update save data flags // add document string journalDesc = "Your found a page from a journal."; if (journalNum < 2) { journalDesc = "You found part of a journal."; } if (journalNum < 5) { DiggingUIOverlay.ShowPopup(journalDesc, image); AddDocument(saveData, journalNum); } else { // Popup instead of document // TODO: trigger any endgame conditions (unless that is already done elswhere) DiggingUIOverlay.ShowPopup("The journal reads:\r\n" + "Follow the lights, follow the lights, follow the lights! I’ve found a way to get back to my own world!!!", image); } Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { if (!hasShownDialog) { NewsProgression.AddNewsForNextDay(NewsProgression.ParallelResearchNews()); DiggingUIOverlay.ShowPopup("What is this? It looks so strange, like it's from another world...", "artifact"); hasShownDialog = true; } } }
// Movement and physics should happen here void FixedUpdate() { // Ignore input and stuff while not in the digging scene if (!GameLoopController.isDiggingScene() || DiggingUIOverlay.IsPopupVisible()) { mRigidbody.velocity = Vector3.zero; mRigidbody.gravityScale = 0f; return; } if (!mInputDisabled) { HandleMovement(); mRigidbody.gravityScale = (mWallClimbingLeft || mWallClimbingRight || mGrappleState != GRAPPLE_NONE) ? 0f : 1f; } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { SaveData saveData = SaveData.Get(); if (!saveData.foundBody) { NewsProgression.AddNewsForNextDay(NewsProgression.EarthquakeNews()); saveData.foundBody = true; DiggingUIOverlay.ShowPopup("Goodness gracious, is this a dead body? Why does he look... just like me!?", "deadbody"); saveData.musicStage++; saveData.activeShopItem++; // todo: email/document } } }
public void CollectItem(Collectible c) { SaveData saveData = SaveData.Get(); ItemData itemData = c.itemData; saveData.inventory[(int)itemData.itemType] += 1; PlayCollectSound(); if (!saveData.FoundItemType(itemData.itemType)) { string text = itemData.description; if (text.Length == 0) { text = "You found " + itemData.itemType.GetName() + "!"; } DiggingUIOverlay.ShowPopup(text, itemData.itemType.GetImage()); saveData.SetFoundItemType(itemData.itemType); } }
// Input and animation can happen here private void Update() { mIsTryingToDig = false; mIsDigging = false; mUsingStamina = false; var emission = digEffect.emission; // Ignore input and stuff while not in the digging scene, or if there's a popup if (!GameLoopController.isDiggingScene() || DiggingUIOverlay.IsPopupVisible() || mInputDisabled) { AnimatePausedPlayer(); emission.enabled = false; return; } HandleMouseInput(); UpdateAnimationState(); // reveal nearby tiles RevealFogTiles(); emission.enabled = mIsDigging; }
private void Start() { sSingleton = this; }