Exemple #1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        GUILayout.Label("Each level adds _add exp per lvl_ to _experience to the next lvl_.");

        GUILayout.Label("if(level % lvlDifficultyDenominator == 0)  addExpPerLvl *= difficultyMultiplier ");

        PlayerLevel plvl = (PlayerLevel)target;

        if (GUILayout.Button("ADD 15 exp"))
        {
            plvl.AddExperience(15);
        }

        if (GUILayout.Button("ADD 100 exp"))
        {
            plvl.AddExperience(100);
        }

        if (GUILayout.Button("ADD 300 exp"))
        {
            plvl.AddExperience(300);
        }
    }
Exemple #2
0
    public void KillByPlayer(GameObject player)
    {
        PlayerLevel playerLevel = player.GetComponent <PlayerLevel>();

        playerLevel.AddExperience(experience);
        GameObject ep = Instantiate(expParticles, transform.position, Quaternion.identity, transform.parent);

        ep.GetComponent <ExpParticles>().target = player.transform;
        Kill();
    }
Exemple #3
0
    void AddBonusExpOnGameFinish()
    {
        if (PhotonNetwork.IsConnectedAndReady)
        {
            if (PhotonNetwork.CurrentRoom.CustomProperties.IsNullOrEmpty() && PhotonNetwork.LocalPlayer.CustomProperties.IsNullOrEmpty()) //sometimes null here?
            {
                Debug.LogError("We have nothing to add or game isn't player yet.. return");
                return;
            }
            else
            {
                //we add final bonus exp here
                int finalEXP    = 0;
                var playerProps = PhotonNetwork.LocalPlayer.CustomProperties;

                //add team exp
                if (playerProps.ContainsKey("Team" + myTeamID.ToString()))
                {
                    int teamEXP = (int)playerProps["Team" + myTeamID.ToString()];
                    finalEXP += teamEXP;
                    Debug.Log("FINAL_TEAM_EXP :" + teamEXP);
                }

                //add player exp
                if (playerProps.ContainsKey("playerEXP"))
                {
                    int playerEXP = (int)playerProps["playerEXP"];
                    finalEXP += playerEXP;
                    Debug.Log("FINAL_PLAYER_EXP :" + playerEXP);
                }

                //add final exp
                playerLevel.AddExperience(finalEXP);
                Debug.Log("I ADDED EXP FOR PAINTBALL. AMOUNT - " + finalEXP);

                //add soft currency
                int finalSoft = PercentageUtils.GetPercentageInt(softCurrencyBonusPercent, finalEXP);
                SaveManager.Instance.AddSoftCurrency(finalSoft);
                Debug.Log("I ADDED SOFT FOR PAINTBALL. AMOUNT - " + finalSoft);

                //show everything above to our player
                resultsPanel.SetActive(true);
                resultsPanel.GetComponent <PaintBallPointsPanel>().SetResult(finalEXP, finalSoft);
            }
        }
    }