private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("player_combat_collider"))
     {
         ImproveManager improveManager = collision.transform.parent.GetComponent <ImproveManager>();
         improveManager.AddSliceBar();
         Destroy(gameObject);
     }
 }
Пример #2
0
    private void Awake()
    {
        /*string path_to_save_file = "/JSON/playerStats.json";
         * string filePath = Application.dataPath + path_to_save_file;
         * Stats stat = new Stats();
         *
         *
         * string dataAsJson = File.ReadAllText(filePath);
         *
         * stat = JsonUtility.FromJson<Stats>(dataAsJson);
         *
         * myStats = stat;*/
        //player_stats.
        //player_stats.Right_Hand_Object = new Object_InGame();

        player_stats = GetComponent <Player_Stats>();
        improveScr   = GetComponent <ImproveManager>();
        player_stats.Right_Hand_Object        = new Object_InGame();
        player_stats.Right_Hand_Object.damage = PlayerPrefs.GetInt("playerDamage");
        live_manager_scr.numHearts            = PlayerPrefs.GetInt("playerLive");
        improveScr.improveBar.fillAmount      = PlayerPrefs.GetFloat("playerImprove");

        //Debug.Log(dataAsJson);
    }