Skip to content
Snippets Groups Projects
DiffScale.cs 866 B
Newer Older
GIRAULT COLIN's avatar
GIRAULT COLIN committed
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
colin's avatar
colin committed
using UnityEngine.EventSystems;
using TMPro;
GIRAULT COLIN's avatar
GIRAULT COLIN committed

GIRAULT COLIN's avatar
GIRAULT COLIN committed
public class DiffScale : MonoBehaviour
GIRAULT COLIN's avatar
GIRAULT COLIN committed
{
colin's avatar
colin committed
    public TMP_Text textshowed;
GIRAULT COLIN's avatar
GIRAULT COLIN committed
    // Start is called before the first frame update
    void Start()
    {
GIRAULT COLIN's avatar
GIRAULT COLIN committed
        Ui.motiv = 5f;
LE-CUDENEC JOFFREY's avatar
LE-CUDENEC JOFFREY committed
        Ui.difficulty = 0f;
        Ui.nbObst = 5;
GIRAULT COLIN's avatar
GIRAULT COLIN committed
    }

    // Update is called once per frame
    void Update()
    {
GIRAULT COLIN's avatar
GIRAULT COLIN committed
        float ech = Ui.difficulty/10;
GIRAULT COLIN's avatar
GIRAULT COLIN committed
        
        transform.localScale = new Vector3 (ech,1,1);

GIRAULT COLIN's avatar
GIRAULT COLIN committed
        if (Ui.difficulty < 0)
GIRAULT COLIN's avatar
GIRAULT COLIN committed
        {
GIRAULT COLIN's avatar
GIRAULT COLIN committed
            Ui.difficulty = 0;
GIRAULT COLIN's avatar
GIRAULT COLIN committed
        }

colin's avatar
colin committed
        if (Ui.nbObst < 0)
        {
            Ui.nbObst = 0;
        }

colin's avatar
colin committed
        textshowed = GameObject.Find("nbobstacle").GetComponent<TMP_Text>();
        textshowed.GetComponent<TMP_Text>().text = "Obstacles restants : " + Ui.nbObst.ToString();
GIRAULT COLIN's avatar
GIRAULT COLIN committed
    }
}