예제 #1
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.tag == "Player")
     {
         lum.LevelUp();
     }
 }
예제 #2
0
    public void RunGame(Stat stat)
    {
        Debug.Log("RunGame");
        moneyManager.Load();
        //DeathManager.instance.LoadRefiningData();

        UnitData playerData = (UnitData)GameDatabase.instance.playerBase.Clone();

        playerData.weapon = GetPlayerWeapon(PlayerPrefs.GetInt("exp")).id;
        playerData.stat   = stat;
        string effect = PlayerPrefs.GetString("effect");

        if (effect != string.Empty)
        {
            playerData.effects = JsonHelper.FromJson <EffectData>(effect);
        }

        boardManager.SetStage(PlayerPrefs.GetInt("stage"));

        boardManager.SpawnPlayer(playerData);

        SkillManager.instance.Load();
        Item.instance.Load();

        RageManager.instance.CheckRage();

        if (LevelUpManager.IsLevelUp)
        {
            levelUpManager.LevelUp();
        }
        else if (RollManager.instance.IsFirstRoll)
        {
            SetPause(true);
            if (IsFirstGame)
            {
                RollManager.instance.FirstGame();
            }
            else
            {
                RollManager.instance.FirstRoll();
            }
            //AudioManager.instance.PlayMusic(AudioManager.instance.GetRandomMainMusic());
        }
        else
        {
            boardManager.InitBoard();
        }

        if (playerData.stat.currentHp <= 0)
        {
            player.gameObject.SetActive(false);
            DeathManager.instance.OnDeath();
            SetSettingBtn(false);
        }
    }
    public BasePlayableCharacter(string name, int strengthPotential, int intelligencePotential, int defensePotential,
                                 int willPotential, int speedPotential, int agilityPotential) : base(name)
    {
        CurrLevel      = 0;
        CurrExp        = 1;
        ExpToNextLevel = 1;

        StrengthPotential     = strengthPotential;
        IntelligencePotential = intelligencePotential;
        DefensePotential      = defensePotential;
        WillPotential         = willPotential;
        SpeedPotential        = speedPotential;
        AgilityPotential      = agilityPotential;

        LevelUpManager.LevelUp(this);

        CurrHp = MaxHp;
        CurrMp = MaxMp;
    }