void Awake()
    {
        DontDestroyOnLoad(this);

        if (playerInstance == null)
        {
            playerInstance = this;
        }
        else
        {
            DestroyObject(gameObject);
        }
    }
Esempio n. 2
0
    void Start()
    {
        //Debug.Log(transition.name);

        if (SceneManager.GetActiveScene().buildIndex == 0)
        {
            startSUT.onClick.AddListener(GoToSimulationSUT);
            startNonSUT.onClick.AddListener(GoToSimulationNonSUT);
        }
        if (SceneManager.GetActiveScene().buildIndex == 1 || SceneManager.GetActiveScene().buildIndex == 2)
        {
            valueHolder = GameObject.FindGameObjectWithTag("valueHolder").GetComponent <ValueHolderScript>();
            globalTimer = GameObject.FindGameObjectWithTag("globalTimer").GetComponent <GlobalTimerScript>();
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     values = GameObject.FindGameObjectWithTag("valueHolder").GetComponent <ValueHolderScript>();
 }