コード例 #1
0
ファイル: JournalPage.cs プロジェクト: AlmostMatt/LD48
 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);
     }
 }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
ファイル: DiggingPlayer.cs プロジェクト: AlmostMatt/LD48
    // 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;
        }
    }
コード例 #4
0
ファイル: LookalikeBody.cs プロジェクト: AlmostMatt/LD48
    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
            }
        }
    }
コード例 #5
0
ファイル: DiggingPlayer.cs プロジェクト: AlmostMatt/LD48
    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);
        }
    }
コード例 #6
0
ファイル: DiggingPlayer.cs プロジェクト: AlmostMatt/LD48
    // 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;
    }
コード例 #7
0
ファイル: DiggingUIOverlay.cs プロジェクト: AlmostMatt/LD48
 private void Start()
 {
     sSingleton = this;
 }