void Awake()
	{

		_timeLabelFactory = GetComponent<TimeLabelFactory>();

		_introSequence = GetComponent<IntroSequence>();
		_introSequence.IntroSequenceFinishedEvent.AddListener += OnIntroFinished;

		//_terrainGenerator = terrainTF.GetComponent<TerrainGenerator>();
		flag.GetComponent<TriggerListener>().OnTriggerEnterEvent.AddListener += OnEnterFlagEvent;
		//_terrainGenerator.OnTerrainSetupComplete.AddListener += OnTerrainSetupComplete;
		_arCamOriginalPos = arCameraTF.position;
		_arCamOriginalRot = arCameraTF.rotation;

		//multipleMarkerController.OnMaxTrackersDetected.AddListener += OnMaxTrackersDetected;

		UIEventListener.Get(homeButton).onClick += (go) =>
		{
			Time.timeScale = 1f;
			LoadingScreen.LoadScene("MainMenu");
		};

		UIEventListener.Get(resetButton).onClick += (go) =>
		{
			multipleMarkerController.ResetMarkersTransform();
			ResetARCamera();
			terrainTF.position = Vector3.zero;
			terrainTF.rotation = Quaternion.identity;
			Reset();
		
		};

		multipleMarkerController.OnTrackersStatusModified.AddListener += OnTrackersStatusModified;
		InvokeRepeating( _updateElapsedTime,0f,1f);
		_startTime = Time.timeSinceLevelLoad;
		_currentTime = MAX_TIME;

		debrisFactory.PlayerCollisionEvent.AddListener += OnPlayerCollisionEvent;
	}
Пример #2
0
    void Awake()
    {
        _timeLabelFactory = GetComponent <TimeLabelFactory>();

        _introSequence = GetComponent <IntroSequence>();
        _introSequence.IntroSequenceFinishedEvent.AddListener += OnIntroFinished;

        //_terrainGenerator = terrainTF.GetComponent<TerrainGenerator>();
        flag.GetComponent <TriggerListener>().OnTriggerEnterEvent.AddListener += OnEnterFlagEvent;
        //_terrainGenerator.OnTerrainSetupComplete.AddListener += OnTerrainSetupComplete;
        _arCamOriginalPos = arCameraTF.position;
        _arCamOriginalRot = arCameraTF.rotation;

        //multipleMarkerController.OnMaxTrackersDetected.AddListener += OnMaxTrackersDetected;

        UIEventListener.Get(homeButton).onClick += (go) =>
        {
            Time.timeScale = 1f;
            LoadingScreen.LoadScene("MainMenu");
        };

        UIEventListener.Get(resetButton).onClick += (go) =>
        {
            multipleMarkerController.ResetMarkersTransform();
            ResetARCamera();
            terrainTF.position = Vector3.zero;
            terrainTF.rotation = Quaternion.identity;
            Reset();
        };

        multipleMarkerController.OnTrackersStatusModified.AddListener += OnTrackersStatusModified;
        InvokeRepeating(_updateElapsedTime, 0f, 1f);
        _startTime   = Time.timeSinceLevelLoad;
        _currentTime = MAX_TIME;

        debrisFactory.PlayerCollisionEvent.AddListener += OnPlayerCollisionEvent;
    }