Beispiel #1
0
    private void Awake()
    {
        shop  = FindObjectOfType <DeathShop>();
        death = GameObject.FindGameObjectWithTag("MainCharacter").GetComponent <MortDuJoueur>();

        shop.ConfirmBuy       += OpenHud;
        MortDuJoueur.openShop += CloseHud;
    }
    // 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);
    }