private void Awake()
    {
        stats = GameObject.FindGameObjectWithTag("MainCharacter").GetComponent <statisticsGestion>();

        stats.onXpChange += ExpChanged;
        ExpChanged(stats.getExp());
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        stats = gameObject.GetComponent <statisticsGestion>();

        for (int i = 0; i < nbStats; i++)
        {
            lvl[i].text = stats.getLvl(i).ToString();
            dmg[i].text = stats.getModifExternal(i).ToString();
        }

        xp.text = stats.getExp().ToString();
    }
Ejemplo n.º 3
0
    private void Awake()
    {
        // Instantiate hands object
        handsWeaponObj = Instantiate(handsWeaponRef, this.transform);
        handsWeaponObj.transform.localPosition = new Vector3(0, 0, 0);
        handsWeapon = handsWeaponObj.GetComponent <MeleeWeapon>();

        // Instantiate hands object
        if (TestWeaponRef)
        {
            GameObject testweapon = Instantiate(TestWeaponRef, this.transform);
            testweapon.transform.localPosition = new Vector3(0, 0, 0);
            EquipWeapon(testweapon);
        }

        damageable          = GetComponentInChildren <DamageableEntity>();
        damageable.OnDeath += DropCurrentWeapon;

        stats = GetComponent <statisticsGestion>();
    }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        if (player != null)
        {
            stats           = player.GetComponent <statisticsGestion>();
            deathBeheaviour = player.GetComponent <MortDuJoueur>();
        }
        else
        {
            Debug.Log("Tu dois passer un player au shop pour qu'il fonctionne! >:(");
        }

        if (stats != null)
        {
            stats.onXpChange += updateXp;
            stats.onDmgUp    += updateDmg;
            stats.onResistUp += updateResist;
            stats.onTimerUp  += updateTimer;
            stats.onSpeedUp  += updateSpeed;
        }
        else
        {
            Debug.Log("Le player n'as pas de statisticGestion.");
        }

        if (deathBeheaviour != null)
        {
            MortDuJoueur.openShop += onOpenShop;
        }
        else
        {
            Debug.Log("Ton player n'as pas de DamageableEntity!");
        }

        gameObject.SetActive(false);
    }