Exemplo n.º 1
0
    // select a pallet

    public void SetPallet(int pallet)
    {
        Trophies.Unlock(trophyID, (bool success) => {
            palletChanged.RuntimeValue = success;
            if (success)
            {
                Debug.Log("Success!");
            }
            else
            {
                Debug.Log("Something went wrong");
            }
        });



        palletDatabase.currentPallet.RuntimeValue = pallet;
        PalletSwap swap = (PalletSwap)GameObject.FindObjectOfType(typeof(PalletSwap));

        if (swap != null)
        {
            swap.SwapPallets();
        }
        Debug.Log(swap);
    }
Exemplo n.º 2
0
        public void UnlockTrophy()
        {
            Debug.Log("Unlock Trophy. Click to see source.");

            var trophyId = TrophyIdField.text != string.Empty ? int.Parse(TrophyIdField.text) : 0;

            Trophies.Unlock(trophyId, success => {
                AddConsoleLine("Unlock Trophy {0}.", success ? "Successful" : "Failed");
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Unlock the <see cref="Trophy"/>.
        /// </summary>
        /// <param name="callback">A callback function accepting a single parameter, a boolean indicating success.</param>
        /// <remarks>
        /// <para>
        /// Shortcut for <c>GameJolt.API.Trophies.Unlock(this);</c>
        /// </para>
        /// </remarks>
        public void Unlock(Action <bool> callback = null)
        {
            Trophies.Unlock(this, success => {
                Unlocked = success;

                if (callback != null)
                {
                    callback(success);
                }
            });
        }
Exemplo n.º 4
0
 IEnumerator myCor()
 {
     if (locked.GetLock(4) == 0)
     {
         achievementNotificationController.ShowNotification(database.achievements[4]);
         locked.Unlock(4);
         locked.Date(4);
         moveSpeed = 0f;
         yield return(new WaitForSeconds(3));
     }
     ded.Dead();
 }
Exemplo n.º 5
0
    IEnumerator myCor()
    {
        task.SetActive(false);
        achievementNotificationController.ShowNotification(database.achievements[0]);
        locked.Unlock(0);
        locked.Date(0);
        yield return(new WaitForSeconds(3));

        //task.SetActive(true);

        SceneManager.LoadScene(levelName);
    }
    // Use this for initialization
    void Awake()
    {
        int    scoreValue = (int)(currentTime.RuntimeValue * 100); // The actual score.
        string scoreText  = FormatTime(currentTime.RuntimeValue);  // A string representing the score to be shown on the website.
        string extraData  = "";                                    // This will not be shown on the website. You can store any information.

        if (GameJoltAPI.Instance.CurrentUser != null)
        {
            GameJolt.API.Scores.Add(scoreValue, scoreText, timerScoreID, extraData, (bool success) => {
                Debug.Log(string.Format("Time Score Add {0}.", success ? "Successful" : "Failed"));
            });
        }
        scoreValue = deathCount.RuntimeValue;                              // The actual score.
        scoreText  = string.Format("{0} splats", deathCount.RuntimeValue); // A string representing the score to be shown on the website.
        extraData  = "";                                                   // This will not be shown on the website. You can store any information.
        if (GameJoltAPI.Instance.CurrentUser != null)
        {
            GameJolt.API.Scores.Add(scoreValue, scoreText, deathsScoreID, extraData, (bool success) => {
                Debug.Log(string.Format("Death Score Add {0}.", success ? "Successful" : "Failed"));
            });
        }

        if (bestTime.RuntimeValue > currentTime.RuntimeValue || bestTime.RuntimeValue == bestTime.InitialValue)
        {
            bestTime.RuntimeValue = currentTime.RuntimeValue;
        }

        if (GameJoltAPI.Instance.CurrentUser == null)
        {
            return;
        }

        if (!completed.RuntimeValue)
        {
            Trophies.Unlock(trophyID, (bool success) => {
                completed.RuntimeValue = success;
                if (success)
                {
                    Debug.Log("Success!");
                }
                else
                {
                    Debug.Log("Something went wrong");
                }
            });
        }
        completed.RuntimeValue = true;
    }
Exemplo n.º 7
0
    IEnumerator myCor()
    {
        int i = 0;

        switch (Name.name)
        {
        case "Cameras":
            i = 1;
            break;

        case "QTE":
            i = 2;
            break;

        case "Painting":
            i = 3;
            break;

        default:
            i = 0;
            break;
        }

        if (locked.GetLock(i) == 0)
        {
            task.SetActive(false);
            achievementNotificationController.ShowNotification(database.achievements[i]);
            locked.Unlock(i);
            locked.Date(i);
        }
        yield return(new WaitForSeconds(3));

        task.SetActive(true);
        if (i == 3)
        {
            end.End();
        }
        if (i == 1)
        {
            TaskText.text = "go upstairs";
        }
    }
 public void Unlock()
 {
     if (GameJoltAPI.Instance.CurrentUser == null)
     {
         return;
     }
     if (trophyID > 0 && !trophyUnlocked.RuntimeValue)
     {
         Trophies.Unlock(trophyID, (bool success) => {
             trophyUnlocked.RuntimeValue = success;
             if (success)
             {
                 Debug.Log("Success!");
             }
             else
             {
                 Debug.Log("Something went wrong");
             }
         });
     }
 }
Exemplo n.º 9
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (GameJoltAPI.Instance.CurrentUser == null)
        {
            return;
        }
        Scene scene = SceneManager.GetActiveScene();

        if (currentLevel.RuntimeValue == 24 && !trophy25Unlocked.RuntimeValue)
        {
            Trophies.Unlock(level25, (bool success) => {
                trophy25Unlocked.RuntimeValue = success;
                if (success)
                {
                    Debug.Log("Success!");
                }
                else
                {
                    Debug.Log("Something went wrong");
                }
            });
        }

        if (currentLevel.RuntimeValue == 49 && !trophy50Unlocked.RuntimeValue)
        {
            Trophies.Unlock(level50, (bool success) => {
                trophy50Unlocked.RuntimeValue = success;
                if (success)
                {
                    //Debug.Log("Success!");
                }
                else
                {
                    Debug.Log("Something went wrong");
                }
            });
        }

        if (currentLevel.RuntimeValue == 74 && !trophy75Unlocked.RuntimeValue)
        {
            Trophies.Unlock(level75, (bool success) => {
                trophy75Unlocked.RuntimeValue = success;
                if (success)
                {
                    //Debug.Log("Success!");
                }
                else
                {
                    Debug.Log("Something went wrong");
                }
            });
        }

        if (collision.tag == "Player" && trophyID > 0 && !trophyUnlocked.RuntimeValue)
        {
            Trophies.Unlock(trophyID, (bool success) => {
                trophyUnlocked.RuntimeValue = success;
                if (success)
                {
                    Debug.Log("Success!");
                }
                else
                {
                    Debug.Log("Something went wrong");
                }
            });
        }
    }